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 \*---------------------------------------------------------------------------*/
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 #include "polyMeshGenFaces.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 inline const faceListPMG& polyMeshGenFaces::faces() const
48 inline label polyMeshGenFaces::nInternalFaces() const
50 if( !(ownerPtr_ && neighbourPtr_) )
53 if( omp_in_parallel() )
56 "inline label polyMeshGenFaces::nInternalFaces() const"
57 ) << "Calculating addressing inside a parallel region."
58 << " This is not thread safe" << exit(FatalError);
61 calculateOwnersAndNeighbours();
67 inline const labelList& polyMeshGenFaces::owner() const
72 if( omp_in_parallel() )
75 "inline label polyMeshGenFaces::owner() const"
76 ) << "Calculating addressing inside a parallel region."
77 << " This is not thread safe" << exit(FatalError);
80 calculateOwnersAndNeighbours();
86 inline const labelList& polyMeshGenFaces::neighbour() const
91 if( omp_in_parallel() )
94 "inline label polyMeshGenFaces::neighbour() const"
95 ) << "Calculating addressing inside a parallel region."
96 << " This is not thread safe" << exit(FatalError);
99 calculateOwnersAndNeighbours();
102 return *neighbourPtr_;
105 inline const PtrList<processorBoundaryPatch>&
106 polyMeshGenFaces::procBoundaries() const
108 return procBoundaries_;
111 inline const PtrList<boundaryPatch>& polyMeshGenFaces::boundaries() const
116 inline void polyMeshGenFaces::addFaceToSubset
122 std::map<label, meshSubset>::iterator it = faceSubsets_.find(setID);
123 if( it == faceSubsets_.end() )
126 it->second.addElement(faceI);
129 inline void polyMeshGenFaces::removeFaceFromSubset
134 std::map<label, meshSubset>::iterator it = faceSubsets_.find(setI);
135 if( it == faceSubsets_.end() )
138 it->second.removeElement(faceI);
141 inline void polyMeshGenFaces::faceInSubsets
144 DynList<label>& faceSubsets
149 std::map<label, meshSubset>::const_iterator it;
152 it=faceSubsets_.begin();
153 it!=faceSubsets_.end();
157 if( it->second.contains(faceI) )
158 faceSubsets.append(it->first);
162 inline void polyMeshGenFaces::faceSubsetIndices(DynList<label>& indices) const
166 std::map<label, meshSubset>::const_iterator it;
169 it=faceSubsets_.begin();
170 it!=faceSubsets_.end();
173 indices.append(it->first);
176 template<class ListType>
177 inline void polyMeshGenFaces::facesInSubset
185 std::map<label, meshSubset>::const_iterator it =
186 faceSubsets_.find(setI);
187 if( it == faceSubsets_.end() )
190 it->second.containedElements(faceLabels);
193 template<class ListType>
194 inline void polyMeshGenFaces::updateFaceSubsets(const ListType& newFaceLabels)
198 std::map<label, meshSubset>::iterator it=faceSubsets_.begin();
199 it!=faceSubsets_.end();
202 it->second.updateSubset(newFaceLabels);
205 inline void polyMeshGenFaces::updateFaceSubsets(const VRWGraph& newFacesForFace)
209 std::map<label, meshSubset>::iterator it=faceSubsets_.begin();
210 it!=faceSubsets_.end();
213 it->second.updateSubset(newFacesForFace);
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 } // End namespace Foam
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //