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 Creates a sheet of prismatic cells from the selected faces in
29 the direction of the specified cell for each face
34 \*---------------------------------------------------------------------------*/
36 #ifndef extrudeLayer_H
37 #define extrudeLayer_H
39 #include "objectRegistry.H"
41 #include "polyMeshGenModifier.H"
42 #include "VRWGraphList.H"
43 #include "labelPair.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class extrudeLayer Declaration
52 \*---------------------------------------------------------------------------*/
58 //- Reference to the mesh
62 const scalar thickness_;
64 //- number of points in the original mesh
65 const label nOrigPoints_;
67 //- number of faces in the original mesh
68 const label nOrigFaces_;
70 //- number of cells in the original mesh
71 const label nOrigCells_;
73 //- pairs of faces making the extruded front
74 LongList<labelPair> extrudedFaces_;
76 //- store the orientation of the extruded front
77 //- true if the pair has the same orientation and false otherwise
78 LongList<bool> pairOrientation_;
80 //- original point label
81 labelLongList origPointLabel_;
83 // Private member functions
84 //- duplicate faces which will be extruded
85 void createDuplicateFrontFaces(const LongList<labelPair>&);
87 //- create new vertices and open the mesh
88 void createNewVertices();
90 //- move points to make space for the new cells
93 //- create layer cells
94 void createLayerCells();
96 //- create new faces at parallel boundaries
97 void createNewFacesParallel();
99 //- update boundary patches
100 void updateBoundary();
103 //- this class provides addressing data needed for generating
104 //- cells emerging as a consequence of self-intersecting layers
105 class addressingCalculator
108 //- const reference to mesh faces
109 const faceListPMG& faces_;
111 //- const reference to extruded face pairs
112 const LongList<labelPair>& extrudedFaces_;
114 //- const reference telling the orientation of each face pair
115 LongList<bool> pairOrientation_;
117 //- const reference to the extruded faces at points
118 const VRWGraph& pointExtruded_;
122 // Construct from faces, extruded face pairs and
123 // point-extrudedfaces addressing
126 const faceListPMG& faces,
127 const LongList<labelPair>& extrudedFaces,
128 const LongList<bool>& pairOrientation,
129 const VRWGraph& pointFaces
133 ~addressingCalculator();
136 //- return label of the original face for the given face
137 inline label origFaceLabel(const label extrudedI) const;
139 //- return position of point in extruded face
140 inline label positionInFace
142 const label extrudedI,
146 //- return point label in the original face
147 inline label origPointLabel
149 const label extrudedI,
153 inline label origPoint
155 const label extrudedI,
159 //- find face sharing an edge with the given face
160 inline label faceSharingEdge
162 const label extrudedI,
166 //- find faces attached to both points
167 inline void facesSharingEdge
176 enum extrudeLayerTypes_
180 FRONTVERTEXPROCBND = 2
183 //- Disallow bitwise copy construct
184 extrudeLayer(const extrudeLayer&);
186 //- Disallow bitwise assignment
187 void operator=(const extrudeLayer&);
193 //- Construct from mesh, extrusion faces, thickness and number of layers
197 const LongList<labelPair>& extrusionFront,
198 const scalar thickness = -1.0
204 // Public member functions
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 } // End namespace Foam
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 #include "extrudeLayerI.H"
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 // ************************************************************************* //