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 "triSurfFacets.H"
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 inline label triSurfFacets::size() const
41 return triangles_.size();
44 inline const LongList<labelledTri>& triSurfFacets::facets() const
49 inline const geometricSurfacePatchList& triSurfFacets::patches() const
54 inline void triSurfFacets::appendTriangle(const labelledTri& tri)
56 triangles_.append(tri);
59 inline void triSurfFacets::addFacetToSubset
65 Map<meshSubset>::iterator it = facetSubsets_.find(setI);
66 if( it == facetSubsets_.end() )
69 it().addElement(triI);
72 inline void triSurfFacets::removeFacetFromSubset
78 Map<meshSubset>::iterator it = facetSubsets_.find(setI);
79 if( it == facetSubsets_.end() )
82 it().removeElement(triI);
85 inline void triSurfFacets::facetInSubsets
88 DynList<label>& facetSubsets
100 if( it().contains(triI) )
101 facetSubsets.append(it.key());
105 inline void triSurfFacets::facetSubsetIndices(DynList<label>& indices) const
115 indices.append(it.key());
118 template<class ListType>
119 inline void triSurfFacets::facetsInSubset
122 ListType& facetsLabels
125 facetsLabels.clear();
127 Map<meshSubset>::const_iterator it = facetSubsets_.find(setI);
128 if( it == facetSubsets_.end() )
131 it().containedElements(facetsLabels);
134 template<class ListType>
135 inline void triSurfFacets::updateFacetsSubsets(const ListType& newFacetsLabels)
139 Map<meshSubset>::iterator it=facetSubsets_.begin();
140 it!=facetSubsets_.end();
143 it().updateSubset(newFacetsLabels);
146 inline const labelledTri& triSurfFacets::operator[](const label triI) const
148 return triangles_[triI];
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 } // End namespace Foam
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //