createShellMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::createShellMesh
26 
27 Description
28  Creates mesh by extruding a patch.
29 
30 SourceFiles
31  createShellMesh.C
32 
33  Extrudes into thickness direction.
34  - bottom faces originate from reversed original faces (have turning index)
35  - top faces originate from original faces (no turning index)
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef createShellMesh_H
40 #define createShellMesh_H
41 
42 #include "primitiveFacePatch.H"
43 #include "PackedBoolList.H"
44 #include "labelPair.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward declaration of classes
52 class mapPolyMesh;
53 class polyTopoChange;
54 class globalMeshData;
55 
56 /*---------------------------------------------------------------------------*\
57  Class createShellMesh Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 class createShellMesh
61 {
62  // Private data
63 
64  //- Reference to patch to extrude
65  const primitiveFacePatch& patch_;
66 
67  //- Per point on face the region
68  const faceList& pointRegions_;
69 
70  //- From region to original patch point
71  const labelList& regionPoints_;
72 
73 
74  labelList cellToFaceMap_;
75 
76  labelList faceToFaceMap_;
77 
78  labelList faceToEdgeMap_;
79 
80  labelList pointToPointMap_;
81 
82 
83  // Private Member Functions
84 
85  static void syncEdges
86  (
87  const globalMeshData&,
88  const labelList&,
89  const labelList&,
90  const PackedBoolList& sameEdgeOrientation,
91  const bool syncNonCollocated,
92 
93  PackedBoolList& isChangedEdge,
94  DynamicList<label>& changedEdges,
95  labelPairList& allEdgeData
96  );
97 
98 
99  //- Disallow default bitwise copy construct
101 
102  //- Disallow default bitwise assignment
103  void operator=(const createShellMesh&);
104 
105 
106 public:
107 
108  //- Runtime type information
109  ClassName("createShellMesh");
110 
111 
112  // Constructors
113 
114  //- Construct from mesh.
116  (
117  const primitiveFacePatch& patch,
118  const faceList& pointRegions,
119  const labelList& regionPoints
120  );
121 
122 
123  // Member Functions
124 
125 
126  // Access
127 
128  //- From region cell to patch face. Consecutively added so
129  // cell at layerI is at patchFaceI*nLayers+layerI
130  const labelList& cellToFaceMap() const
131  {
132  return cellToFaceMap_;
133  }
134 
135  //- From region face to patch face. Contains turning index:
136  // > 0 : face in same orientation as patch face. face will
137  // be in top patch
138  // < 0 : face in opposite orientation as patch face. face will
139  // be in bottom patch
140  // = 0 : for all side faces
141  const labelList& faceToFaceMap() const
142  {
143  return faceToFaceMap_;
144  }
145 
146  //- From region side-face to patch edge. -1 for non-edge faces.
147  const labelList& faceToEdgeMap() const
148  {
149  return faceToEdgeMap_;
150  }
151 
152  //- From region point to patch point.
153  const labelList& pointToPointMap() const
154  {
155  return pointToPointMap_;
156  }
157 
158 
159  // Other
160 
161  //- Helper: calculate point regions. The point region is the
162  // same on all faces connected to a point if they can be
163  // reached through a face-edge-face walk without crossing
164  // the nonManifoldEdge.
165  // syncNonCollocated = true: edges connected through cyclic become
166  // single region. false: kept separate.
167  // pointGlobalRegions : non-compact. Guaranteed to be the same
168  // across processors.
169  // pointLocalRegions : compact.
170  // localToGlobalRegion : local to global region.
171  static void calcPointRegions
172  (
173  const globalMeshData& globalData,
174  const primitiveFacePatch& patch,
175  const PackedBoolList& nonManifoldEdge,
176  const bool syncNonCollocated,
177  faceList& pointGlobalRegions,
178  faceList& pointLocalRegions,
179  labelList& localToGlobalRegion
180  );
181 
182  //- Play commands into polyTopoChange to create layer mesh.
183  void setRefinement
184  (
185  const pointField& firstLayerThickness,
186  const scalar expansionRatio,
187  const label nLayers,
188  const labelList& topPatchID,
189  const labelList& bottomPatchID,
190  const labelListList& extrudeEdgePatches,
191  polyTopoChange& meshMod
192  );
193 
194  //- Update any locally stored mesh information.
195  void updateMesh(const mapPolyMesh&);
196 };
197 
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************************************************************* //
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
const labelList & cellToFaceMap() const
From region cell to patch face. Consecutively added so.
const labelList & faceToEdgeMap() const
From region side-face to patch edge. -1 for non-edge faces.
A bit-packed bool list.
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
static void calcPointRegions(const globalMeshData &globalData, const primitiveFacePatch &patch, const PackedBoolList &nonManifoldEdge, const bool syncNonCollocated, faceList &pointGlobalRegions, faceList &pointLocalRegions, labelList &localToGlobalRegion)
Helper: calculate point regions. The point region is the.
Namespace for OpenFOAM.
const labelList & faceToFaceMap() const
From region face to patch face. Contains turning index:
Creates mesh by extruding a patch.
void updateMesh(const mapPolyMesh &)
Update any locally stored mesh information.
A list of faces which address into the list of points.
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
Direct mesh changes based on v1.3 polyTopoChange syntax.
const labelList & pointToPointMap() const
From region point to patch point.
ClassName("createShellMesh")
Runtime type information.
void setRefinement(const pointField &firstLayerThickness, const scalar expansionRatio, const label nLayers, const labelList &topPatchID, const labelList &bottomPatchID, const labelListList &extrudeEdgePatches, polyTopoChange &meshMod)
Play commands into polyTopoChange to create layer mesh.