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/>.
27 \*---------------------------------------------------------------------------*/
29 #include "meshOctreeAddressing.H"
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 inline label meshOctreeAddressing::numberOfNodes() const
44 inline const pointField& meshOctreeAddressing::octreePoints() const
46 if( !octreePointsPtr_ )
49 return *octreePointsPtr_;
52 inline const VRWGraph& meshOctreeAddressing::nodeLabels() const
57 return *nodeLabelsPtr_;
60 inline const FRWGraph<label, 8>& meshOctreeAddressing::nodeLeaves() const
65 return *nodeLeavesPtr_;
68 inline const List<direction>& meshOctreeAddressing::boxType() const
76 inline void meshOctreeAddressing::setBoxType
84 List<direction>& boxType = *boxTypePtr_;
85 boxType[boxI] |= type;
89 inline const meshOctree& meshOctreeAddressing::octree() const
94 inline const List<direction>& meshOctreeAddressing::nodeType() const
102 inline const VRWGraph& meshOctreeAddressing::octreeFaces() const
104 if( !octreeFacesPtr_ )
107 return *octreeFacesPtr_;
110 inline const labelLongList& meshOctreeAddressing::octreeFaceOwner() const
112 if( !octreeFacesOwnersPtr_ )
115 return *octreeFacesOwnersPtr_;
118 inline const labelLongList& meshOctreeAddressing::octreeFaceNeighbour() const
120 if( !octreeFacesNeighboursPtr_ )
123 return *octreeFacesNeighboursPtr_;
126 inline const VRWGraph& meshOctreeAddressing::leafFaces() const
129 calculateLeafFaces();
131 return *leafFacesPtr_;
134 inline const VRWGraph& meshOctreeAddressing::leafLeaves() const
136 if( !leafLeavesPtr_ )
137 calculateLeafLeaves();
139 return *leafLeavesPtr_;
142 inline const VRWGraph& meshOctreeAddressing::nodeFaces() const
145 calculateNodeFaces();
147 return *nodeFacesPtr_;
150 inline const LongList<edge>& meshOctreeAddressing::octreeEdges() const
152 if( !octreeEdgesPtr_ )
155 return *octreeEdgesPtr_;
158 inline const VRWGraph& meshOctreeAddressing::edgeLeaves() const
160 if( !edgeLeavesPtr_ )
161 calculateEdgeLeaves();
163 return *edgeLeavesPtr_;
166 inline const VRWGraph& meshOctreeAddressing::leafEdges() const
169 calculateLeafEdges();
171 return *leafEdgesPtr_;
174 inline const VRWGraph& meshOctreeAddressing::nodeEdges() const
179 return *nodeEdgesPtr_;
182 inline const VRWGraph& meshOctreeAddressing::faceEdges() const
187 return *faceEdgesPtr_;
190 inline const VRWGraph& meshOctreeAddressing::edgeFaces() const
193 calculateEdgeFaces();
195 return *edgeFacesPtr_;
198 inline const labelLongList& meshOctreeAddressing::globalPointLabel() const
200 if( !globalPointLabelPtr_ )
201 calcGlobalPointLabels();
203 return *globalPointLabelPtr_;
206 inline const Map<label>& meshOctreeAddressing::
207 globalToLocalPointAddressing() const
209 if( !globalPointToLocalPtr_ )
210 calcGlobalPointLabels();
212 return *globalPointToLocalPtr_;
215 inline const VRWGraph& meshOctreeAddressing::pointAtProcs() const
217 if( !pointProcsPtr_ )
218 calcGlobalPointLabels();
220 return *pointProcsPtr_;
223 inline const labelLongList& meshOctreeAddressing::globalFaceLabel() const
225 if( !globalFaceLabelPtr_ )
226 calcGlobalFaceLabels();
228 return *globalFaceLabelPtr_;
231 inline const Map<label>& meshOctreeAddressing::
232 globalToLocalFaceAddressing() const
234 if( !globalFaceToLocalPtr_ )
235 calcGlobalFaceLabels();
237 return *globalFaceToLocalPtr_;
240 inline const VRWGraph& meshOctreeAddressing::faceAtProcs() const
243 calcGlobalFaceLabels();
245 return *faceProcsPtr_;
248 inline const labelLongList& meshOctreeAddressing::globalLeafLabel() const
250 if( !globalLeafLabelPtr_ )
251 calcGlobalLeafLabels();
253 return *globalLeafLabelPtr_;
256 inline const VRWGraph& meshOctreeAddressing::leafAtProcs() const
258 if( !leafAtProcsPtr_ )
259 calcGlobalLeafLabels();
261 return *leafAtProcsPtr_;
264 inline const Map<label>& meshOctreeAddressing::
265 globalToLocalLeafAddressing() const
267 if( !globalLeafToLocalPtr_ )
268 calcGlobalLeafLabels();
270 return *globalLeafToLocalPtr_;
273 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
275 } // End namespace Foam
277 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //