VRWGraphSMPModifier.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  VRWGraphModifier
26 
27 Description
28  This class is a modifier for VRWGraph which allows for multi-threaded
29  execution of most time-consuimg functions
30 
31 SourceFiles
32  VRWGraphSMPModifier.H
33  VRWGraphSMPModifier.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef VRWGraphSMPModifier_H
38 #define VRWGraphSMPModifier_H
39 
40 #include "VRWGraph.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class VRWGraphSMPModifier Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 {
53  // Private data
54  //- list containing the data
56 
57  // Private member functions
58 
59  //- Disallow default construct
61 
62  //- Disallow bitwise copy construct
64 
65  //- Disallow bitwise assignment
66  void operator=(const VRWGraphSMPModifier&);
67 
68 public:
69 
70  // Constructor
71 
72  //- Construct from reference to VRWGraph
74 
75  // Destructor
76 
78 
79  // Member Functions
80 
81  //- set the size and row sizes
82  template<class ListType>
83  void setSizeAndRowSize(const ListType&);
84 
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);
88 
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);
94 
95  void reverseAddressing(const VRWGraph& origGraph);
96 
97  //- set the graph to the reverse of the original graph and mapped
98  //- to another space.
99  template<class ListType, class GraphType>
100  void reverseAddressing(const ListType&, const GraphType&);
101 
102  template<class ListType>
103  void reverseAddressing(const ListType&, const VRWGraph&);
104 
105  //- optimize memory usage
106  // this should be used once the graph will not be resized any more
107  void optimizeMemoryUsage();
108 
109  //- Assignment operator
110  void operator=(const VRWGraph&);
111 };
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 } // End namespace Foam
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 #ifdef NoRepository
122 #endif
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #endif
127 
128 // ************************************************************************* //
Foam::VRWGraphSMPModifier::graph_
VRWGraph & graph_
list containing the data
Definition: VRWGraphSMPModifier.H:54
VRWGraph.H
Foam::VRWGraphSMPModifier::optimizeMemoryUsage
void optimizeMemoryUsage()
optimize memory usage
Definition: VRWGraphSMPModifier.C:272
Foam::VRWGraphSMPModifier::VRWGraphSMPModifier
VRWGraphSMPModifier()
Disallow default construct.
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::VRWGraphSMPModifier::reverseAddressing
void reverseAddressing(const GraphType &origGraph)
Definition: VRWGraphSMPModifierTemplates.C:111
VRWGraphSMPModifierTemplates.C
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::VRWGraphSMPModifier::operator=
void operator=(const VRWGraphSMPModifier &)
Disallow bitwise assignment.
Foam::VRWGraphSMPModifier::~VRWGraphSMPModifier
~VRWGraphSMPModifier()
Definition: VRWGraphSMPModifier.C:45
Foam::VRWGraphSMPModifier
Definition: VRWGraphSMPModifier.H:50
Foam::VRWGraph
Definition: VRWGraph.H:101
Foam::VRWGraphSMPModifier::setSizeAndRowSize
void setSizeAndRowSize(const ListType &)
set the size and row sizes
Definition: VRWGraphSMPModifierTemplates.C:41
Foam::VRWGraphSMPModifier::mergeGraphs
void mergeGraphs(const List< VRWGraph > &graphParts)
Definition: VRWGraphSMPModifier.C:50