Moving cfMesh into place. Updated contibutors list
[foam-extend-3.2.git] / src / mesh / cfMesh / meshLibrary / utilities / octrees / meshOctree / meshOctreeAddressing / meshOctreeAddressingI.H
blob00d580e000bd5bdc09256fa8bead91f477b710f9
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.
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
19     for more details.
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/>.
24 Description
27 \*---------------------------------------------------------------------------*/
29 #include "meshOctreeAddressing.H"
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 namespace Foam
36 inline label meshOctreeAddressing::numberOfNodes() const
38     if( !nodeLabelsPtr_ )
39         createNodeLabels();
40     
41     return nNodes_;
44 inline const pointField& meshOctreeAddressing::octreePoints() const
46     if( !octreePointsPtr_ )
47         createOctreePoints();
48     
49     return *octreePointsPtr_;
51     
52 inline const VRWGraph& meshOctreeAddressing::nodeLabels() const
54     if( !nodeLabelsPtr_ )
55         createNodeLabels();
56     
57     return *nodeLabelsPtr_;
60 inline const FRWGraph<label, 8>& meshOctreeAddressing::nodeLeaves() const
62     if( !nodeLeavesPtr_ )
63         createNodeLeaves();
64     
65     return *nodeLeavesPtr_;
67         
68 inline const List<direction>& meshOctreeAddressing::boxType() const
70     if( !boxTypePtr_ )
71         findUsedBoxes();
72     
73     return *boxTypePtr_;
76 inline void meshOctreeAddressing::setBoxType
78     const label boxI,
79     const direction type
82     if( boxTypePtr_ )
83     {
84         List<direction>& boxType = *boxTypePtr_;
85         boxType[boxI] |= type;
86     }
89 inline const meshOctree& meshOctreeAddressing::octree() const
91     return octree_;
94 inline const List<direction>& meshOctreeAddressing::nodeType() const
96     if( !nodeTypePtr_ )
97         calculateNodeType();
98     
99     return *nodeTypePtr_;
102 inline const VRWGraph& meshOctreeAddressing::octreeFaces() const
104     if( !octreeFacesPtr_ )
105         createOctreeFaces();
106     
107     return *octreeFacesPtr_;
110 inline const labelLongList& meshOctreeAddressing::octreeFaceOwner() const
112     if( !octreeFacesOwnersPtr_ )
113         createOctreeFaces();
114     
115     return *octreeFacesOwnersPtr_;
118 inline const labelLongList& meshOctreeAddressing::octreeFaceNeighbour() const
120     if( !octreeFacesNeighboursPtr_ )
121         createOctreeFaces();
122     
123     return *octreeFacesNeighboursPtr_;
126 inline const VRWGraph& meshOctreeAddressing::leafFaces() const
128     if( !leafFacesPtr_ )
129         calculateLeafFaces();
130     
131     return *leafFacesPtr_;
134 inline const VRWGraph& meshOctreeAddressing::leafLeaves() const
136     if( !leafLeavesPtr_ )
137         calculateLeafLeaves();
138     
139     return *leafLeavesPtr_;
142 inline const VRWGraph& meshOctreeAddressing::nodeFaces() const
144     if( !nodeFacesPtr_ )
145         calculateNodeFaces();
146     
147     return *nodeFacesPtr_;
150 inline const LongList<edge>& meshOctreeAddressing::octreeEdges() const
152     if( !octreeEdgesPtr_ )
153         createOctreeEdges();
154     
155     return *octreeEdgesPtr_;
158 inline const VRWGraph& meshOctreeAddressing::edgeLeaves() const
160     if( !edgeLeavesPtr_ )
161         calculateEdgeLeaves();
162     
163     return *edgeLeavesPtr_;
166 inline const VRWGraph& meshOctreeAddressing::leafEdges() const
168     if( !leafEdgesPtr_ )
169         calculateLeafEdges();
170     
171     return *leafEdgesPtr_;
174 inline const VRWGraph& meshOctreeAddressing::nodeEdges() const
176     if( !nodeEdgesPtr_ )
177         createOctreeEdges();
178     
179     return *nodeEdgesPtr_;
182 inline const VRWGraph& meshOctreeAddressing::faceEdges() const
184     if( !faceEdgesPtr_ )
185         createOctreeEdges();
186     
187     return *faceEdgesPtr_;
190 inline const VRWGraph& meshOctreeAddressing::edgeFaces() const
192     if( !edgeFacesPtr_ )
193         calculateEdgeFaces();
194     
195     return *edgeFacesPtr_;
198 inline const labelLongList& meshOctreeAddressing::globalPointLabel() const
200     if( !globalPointLabelPtr_ )
201         calcGlobalPointLabels();
202     
203     return *globalPointLabelPtr_;
205         
206 inline const Map<label>& meshOctreeAddressing::
207 globalToLocalPointAddressing() const
209     if( !globalPointToLocalPtr_ )
210         calcGlobalPointLabels();
211     
212     return *globalPointToLocalPtr_;
214         
215 inline const VRWGraph& meshOctreeAddressing::pointAtProcs() const
217     if( !pointProcsPtr_ )
218         calcGlobalPointLabels();
219     
220     return *pointProcsPtr_;
222         
223 inline const labelLongList& meshOctreeAddressing::globalFaceLabel() const
225     if( !globalFaceLabelPtr_ )
226         calcGlobalFaceLabels();
227     
228     return *globalFaceLabelPtr_;
230         
231 inline const Map<label>& meshOctreeAddressing::
232 globalToLocalFaceAddressing() const
234     if( !globalFaceToLocalPtr_ )
235         calcGlobalFaceLabels();
236     
237     return *globalFaceToLocalPtr_;
239         
240 inline const VRWGraph& meshOctreeAddressing::faceAtProcs() const
242     if( !faceProcsPtr_ )
243         calcGlobalFaceLabels();
244     
245     return *faceProcsPtr_;
247         
248 inline const labelLongList& meshOctreeAddressing::globalLeafLabel() const
250     if( !globalLeafLabelPtr_ )
251         calcGlobalLeafLabels();
252     
253     return *globalLeafLabelPtr_;
256 inline const VRWGraph& meshOctreeAddressing::leafAtProcs() const
258     if( !leafAtProcsPtr_ )
259         calcGlobalLeafLabels();
260     
261     return *leafAtProcsPtr_;
264 inline const Map<label>& meshOctreeAddressing::
265 globalToLocalLeafAddressing() const
267     if( !globalLeafToLocalPtr_ )
268         calcGlobalLeafLabels();
269     
270     return *globalLeafToLocalPtr_;
273 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
275 } // End namespace Foam
277 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //