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/>.
28 Mesh with geometry and faces. It can be used for volume and surface meshes
33 \*---------------------------------------------------------------------------*/
35 #ifndef polyMeshGenFaces_H
36 #define polyMeshGenFaces_H
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 #include "polyMeshGenPoints.H"
41 #include "faceListPMG.H"
42 #include "labelIOList.H"
43 #include "processorBoundaryPatch.H"
44 #include "boundaryPatch.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 class polyMeshGenFaces
52 : public polyMeshGenPoints
60 //- inter-processor boundaries. These faces are located after the other
61 //- boundary faces in the list of faces. The processor
62 //- boundaries are internal faces in the end.
63 PtrList<processorBoundaryPatch> procBoundaries_;
66 PtrList<boundaryPatch> boundaries_;
69 std::map<label, meshSubset> faceSubsets_;
72 //- number of internal faces, owner and neighbour
73 mutable label nIntFaces_;
74 mutable labelIOList* ownerPtr_;
75 mutable labelIOList* neighbourPtr_;
77 // Private member functions
79 //- calculate owner and neighbour addressing
80 virtual void calculateOwnersAndNeighbours() const = 0;
82 //- clear all pointer data
83 void clearOut() const;
85 // Disallow bitwise assignment
86 void operator=(const polyMeshGenFaces&);
88 polyMeshGenFaces(const polyMeshGenFaces&);
92 friend class polyMeshGenModifier;
96 polyMeshGenFaces(const Time&);
98 //- Construct from components without the boundary
102 const pointField& points,
103 const faceList& faces
106 //- Construct from components with the boundary
110 const pointField& points,
111 const faceList& faces,
112 const wordList& patchNames,
113 const labelList& patchStart,
114 const labelList& nFacesInPatch
118 virtual ~polyMeshGenFaces();
123 inline const faceListPMG& faces() const;
125 //- return number of internal faces
126 inline label nInternalFaces() const;
128 //- owner and neighbour cells for faces
129 inline const labelList& owner() const;
130 inline const labelList& neighbour() const;
134 //- inter-processor boundaries
135 inline const PtrList<processorBoundaryPatch>& procBoundaries() const;
137 //- return processor patch label for the given face label
138 label faceIsInProcPatch(const label faceLabel) const;
140 //- ordinary boundaries
141 inline const PtrList<boundaryPatch>& boundaries() const;
143 //- return patch label for the given face label
144 label faceIsInPatch(const label faceLabel) const;
148 label addFaceSubset(const word&);
149 void removeFaceSubset(const label);
150 word faceSubsetName(const label) const;
151 label faceSubsetIndex(const word&) const;
152 inline void addFaceToSubset(const label, const label);
153 inline void removeFaceFromSubset(const label, const label);
154 inline void faceInSubsets(const label, DynList<label>&) const;
155 inline void faceSubsetIndices(DynList<label>&) const;
156 template<class ListType>
157 inline void facesInSubset(const label, ListType&) const;
158 template<class ListType>
159 inline void updateFaceSubsets(const ListType&);
160 inline void updateFaceSubsets(const VRWGraph&);
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 } // End namespace Foam
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 #include "polyMeshGenFacesI.H"
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //