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 "polyMeshGenCells.H"
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 inline const cellListPMG& polyMeshGenCells::cells() const
44 inline void polyMeshGenCells::addCellToSubset
50 std::map<label, meshSubset>::iterator it = cellSubsets_.find(selID);
51 if( it == cellSubsets_.end() )
54 it->second.addElement(cellI);
57 inline void polyMeshGenCells::removeCellFromSubset
63 std::map<label, meshSubset>::iterator it = cellSubsets_.find(selID);
64 if( it == cellSubsets_.end() )
67 it->second.removeElement(cellI);
70 inline void polyMeshGenCells::cellInSubsets
73 DynList<label>& cellSubsets
78 std::map<label, meshSubset>::const_iterator it;
81 it=cellSubsets_.begin();
82 it!=cellSubsets_.end();
86 if( it->second.contains(cellI) )
87 cellSubsets.append(it->first);
91 inline void polyMeshGenCells::cellSubsetIndices(DynList<label>& indices) const
95 std::map<label, meshSubset>::const_iterator it;
98 it=cellSubsets_.begin();
99 it!=cellSubsets_.end();
102 indices.append(it->first);
105 template<class ListType>
106 inline void polyMeshGenCells::cellsInSubset
114 std::map<label, meshSubset>::const_iterator it =
115 cellSubsets_.find(selID);
116 if( it == cellSubsets_.end() )
119 it->second.containedElements(cellLabels);
122 template<class ListType>
123 inline void polyMeshGenCells::updateCellSubsets
125 const ListType& newCellLabels
130 std::map<label, meshSubset>::iterator it=cellSubsets_.begin();
131 it!=cellSubsets_.end();
134 it->second.updateSubset(newCellLabels);
137 inline void polyMeshGenCells::updateCellSubsets
139 const VRWGraph& newCellsForCell
144 std::map<label, meshSubset>::iterator it=cellSubsets_.begin();
145 it!=cellSubsets_.end();
148 it->second.updateSubset(newCellsForCell);
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 } // End namespace Foam
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //