extrudeLayer.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  extrudeLayer
26 
27 Description
28  Creates a sheet of prismatic cells from the selected faces in
29  the direction of the specified cell for each face
30 
31 SourceFiles
32  extrudeLayer.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef extrudeLayer_H
37 #define extrudeLayer_H
38 
39 #include "polyMeshGenModifier.H"
40 #include "VRWGraphList.H"
41 #include "labelPair.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class extrudeLayer Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class extrudeLayer
53 {
54  // Private data
55 
56  //- Reference to the mesh
58 
59  //- thickness
60  const scalar thickness_;
61 
62  //- number of points in the original mesh
63  const label nOrigPoints_;
64 
65  //- number of faces in the original mesh
66  const label nOrigFaces_;
67 
68  //- number of cells in the original mesh
69  const label nOrigCells_;
70 
71  //- pairs of faces making the extruded front
73 
74  //- store the orientation of the extruded front
75  //- true if the pair has the same orientation and false otherwise
77 
78  //- original point label
80 
81  // Private member functions
82  //- duplicate faces which will be extruded
84 
85  //- create new vertices and open the mesh
86  void createNewVertices();
87 
88  //- move points to make space for the new cells
89  void movePoints();
90 
91  //- create layer cells
92  void createLayerCells();
93 
94  //- create new faces at parallel boundaries
96 
97  //- update boundary patches
98  void updateBoundary();
99 
100  // Nested classes
101  //- this class provides addressing data needed for generating
102  //- cells emerging as a consequence of self-intersecting layers
104  {
105  // Private data
106  //- const reference to mesh faces
107  const faceListPMG& faces_;
108 
109  //- const reference to extruded face pairs
111 
112  //- const reference telling the orientation of each face pair
114 
115  //- const reference to the extruded faces at points
116  const VRWGraph& pointExtruded_;
117 
118  public:
119 
120  // Construct from faces, extruded face pairs and
121  // point-extrudedfaces addressing
123  (
124  const faceListPMG& faces,
125  const LongList<labelPair>& extrudedFaces,
126  const LongList<bool>& pairOrientation,
127  const VRWGraph& pointFaces
128  );
129 
130  // Destructor
132 
133  // Member functions
134  //- return label of the original face for the given face
135  inline label origFaceLabel(const label extrudedI) const;
136 
137  //- return position of point in extruded face
138  inline label positionInFace
139  (
140  const label extrudedI,
141  const label pointI
142  ) const;
143 
144  //- return point label in the original face
145  inline label origPointLabel
146  (
147  const label extrudedI,
148  const label pos
149  ) const;
150 
151  inline label origPoint
152  (
153  const label extrudedI,
154  const label pointI
155  ) const;
156 
157  //- find face sharing an edge with the given face
158  inline label faceSharingEdge
159  (
160  const label extrudedI,
161  const label eI
162  ) const;
163 
164  //- find faces attached to both points
165  inline void facesSharingEdge
166  (
167  const label start,
168  const label end,
170  ) const;
171  };
172 
173  // Enumerators
174  enum extrudeLayerTypes_
175  {
176  NONE = 0,
179  };
180 
181  //- Disallow bitwise copy construct
182  extrudeLayer(const extrudeLayer&);
183 
184  //- Disallow bitwise assignment
185  void operator=(const extrudeLayer&);
186 
187  public:
188 
189  // Constructors
190 
191  //- Construct from mesh, extrusion faces, thickness and number of layers
193  (
194  polyMeshGen& mesh,
195  const LongList<labelPair>& extrusionFront,
196  const scalar thickness = -1.0
197  );
198 
199  // Destructor
200  ~extrudeLayer();
201 
202  // Public member functions
203 };
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 } // End namespace Foam
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #include "extrudeLayerI.H"
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 #endif
216 
217 // ************************************************************************* //
Foam::extrudeLayer::extrudeLayer
extrudeLayer(const extrudeLayer &)
Disallow bitwise copy construct.
Foam::extrudeLayer::operator=
void operator=(const extrudeLayer &)
Disallow bitwise assignment.
Foam::extrudeLayer::createDuplicateFrontFaces
void createDuplicateFrontFaces(const LongList< labelPair > &)
duplicate faces which will be extruded
Definition: extrudeLayer.C:70
Foam::extrudeLayer::addressingCalculator::positionInFace
label positionInFace(const label extrudedI, const label pointI) const
return position of point in extruded face
Definition: extrudeLayerI.H:46
Foam::extrudeLayer::NONE
@ NONE
Definition: extrudeLayer.H:175
Foam::extrudeLayer::FRONTVERTEXPROCBND
@ FRONTVERTEXPROCBND
Definition: extrudeLayer.H:177
Foam::extrudeLayer::addressingCalculator::facesSharingEdge
void facesSharingEdge(const label start, const label end, DynList< label > &) const
find faces attached to both points
Definition: extrudeLayerI.H:147
polyMeshGenModifier.H
Foam::polyMeshGen
Definition: polyMeshGen.H:46
Foam::extrudeLayer::FRONTVERTEX
@ FRONTVERTEX
Definition: extrudeLayer.H:176
Foam::extrudeLayer::thickness_
const scalar thickness_
thickness
Definition: extrudeLayer.H:59
Foam::extrudeLayer::updateBoundary
void updateBoundary()
update boundary patches
Definition: extrudeLayer.C:1221
Foam::extrudeLayer::createNewFacesParallel
void createNewFacesParallel()
create new faces at parallel boundaries
Definition: extrudeLayer.C:921
Foam::extrudeLayer::addressingCalculator
Definition: extrudeLayer.H:102
Foam::LongList
Definition: LongList.H:55
Foam::extrudeLayer::addressingCalculator::faces_
const faceListPMG & faces_
const reference to mesh faces
Definition: extrudeLayer.H:106
Foam::extrudeLayer::addressingCalculator::origPoint
label origPoint(const label extrudedI, const label pointI) const
Definition: extrudeLayerI.H:83
Foam::extrudeLayer::createLayerCells
void createLayerCells()
create layer cells
Definition: extrudeLayer.C:933
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::extrudeLayer::addressingCalculator::origPointLabel
label origPointLabel(const label extrudedI, const label pos) const
return point label in the original face
Definition: extrudeLayerI.H:57
Foam::extrudeLayer::~extrudeLayer
~extrudeLayer()
Definition: extrudeLayer.C:1389
Foam::extrudeLayer::origPointLabel_
labelLongList origPointLabel_
original point label
Definition: extrudeLayer.H:78
Foam::extrudeLayer::mesh_
polyMeshGen & mesh_
Reference to the mesh.
Definition: extrudeLayer.H:56
Foam::extrudeLayer::addressingCalculator::addressingCalculator
addressingCalculator(const faceListPMG &faces, const LongList< labelPair > &extrudedFaces, const LongList< bool > &pairOrientation, const VRWGraph &pointFaces)
Definition: extrudeLayer.C:52
Foam::extrudeLayer::pairOrientation_
LongList< bool > pairOrientation_
Definition: extrudeLayer.H:75
extrudeLayerI.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::DynList< label >
Foam::extrudeLayer::extrudeLayerTypes_
extrudeLayerTypes_
Definition: extrudeLayer.H:173
Foam::extrudeLayer::addressingCalculator::faceSharingEdge
label faceSharingEdge(const label extrudedI, const label eI) const
find face sharing an edge with the given face
Definition: extrudeLayerI.H:111
Foam::extrudeLayer::movePoints
void movePoints()
move points to make space for the new cells
Definition: extrudeLayer.C:730
Foam::extrudeLayer::addressingCalculator::extrudedFaces_
const LongList< labelPair > & extrudedFaces_
const reference to extruded face pairs
Definition: extrudeLayer.H:109
Foam::extrudeLayer::nOrigCells_
const label nOrigCells_
number of cells in the original mesh
Definition: extrudeLayer.H:68
Foam::extrudeLayer::nOrigPoints_
const label nOrigPoints_
number of points in the original mesh
Definition: extrudeLayer.H:62
Foam::extrudeLayer::addressingCalculator::origFaceLabel
label origFaceLabel(const label extrudedI) const
return label of the original face for the given face
Definition: extrudeLayerI.H:38
Foam::extrudeLayer::addressingCalculator::pointExtruded_
const VRWGraph & pointExtruded_
const reference to the extruded faces at points
Definition: extrudeLayer.H:115
Foam::extrudeLayer::nOrigFaces_
const label nOrigFaces_
number of faces in the original mesh
Definition: extrudeLayer.H:65
Foam::extrudeLayer::extrudedFaces_
LongList< labelPair > extrudedFaces_
pairs of faces making the extruded front
Definition: extrudeLayer.H:71
Foam::faceListPMG
Definition: faceListPMG.H:50
Foam::VRWGraph
Definition: VRWGraph.H:101
VRWGraphList.H
Foam::extrudeLayer::createNewVertices
void createNewVertices()
create new vertices and open the mesh
Definition: extrudeLayer.C:209
Foam::extrudeLayer
Definition: extrudeLayer.H:51
labelPair.H
Foam::extrudeLayer::addressingCalculator::~addressingCalculator
~addressingCalculator()
Definition: extrudeLayer.C:65
Foam::extrudeLayer::addressingCalculator::pairOrientation_
LongList< bool > pairOrientation_
const reference telling the orientation of each face pair
Definition: extrudeLayer.H:112
Foam::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:190