meshSurfaceEngine.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  meshSurfaceEngine
26 
27 Description
28  Calculates surface of the mesh
29 
30 SourceFiles
31  meshSurfaceEngine.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef meshSurfaceEngine_H
36 #define meshSurfaceEngine_H
37 
38 #include "polyMeshGenModifier.H"
39 #include "SubList.H"
40 #include "boolList.H"
41 #include "DynList.H"
42 #include "VRWGraph.H"
43 #include "triangle.H"
44 #include "Map.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class meshSurfaceEngine Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 {
57  // Private data
58  //- reference to the mesh
60 
61  //- number of active patch
62  const label activePatch_;
63 
64  //- boundary points
66 
67  //- boundary faces
69 
70  //- patches boundary faces are in
72 
73  //- face owners
75 
76  //- point faces addressing
78  mutable VRWGraph* pointInFacePtr_;
79 
80  //- point-patches addressing
81  mutable VRWGraph* pointPatchesPtr_;
82 
83  //- pointBoundaryPoint addressing
84  mutable labelList* bppPtr_;
85 
86  //- point points addressing
87  mutable VRWGraph* pointPointsPtr_;
88 
89  //- edges
90  mutable edgeList* edgesPtr_;
91 
92  //- boundary point-edges addressing
93  mutable VRWGraph* bpEdgesPtr_;
94 
95  //- edge faces addressing
96  mutable VRWGraph* edgeFacesPtr_;
97 
98  //- face edges addressing
99  mutable VRWGraph* faceEdgesPtr_;
100 
101  //- edge-patches addressing
102  mutable VRWGraph* edgePatchesPtr_;
103 
104  //- face-faces addressing
105  mutable VRWGraph* faceFacesPtr_;
106 
107  //- point normals
108  mutable vectorField* pointNormalsPtr_;
109 
110  //- face normals
111  mutable vectorField* faceNormalsPtr_;
112 
113  //- face centres
114  mutable vectorField* faceCentresPtr_;
115 
116  // Private data for parallel execution
117 
118  //- global boundary point label
120 
121  //- global boundary point to local addressing
123 
124  //- boundary point-processors addressing
125  mutable VRWGraph* bpProcsPtr_;
126 
127  //- neighbour processors for communication when sending point data
129 
130  //- global boundary edge label
132 
133  //- global boundary edge to local addressing
135 
136  //- boundary edge-processors addressing
137  mutable VRWGraph* beProcsPtr_;
138 
139  //- neighbour processors for communication when sending edge data
141 
142  //- processor containing other face and face-patch addressing
145 
146  //- global label for boundary faces
148 
149  // Private member functions
150 
151  //- calculate boundary nodes, faces and addressing
152  void calculateBoundaryFaces() const;
153  void calculateBoundaryOwners() const;
154  void calculateBoundaryNodes() const;
155 
156  void calculateBoundaryFacePatches() const;
157 
158  void calculatePointFaces() const;
159 
160  void calculatePointPatches() const;
161 
162  void calculatePointPoints() const;
163 
164  void calculatePointNormals() const;
165  void calculateFaceNormals() const;
166  void calculateFaceCentres() const;
167 
169 
170  void calculateEdgesAndAddressing() const;
171  void calculateFaceEdgesAddressing() const;
172  void calculateEdgeFacesAddressing() const;
173  void calculateEdgePatchesAddressing() const;
174  void calculateFaceFacesAddressing() const;
175 
176  // Private member functions for parallel runs
177 
178  void calcGlobalBoundaryPointLabels() const;
179  void calcGlobalBoundaryEdgeLabels() const;
180  void calcAddressingForProcEdges() const;
181  void calcGlobalBoundaryFaceLabels() const;
182 
183  // Private member functions
184 
185  void clearOut();
186 
187  //- Disallow default bitwise copy construct
189 
190  //- Disallow default bitwise assignment
191  void operator=(const meshSurfaceEngine&);
192 
193 public:
194 
195  friend class meshSurfaceEngineModifier;
196 
197  // Constructors
198 
199  //- Construct from mesh
201 
202  //- Construct from mesh and patch
203  meshSurfaceEngine(polyMeshGen &mesh, const label patchI);
204 
205  // Destructor
206 
208 
209  // Member Functions
210  inline const polyMeshGen& mesh() const;
211  inline const pointFieldPMG& points() const;
212  inline const faceListPMG& faces() const;
213  inline const cellListPMG& cells() const;
214 
215  inline const labelList& boundaryPoints() const;
216 
217  inline const faceList::subList& boundaryFaces() const;
218 
219  //- patch label for each boundary face
220  inline const labelList& boundaryFacePatches() const;
221 
222  inline const labelList& faceOwners() const;
223 
224  inline const VRWGraph& pointFaces() const;
225  inline const VRWGraph& pointInFaces() const;
226 
227  //inline const VRWGraph& pointPatches() const;
228 
229  inline const VRWGraph& pointPoints() const;
230 
231  inline const vectorField& pointNormals() const;
232 
233  inline const vectorField& faceNormals() const;
234 
235  inline const vectorField& faceCentres() const;
236 
237  inline const labelList& bp() const;
238 
239  inline const edgeList& edges() const;
240 
241  inline const VRWGraph& boundaryPointEdges() const;
242 
243  inline const VRWGraph& edgeFaces() const;
244 
245  inline const VRWGraph& faceEdges() const;
246 
247  inline const VRWGraph& edgePatches() const;
248 
249  inline const VRWGraph& faceFaces() const;
250 
251  // Functions for parallel runs
252  //- global boundary point label
253  inline const labelList& globalBoundaryPointLabel() const;
254 
255  //- global point label to local label. Only for processors points
256  inline const Map<label>& globalToLocalBndPointAddressing() const;
257 
258  //- processors which contain the vertex
259  inline const VRWGraph& bpAtProcs() const;
260 
261  //- communication matrix for sending point data
262  inline const DynList<label>& bpNeiProcs() const;
263 
264  //- global boundary edge label
265  inline const labelList& globalBoundaryEdgeLabel() const;
266 
267  //- global boundary edge label to local label. Only for processor edges
268  inline const Map<label>& globalToLocalBndEdgeAddressing() const;
269 
270  //- processors which contain the edges
271  inline const VRWGraph& beAtProcs() const;
272 
273  //- communication matrix for sending edge data
274  inline const DynList<label>& beNeiProcs() const;
275 
276  //- patch label and processor label at which the other surface face
277  //- sharing processor edge is located. Only for processor edges
278  inline const Map<label>& otherEdgeFaceAtProc() const;
279  inline const Map<label>& otherEdgeFacePatch() const;
280 
281  //- global boundary face label
282  inline const labelList& globalBoundaryFaceLabel() const;
283 };
284 
285 
286 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
287 
288 } // End namespace Foam
289 
290 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
291 
292 #include "meshSurfaceEngineI.H"
293 
294 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
295 
296 #endif
297 
298 // ************************************************************************* //
Foam::meshSurfaceEngine::faceCentres
const vectorField & faceCentres() const
Definition: meshSurfaceEngineI.H:277
Foam::meshSurfaceEngine::boundaryPointsPtr_
labelList * boundaryPointsPtr_
boundary points
Definition: meshSurfaceEngine.H:64
Foam::meshSurfaceEngine::boundaryPointEdges
const VRWGraph & boundaryPointEdges() const
Definition: meshSurfaceEngineI.H:315
Foam::meshSurfaceEngine::pointFacesPtr_
VRWGraph * pointFacesPtr_
point faces addressing
Definition: meshSurfaceEngine.H:76
Foam::meshSurfaceEngine::bpAtProcs
const VRWGraph & bpAtProcs() const
processors which contain the vertex
Definition: meshSurfaceEngineI.H:451
Foam::meshSurfaceEngine::beAtProcs
const VRWGraph & beAtProcs() const
processors which contain the edges
Definition: meshSurfaceEngineI.H:530
Foam::meshSurfaceEngine::pointInFaces
const VRWGraph & pointInFaces() const
Definition: meshSurfaceEngineI.H:181
meshSurfaceEngineI.H
Foam::meshSurfaceEngine::bpProcsPtr_
VRWGraph * bpProcsPtr_
boundary point-processors addressing
Definition: meshSurfaceEngine.H:124
Foam::meshSurfaceEngine::bp
const labelList & bp() const
Definition: meshSurfaceEngineI.H:64
Foam::meshSurfaceEngine::updatePointNormalsAtProcBoundaries
void updatePointNormalsAtProcBoundaries() const
Definition: meshSurfaceEngineCalculateBoundaryNodesAndFaces.C:803
SubList.H
boolList.H
Foam::meshSurfaceEngine::faceEdgesPtr_
VRWGraph * faceEdgesPtr_
face edges addressing
Definition: meshSurfaceEngine.H:98
Foam::meshSurfaceEngine::activePatch_
const label activePatch_
number of active patch
Definition: meshSurfaceEngine.H:61
Foam::meshSurfaceEngine::globalBoundaryEdgeLabelPtr_
labelList * globalBoundaryEdgeLabelPtr_
global boundary edge label
Definition: meshSurfaceEngine.H:130
Foam::meshSurfaceEngine::faceCentresPtr_
vectorField * faceCentresPtr_
face centres
Definition: meshSurfaceEngine.H:113
Foam::meshSurfaceEngine::faceNormalsPtr_
vectorField * faceNormalsPtr_
face normals
Definition: meshSurfaceEngine.H:110
Foam::meshSurfaceEngine::globalToLocalBndEdgeAddressing
const Map< label > & globalToLocalBndEdgeAddressing() const
global boundary edge label to local label. Only for processor edges
Definition: meshSurfaceEngineI.H:510
Foam::meshSurfaceEngine::globalBoundaryEdgeLabel
const labelList & globalBoundaryEdgeLabel() const
global boundary edge label
Definition: meshSurfaceEngineI.H:489
Foam::meshSurfaceEngine::calculateEdgePatchesAddressing
void calculateEdgePatchesAddressing() const
Definition: meshSurfaceEngineCalculateBoundaryNodesAndFaces.C:1263
triangle.H
Foam::meshSurfaceEngine::beProcsPtr_
VRWGraph * beProcsPtr_
boundary edge-processors addressing
Definition: meshSurfaceEngine.H:136
Foam::meshSurfaceEngine::globalBoundaryPointLabel
const labelList & globalBoundaryPointLabel() const
global boundary point label
Definition: meshSurfaceEngineI.H:410
Foam::meshSurfaceEngine::calculateFaceCentres
void calculateFaceCentres() const
Definition: meshSurfaceEngineCalculateBoundaryNodesAndFaces.C:789
Foam::meshSurfaceEngine::calculatePointPatches
void calculatePointPatches() const
Definition: meshSurfaceEngineCalculateBoundaryNodesAndFaces.C:484
Foam::meshSurfaceEngine::calculateFaceFacesAddressing
void calculateFaceFacesAddressing() const
Definition: meshSurfaceEngineCalculateBoundaryNodesAndFaces.C:1301
VRWGraph.H
Foam::meshSurfaceEngine::boundaryFacesPtr_
faceList::subList * boundaryFacesPtr_
boundary faces
Definition: meshSurfaceEngine.H:67
Foam::SubList
A List obtained as a section of another List.
Definition: SubList.H:53
Foam::meshSurfaceEngine::globalBoundaryFaceLabel
const labelList & globalBoundaryFaceLabel() const
global boundary face label
Definition: meshSurfaceEngineI.H:608
Foam::meshSurfaceEngine::bpNeiProcs
const DynList< label > & bpNeiProcs() const
communication matrix for sending point data
Definition: meshSurfaceEngineI.H:470
Foam::meshSurfaceEngine::pointFaces
const VRWGraph & pointFaces() const
Definition: meshSurfaceEngineI.H:162
polyMeshGenModifier.H
Foam::meshSurfaceEngine::globalBoundaryEdgeToLocalPtr_
Map< label > * globalBoundaryEdgeToLocalPtr_
global boundary edge to local addressing
Definition: meshSurfaceEngine.H:133
Foam::meshSurfaceEngine::boundaryFacePatches
const labelList & boundaryFacePatches() const
patch label for each boundary face
Definition: meshSurfaceEngineI.H:123
Foam::meshSurfaceEngine::faceEdges
const VRWGraph & faceEdges() const
Definition: meshSurfaceEngineI.H:353
Foam::Map< label >
Foam::meshSurfaceEngine::pointPointsPtr_
VRWGraph * pointPointsPtr_
point points addressing
Definition: meshSurfaceEngine.H:86
Foam::polyMeshGen
Definition: polyMeshGen.H:46
Foam::cellListPMG
Definition: cellListPMG.H:49
Foam::meshSurfaceEngine::otherEdgeFacePatchPtr_
Map< label > * otherEdgeFacePatchPtr_
Definition: meshSurfaceEngine.H:143
Foam::meshSurfaceEngine::faceFaces
const VRWGraph & faceFaces() const
Definition: meshSurfaceEngineI.H:391
Foam::meshSurfaceEngine::calculateBoundaryOwners
void calculateBoundaryOwners() const
Definition: meshSurfaceEngineCalculateBoundaryNodesAndFaces.C:106
Foam::meshSurfaceEngine::edgePatches
const VRWGraph & edgePatches() const
Definition: meshSurfaceEngineI.H:372
Foam::meshSurfaceEngine::meshSurfaceEngine
meshSurfaceEngine(const meshSurfaceEngine &)
Disallow default bitwise copy construct.
Map.H
Foam::meshSurfaceEngineModifier
Definition: meshSurfaceEngineModifier.H:48
Foam::meshSurfaceEngine::edgesPtr_
edgeList * edgesPtr_
edges
Definition: meshSurfaceEngine.H:89
Foam::meshSurfaceEngine::calcGlobalBoundaryPointLabels
void calcGlobalBoundaryPointLabels() const
Definition: meshSurfaceEngineParallelAddressing.C:46
Foam::meshSurfaceEngine::boundaryFaces
const faceList::subList & boundaryFaces() const
Definition: meshSurfaceEngineI.H:103
Foam::meshSurfaceEngine::calculatePointPoints
void calculatePointPoints() const
Definition: meshSurfaceEngineCalculateBoundaryNodesAndFaces.C:598
Foam::meshSurfaceEngine::globalBoundaryPointToLocalPtr_
Map< label > * globalBoundaryPointToLocalPtr_
global boundary point to local addressing
Definition: meshSurfaceEngine.H:121
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::meshSurfaceEngine::boundaryFacePatchPtr_
labelList * boundaryFacePatchPtr_
patches boundary faces are in
Definition: meshSurfaceEngine.H:70
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::meshSurfaceEngine::bpEdgesPtr_
VRWGraph * bpEdgesPtr_
boundary point-edges addressing
Definition: meshSurfaceEngine.H:92
Foam::meshSurfaceEngine::boundaryFaceOwnersPtr_
labelList * boundaryFaceOwnersPtr_
face owners
Definition: meshSurfaceEngine.H:73
Foam::meshSurfaceEngine::calculateFaceEdgesAddressing
void calculateFaceEdgesAddressing() const
Definition: meshSurfaceEngineCalculateBoundaryNodesAndFaces.C:1091
Foam::meshSurfaceEngine::otherEdgeFaceAtProc
const Map< label > & otherEdgeFaceAtProc() const
Definition: meshSurfaceEngineI.H:568
Foam::meshSurfaceEngine::beNeiProcs
const DynList< label > & beNeiProcs() const
communication matrix for sending edge data
Definition: meshSurfaceEngineI.H:549
Foam::meshSurfaceEngine::pointNormals
const vectorField & pointNormals() const
Definition: meshSurfaceEngineI.H:239
Foam::meshSurfaceEngine::globalBoundaryPointLabelPtr_
labelList * globalBoundaryPointLabelPtr_
global boundary point label
Definition: meshSurfaceEngine.H:118
Foam::meshSurfaceEngine::points
const pointFieldPMG & points() const
Definition: meshSurfaceEngineI.H:49
Foam::meshSurfaceEngine::calculatePointFaces
void calculatePointFaces() const
Definition: meshSurfaceEngineCalculateBoundaryNodesAndFaces.C:269
Foam::meshSurfaceEngine::calcGlobalBoundaryEdgeLabels
void calcGlobalBoundaryEdgeLabels() const
Definition: meshSurfaceEngineParallelAddressing.C:323
Foam::meshSurfaceEngine::~meshSurfaceEngine
~meshSurfaceEngine()
Definition: meshSurfaceEngine.C:124
Foam::meshSurfaceEngine::globalBoundaryFaceLabelPtr_
labelList * globalBoundaryFaceLabelPtr_
global label for boundary faces
Definition: meshSurfaceEngine.H:146
Foam::meshSurfaceEngine::pointPoints
const VRWGraph & pointPoints() const
Definition: meshSurfaceEngineI.H:220
Foam::meshSurfaceEngine::operator=
void operator=(const meshSurfaceEngine &)
Disallow default bitwise assignment.
Foam::meshSurfaceEngine::bpNeiProcsPtr_
DynList< label > * bpNeiProcsPtr_
neighbour processors for communication when sending point data
Definition: meshSurfaceEngine.H:127
Foam::meshSurfaceEngine::edgeFaces
const VRWGraph & edgeFaces() const
Definition: meshSurfaceEngineI.H:334
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::DynList< label >
Foam::meshSurfaceEngine::edges
const edgeList & edges() const
Definition: meshSurfaceEngineI.H:296
Foam::meshSurfaceEngine::calculatePointNormals
void calculatePointNormals() const
Definition: meshSurfaceEngineCalculateBoundaryNodesAndFaces.C:738
Foam::meshSurfaceEngine::calculateFaceNormals
void calculateFaceNormals() const
Definition: meshSurfaceEngineCalculateBoundaryNodesAndFaces.C:771
Foam::meshSurfaceEngine::bppPtr_
labelList * bppPtr_
pointBoundaryPoint addressing
Definition: meshSurfaceEngine.H:83
Foam::meshSurfaceEngine::mesh_
polyMeshGen & mesh_
reference to the mesh
Definition: meshSurfaceEngine.H:58
Foam::meshSurfaceEngine::pointPatchesPtr_
VRWGraph * pointPatchesPtr_
point-patches addressing
Definition: meshSurfaceEngine.H:80
Foam::meshSurfaceEngine::calculateEdgesAndAddressing
void calculateEdgesAndAddressing() const
Definition: meshSurfaceEngineCalculateBoundaryNodesAndFaces.C:885
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::meshSurfaceEngine::calculateBoundaryFaces
void calculateBoundaryFaces() const
calculate boundary nodes, faces and addressing
Definition: meshSurfaceEngineCalculateBoundaryNodesAndFaces.C:50
Foam::meshSurfaceEngine::calculateBoundaryFacePatches
void calculateBoundaryFacePatches() const
Definition: meshSurfaceEngineCalculateBoundaryNodesAndFaces.C:250
Foam::meshSurfaceEngine::otherEdgeFaceAtProcPtr_
Map< label > * otherEdgeFaceAtProcPtr_
processor containing other face and face-patch addressing
Definition: meshSurfaceEngine.H:142
Foam::meshSurfaceEngine::calcAddressingForProcEdges
void calcAddressingForProcEdges() const
Definition: meshSurfaceEngineParallelAddressing.C:661
Foam::meshSurfaceEngine::pointNormalsPtr_
vectorField * pointNormalsPtr_
point normals
Definition: meshSurfaceEngine.H:107
Foam::meshSurfaceEngine::calculateEdgeFacesAddressing
void calculateEdgeFacesAddressing() const
Definition: meshSurfaceEngineCalculateBoundaryNodesAndFaces.C:1157
Foam::meshSurfaceEngine::clearOut
void clearOut()
Definition: meshSurfaceEngine.C:131
Foam::meshSurfaceEngine::boundaryPoints
const labelList & boundaryPoints() const
Definition: meshSurfaceEngineI.H:84
Foam::meshSurfaceEngine::globalToLocalBndPointAddressing
const Map< label > & globalToLocalBndPointAddressing() const
global point label to local label. Only for processors points
Definition: meshSurfaceEngineI.H:431
Foam::meshSurfaceEngine::otherEdgeFacePatch
const Map< label > & otherEdgeFacePatch() const
Definition: meshSurfaceEngineI.H:588
Foam::faceListPMG
Definition: faceListPMG.H:50
Foam::pointFieldPMG
Definition: pointFieldPMG.H:50
Foam::VRWGraph
Definition: VRWGraph.H:101
Foam::meshSurfaceEngine::edgeFacesPtr_
VRWGraph * edgeFacesPtr_
edge faces addressing
Definition: meshSurfaceEngine.H:95
Foam::meshSurfaceEngine::faceNormals
const vectorField & faceNormals() const
Definition: meshSurfaceEngineI.H:258
Foam::meshSurfaceEngine::calcGlobalBoundaryFaceLabels
void calcGlobalBoundaryFaceLabels() const
Definition: meshSurfaceEngineParallelAddressing.C:772
Foam::meshSurfaceEngine::mesh
const polyMeshGen & mesh() const
Definition: meshSurfaceEngineI.H:44
Foam::meshSurfaceEngine
Definition: meshSurfaceEngine.H:54
DynList.H
Foam::meshSurfaceEngine::pointInFacePtr_
VRWGraph * pointInFacePtr_
Definition: meshSurfaceEngine.H:77
Foam::meshSurfaceEngine::calculateBoundaryNodes
void calculateBoundaryNodes() const
Definition: meshSurfaceEngineCalculateBoundaryNodesAndFaces.C:126
Foam::meshSurfaceEngine::edgePatchesPtr_
VRWGraph * edgePatchesPtr_
edge-patches addressing
Definition: meshSurfaceEngine.H:101
Foam::meshSurfaceEngine::cells
const cellListPMG & cells() const
Definition: meshSurfaceEngineI.H:59
Foam::meshSurfaceEngine::beNeiProcsPtr_
DynList< label > * beNeiProcsPtr_
neighbour processors for communication when sending edge data
Definition: meshSurfaceEngine.H:139
Foam::meshSurfaceEngine::faceFacesPtr_
VRWGraph * faceFacesPtr_
face-faces addressing
Definition: meshSurfaceEngine.H:104
Foam::meshSurfaceEngine::faceOwners
const labelList & faceOwners() const
Definition: meshSurfaceEngineI.H:143
Foam::meshSurfaceEngine::faces
const faceListPMG & faces() const
Definition: meshSurfaceEngineI.H:54