1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | cfMesh: A library for mesh generation
5 \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6 \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of cfMesh.
11 cfMesh is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 3 of the License, or (at your
14 option) any later version.
16 cfMesh is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
28 This class is a modifier for VRWGraph which allows for multi-threaded
29 execution of most time-consuimg functions
35 \*---------------------------------------------------------------------------*/
37 #ifndef VRWGraphSMPModifier_H
38 #define VRWGraphSMPModifier_H
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class VRWGraphSMPModifier Declaration
49 \*---------------------------------------------------------------------------*/
51 class VRWGraphSMPModifier
54 //- list containing the data
57 // Private member functions
59 //- Disallow default construct
60 VRWGraphSMPModifier();
62 //- Disallow bitwise copy construct
63 VRWGraphSMPModifier(const VRWGraphSMPModifier&);
65 //- Disallow bitwise assignment
66 void operator=(const VRWGraphSMPModifier&);
72 //- Construct from reference to VRWGraph
73 VRWGraphSMPModifier(VRWGraph&);
77 ~VRWGraphSMPModifier();
81 //- set the size and row sizes
82 template<class ListType>
83 void setSizeAndRowSize(const ListType&);
85 //- merge graphs with the identical number of rows
86 //- into a single one. Use for SMP parallelisation
87 void mergeGraphs(const List<VRWGraph>& graphParts);
89 //- set the graph to the reverse of the original graph.
90 //- the rows of such graph store the rows which contain the elements
91 //- of the original graph
92 template<class GraphType>
93 void reverseAddressing(const GraphType& origGraph);
95 void reverseAddressing(const VRWGraph& origGraph);
97 //- set the graph to the reverse of the original graph and mapped
99 template<class ListType, class GraphType>
100 void reverseAddressing(const ListType&, const GraphType&);
102 template<class ListType>
103 void reverseAddressing(const ListType&, const VRWGraph&);
105 //- optimize memory usage
106 // this should be used once the graph will not be resized any more
107 void optimizeMemoryUsage();
109 //- Assignment operator
110 void operator=(const VRWGraph&);
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 } // End namespace Foam
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 # include "VRWGraphSMPModifierTemplates.C"
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 // ************************************************************************* //