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