meshOctreeAddressingI.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 Description
25 
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "meshOctreeAddressing.H"
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 
37 {
38  if( !nodeLabelsPtr_ )
40 
41  return nNodes_;
42 }
43 
45 {
46  if( !octreePointsPtr_ )
48 
49  return *octreePointsPtr_;
50 }
51 
53 {
54  if( !nodeLabelsPtr_ )
56 
57  return *nodeLabelsPtr_;
58 }
59 
61 {
62  if( !nodeLeavesPtr_ )
64 
65  return *nodeLeavesPtr_;
66 }
67 
69 {
70  if( !boxTypePtr_ )
71  findUsedBoxes();
72 
73  return *boxTypePtr_;
74 }
75 
77 (
78  const label boxI,
79  const direction type
80 )
81 {
82  if( boxTypePtr_ )
83  {
84  List<direction>& boxType = *boxTypePtr_;
85  boxType[boxI] |= type;
86  }
87 }
88 
90 {
91  return octree_;
92 }
93 
95 {
96  if( !nodeTypePtr_ )
98 
99  return *nodeTypePtr_;
100 }
101 
103 {
104  if( !octreeFacesPtr_ )
106 
107  return *octreeFacesPtr_;
108 }
109 
111 {
112  if( !octreeFacesOwnersPtr_ )
114 
115  return *octreeFacesOwnersPtr_;
116 }
117 
119 {
122 
124 }
125 
127 {
128  if( !leafFacesPtr_ )
130 
131  return *leafFacesPtr_;
132 }
133 
135 {
136  if( !leafLeavesPtr_ )
138 
139  return *leafLeavesPtr_;
140 }
141 
143 {
144  if( !nodeFacesPtr_ )
146 
147  return *nodeFacesPtr_;
148 }
149 
151 {
152  if( !octreeEdgesPtr_ )
154 
155  return *octreeEdgesPtr_;
156 }
157 
159 {
160  if( !edgeLeavesPtr_ )
162 
163  return *edgeLeavesPtr_;
164 }
165 
167 {
168  if( !leafEdgesPtr_ )
170 
171  return *leafEdgesPtr_;
172 }
173 
175 {
176  if( !nodeEdgesPtr_ )
178 
179  return *nodeEdgesPtr_;
180 }
181 
183 {
184  if( !faceEdgesPtr_ )
186 
187  return *faceEdgesPtr_;
188 }
189 
191 {
192  if( !edgeFacesPtr_ )
194 
195  return *edgeFacesPtr_;
196 }
197 
199 {
200  if( !globalPointLabelPtr_ )
202 
203  return *globalPointLabelPtr_;
204 }
205 
208 {
211 
212  return *globalPointToLocalPtr_;
213 }
214 
216 {
217  if( !pointProcsPtr_ )
219 
220  return *pointProcsPtr_;
221 }
222 
224 {
225  if( !globalFaceLabelPtr_ )
227 
228  return *globalFaceLabelPtr_;
229 }
230 
233 {
234  if( !globalFaceToLocalPtr_ )
236 
237  return *globalFaceToLocalPtr_;
238 }
239 
241 {
242  if( !faceProcsPtr_ )
244 
245  return *faceProcsPtr_;
246 }
247 
249 {
250  if( !globalLeafLabelPtr_ )
252 
253  return *globalLeafLabelPtr_;
254 }
255 
257 {
258  if( !leafAtProcsPtr_ )
260 
261  return *leafAtProcsPtr_;
262 }
263 
266 {
267  if( !globalLeafToLocalPtr_ )
269 
270  return *globalLeafToLocalPtr_;
271 }
272 
273 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
274 
275 } // End namespace Foam
276 
277 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::meshOctreeAddressing::globalPointLabelPtr_
labelLongList * globalPointLabelPtr_
global octree point label
Definition: meshOctreeAddressing.H:123
Foam::meshOctreeAddressing::calculateNodeFaces
void calculateNodeFaces() const
calculate node-faces addressing
Definition: meshOctreeAddressingCreation.C:1093
Foam::meshOctreeAddressing::leafEdgesPtr_
VRWGraph * leafEdgesPtr_
leaf-edges addressing
Definition: meshOctreeAddressing.H:111
Foam::meshOctreeAddressing::nodeEdgesPtr_
VRWGraph * nodeEdgesPtr_
node-edges addressing
Definition: meshOctreeAddressing.H:114
Foam::meshOctreeAddressing::globalFaceLabelPtr_
labelLongList * globalFaceLabelPtr_
global octree face label
Definition: meshOctreeAddressing.H:132
Foam::meshOctreeAddressing::nodeType
const List< direction > & nodeType() const
return type of node (INNERNODE,or OUTERNODE)
Definition: meshOctreeAddressingI.H:94
Foam::meshOctreeAddressing::globalPointToLocalPtr_
Map< label > * globalPointToLocalPtr_
global point to local label addressing
Definition: meshOctreeAddressing.H:126
Foam::meshOctreeAddressing::faceEdgesPtr_
VRWGraph * faceEdgesPtr_
face-edges addressing
Definition: meshOctreeAddressing.H:117
Foam::meshOctreeAddressing::leafLeavesPtr_
VRWGraph * leafLeavesPtr_
leaf-leaves addressing
Definition: meshOctreeAddressing.H:102
Foam::meshOctreeAddressing::octreeFacesNeighboursPtr_
labelLongList * octreeFacesNeighboursPtr_
Definition: meshOctreeAddressing.H:93
Foam::meshOctreeAddressing::nodeLabels
const VRWGraph & nodeLabels() const
return nodeLabels
Definition: meshOctreeAddressingI.H:52
Foam::meshOctreeAddressing::createOctreeFaces
void createOctreeFaces() const
calculate faces
Definition: meshOctreeAddressingCreation.C:752
Foam::meshOctreeAddressing::findUsedBoxes
void findUsedBoxes() const
assemble boxTypePtr_ list
Definition: meshOctreeAddressingCreation.C:441
Foam::meshOctreeAddressing::octreePointsPtr_
pointField * octreePointsPtr_
coordinates of octree nodes
Definition: meshOctreeAddressing.H:75
Foam::meshOctreeAddressing::calcGlobalLeafLabels
void calcGlobalLeafLabels() const
Definition: meshOctreeAddressingParallelAddressing.C:346
Foam::meshOctreeAddressing::edgeFacesPtr_
VRWGraph * edgeFacesPtr_
edge-faces addressing
Definition: meshOctreeAddressing.H:120
Foam::Map< label >
Foam::meshOctreeAddressing::pointAtProcs
const VRWGraph & pointAtProcs() const
processors which contain an octree point
Definition: meshOctreeAddressingI.H:215
Foam::meshOctreeAddressing::createNodeLabels
void createNodeLabels() const
calculate nodeLabelsPtr_
Definition: meshOctreeAddressingCreation.C:153
Foam::meshOctreeAddressing::globalLeafLabelPtr_
labelLongList * globalLeafLabelPtr_
global leaf label
Definition: meshOctreeAddressing.H:141
Foam::meshOctreeAddressing::globalToLocalLeafAddressing
const Map< label > & globalToLocalLeafAddressing() const
return global leaf label to local label addressing
Definition: meshOctreeAddressingI.H:265
Foam::meshOctreeAddressing::octreeFacesOwnersPtr_
labelLongList * octreeFacesOwnersPtr_
Definition: meshOctreeAddressing.H:92
Foam::meshOctreeAddressing::octreeFaceOwner
const labelLongList & octreeFaceOwner() const
return owners of octree faces
Definition: meshOctreeAddressingI.H:110
Foam::meshOctreeAddressing::calcGlobalPointLabels
void calcGlobalPointLabels() const
Definition: meshOctreeAddressingParallelAddressing.C:48
Foam::meshOctreeAddressing::nodeTypePtr_
List< direction > * nodeTypePtr_
identify created nodes as OUTERNODE or INNERNODE
Definition: meshOctreeAddressing.H:87
Foam::meshOctreeAddressing::faceAtProcs
const VRWGraph & faceAtProcs() const
return processors which contain each octree face
Definition: meshOctreeAddressingI.H:240
Foam::LongList< label >
Foam::meshOctreeAddressing::calculateEdgeLeaves
void calculateEdgeLeaves() const
calculate edge-leaves addressing
Definition: meshOctreeAddressingCreation.C:1211
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::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::meshOctreeAddressing::leafAtProcs
const VRWGraph & leafAtProcs() const
return processors which contain each octree leaf
Definition: meshOctreeAddressingI.H:256
Foam::meshOctreeAddressing::setBoxType
void setBoxType(const label boxI, const direction type)
set box type
Definition: meshOctreeAddressingI.H:77
Foam::meshOctreeAddressing::boxTypePtr_
List< direction > * boxTypePtr_
identify which boxes should be used as mesh cells
Definition: meshOctreeAddressing.H:84
Foam::meshOctreeAddressing::nodeLeavesPtr_
FRWGraph< label, 8 > * nodeLeavesPtr_
node leaves
Definition: meshOctreeAddressing.H:81
Foam::meshOctreeAddressing::createOctreePoints
void createOctreePoints() const
calculate octreePointsPtr_
Definition: meshOctreeAddressingCreation.C:123
Foam::meshOctreeAddressing::calculateLeafEdges
void calculateLeafEdges() const
calculate leaf-edges
Definition: meshOctreeAddressingCreation.C:1200
Foam::meshOctreeAddressing::nodeFaces
const VRWGraph & nodeFaces() const
return node-faces addressing
Definition: meshOctreeAddressingI.H:142
Foam::meshOctreeAddressing::createOctreeEdges
void createOctreeEdges() const
calculate edges
Definition: meshOctreeAddressingCreation.C:1140
Foam::meshOctreeAddressing::edgeLeaves
const VRWGraph & edgeLeaves() const
return edge-leaves addressing
Definition: meshOctreeAddressingI.H:158
Foam::meshOctreeAddressing::leafFaces
const VRWGraph & leafFaces() const
return octree box-faces addressing
Definition: meshOctreeAddressingI.H:126
Foam::meshOctreeAddressing::globalPointLabel
const labelLongList & globalPointLabel() const
return global point labels
Definition: meshOctreeAddressingI.H:198
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
meshOctreeAddressing.H
Foam::meshOctreeAddressing::createNodeLeaves
void createNodeLeaves() const
calculate nodeLeavesPtr_
Definition: meshOctreeAddressingCreation.C:400
Foam::meshOctreeAddressing::calculateLeafLeaves
void calculateLeafLeaves() const
calculate leaf-leaves addressing
Definition: meshOctreeAddressingCreation.C:1103
Foam::meshOctreeAddressing::faceEdges
const VRWGraph & faceEdges() const
return face-edges addressing
Definition: meshOctreeAddressingI.H:182
Foam::meshOctreeAddressing::octreeFaceNeighbour
const labelLongList & octreeFaceNeighbour() const
return neighbours of octree faces
Definition: meshOctreeAddressingI.H:118
Foam::meshOctreeAddressing::octreeEdgesPtr_
LongList< edge > * octreeEdgesPtr_
edges of the octree
Definition: meshOctreeAddressing.H:105
Foam::meshOctreeAddressing::globalFaceToLocalPtr_
Map< label > * globalFaceToLocalPtr_
global face label to local label addressing
Definition: meshOctreeAddressing.H:135
Foam::meshOctreeAddressing::pointProcsPtr_
VRWGraph * pointProcsPtr_
point-processors addressing
Definition: meshOctreeAddressing.H:129
Foam::meshOctreeAddressing::faceProcsPtr_
VRWGraph * faceProcsPtr_
face-processors addressing
Definition: meshOctreeAddressing.H:138
Foam::meshOctreeAddressing::globalFaceLabel
const labelLongList & globalFaceLabel() const
return global labels of octree faces
Definition: meshOctreeAddressingI.H:223
Foam::meshOctreeAddressing::octreeFacesPtr_
VRWGraph * octreeFacesPtr_
faces of the octree
Definition: meshOctreeAddressing.H:91
Foam::meshOctreeAddressing::boxType
const List< direction > & boxType() const
return which octree boxes are used for mesh creation
Definition: meshOctreeAddressingI.H:68
Foam::meshOctreeAddressing::nNodes_
label nNodes_
number of created octree nodes
Definition: meshOctreeAddressing.H:72
Foam::meshOctreeAddressing::octree
const meshOctree & octree() const
return const reference to meshOctree
Definition: meshOctreeAddressingI.H:89
Foam::meshOctreeAddressing::leafLeaves
const VRWGraph & leafLeaves() const
return leaf-leaves addressing
Definition: meshOctreeAddressingI.H:134
Foam::meshOctreeAddressing::calculateNodeType
void calculateNodeType() const
calculate nodeTypePtr_
Definition: meshOctreeAddressingCreation.C:711
Foam::meshOctreeAddressing::edgeLeavesPtr_
VRWGraph * edgeLeavesPtr_
edges-leaves addressing
Definition: meshOctreeAddressing.H:108
Foam::meshOctreeAddressing::globalToLocalFaceAddressing
const Map< label > & globalToLocalFaceAddressing() const
return global face label to face label. Only for processor faces
Definition: meshOctreeAddressingI.H:232
Foam::List< direction >
Foam::meshOctreeAddressing::calculateEdgeFaces
void calculateEdgeFaces() const
calculate edge-faces
Definition: meshOctreeAddressingCreation.C:1238
Foam::meshOctree
Definition: meshOctree.H:55
Foam::meshOctreeAddressing::nodeFacesPtr_
VRWGraph * nodeFacesPtr_
node-faces addressing
Definition: meshOctreeAddressing.H:99
Foam::meshOctreeAddressing::globalLeafLabel
const labelLongList & globalLeafLabel() const
return global labels of octree leaves
Definition: meshOctreeAddressingI.H:248
Foam::meshOctreeAddressing::octreeEdges
const LongList< edge > & octreeEdges() const
return octree edges, created for MESHCELL boxes
Definition: meshOctreeAddressingI.H:150
Foam::direction
unsigned char direction
Definition: direction.H:43
Foam::meshOctreeAddressing::globalLeafToLocalPtr_
Map< label > * globalLeafToLocalPtr_
global leaf label to local label addressing for octree leaves
Definition: meshOctreeAddressing.H:144
Foam::meshOctreeAddressing::nodeLabelsPtr_
VRWGraph * nodeLabelsPtr_
node labels
Definition: meshOctreeAddressing.H:78
Foam::meshOctreeAddressing::octreePoints
const pointField & octreePoints() const
return coordinates of octree vertices
Definition: meshOctreeAddressingI.H:44
Foam::meshOctreeAddressing::nodeEdges
const VRWGraph & nodeEdges() const
return node-edges addressing
Definition: meshOctreeAddressingI.H:174
Foam::meshOctreeAddressing::nodeLeaves
const FRWGraph< label, 8 > & nodeLeaves() const
return nodeLeaves
Definition: meshOctreeAddressingI.H:60
Foam::meshOctreeAddressing::octreeFaces
const VRWGraph & octreeFaces() const
return octree faces, created for MESHCELL boxes
Definition: meshOctreeAddressingI.H:102
Foam::meshOctreeAddressing::numberOfNodes
label numberOfNodes() const
return number of octree nodes
Definition: meshOctreeAddressingI.H:36
Foam::meshOctreeAddressing::octree_
const meshOctree & octree_
reference to the octree
Definition: meshOctreeAddressing.H:63
Foam::type
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:588
Foam::meshOctreeAddressing::leafEdges
const VRWGraph & leafEdges() const
return leaf-edges addressing
Definition: meshOctreeAddressingI.H:166
Foam::FRWGraph< label, 8 >
Foam::VRWGraph
Definition: VRWGraph.H:101
Foam::meshOctreeAddressing::calculateLeafFaces
void calculateLeafFaces() const
calculate leaf-faces addressing
Definition: meshOctreeAddressingCreation.C:1063
Foam::meshOctreeAddressing::calcGlobalFaceLabels
void calcGlobalFaceLabels() const
Definition: meshOctreeAddressingParallelAddressing.C:337
Foam::meshOctreeAddressing::leafAtProcsPtr_
VRWGraph * leafAtProcsPtr_
leaf at procs
Definition: meshOctreeAddressing.H:147
Foam::meshOctreeAddressing::globalToLocalPointAddressing
const Map< label > & globalToLocalPointAddressing() const
global point label to local label. Only for processors points
Definition: meshOctreeAddressingI.H:207
Foam::meshOctreeAddressing::edgeFaces
const VRWGraph & edgeFaces() const
return edge-faces addressing
Definition: meshOctreeAddressingI.H:190
Foam::meshOctreeAddressing::leafFacesPtr_
VRWGraph * leafFacesPtr_
octree box-faces addressing
Definition: meshOctreeAddressing.H:96