31 template<
class FaceList,
class Po
intField>
34 const PrimitivePatch<FaceList, PointField>& extrudePatch,
35 const extrudeModel& model
38 const pointField& surfacePoints = extrudePatch.localPoints();
39 const vectorField& surfaceNormals = extrudePatch.pointNormals();
41 const label nLayers = model.nLayers();
43 pointField ePoints((nLayers + 1)*surfacePoints.size());
45 for (
label layer=0; layer<=nLayers; layer++)
47 label offset = layer*surfacePoints.size();
51 ePoints[offset + i] = model
64 template<
class FaceList,
class Po
intField>
67 const PrimitivePatch<FaceList, PointField>& extrudePatch,
68 const extrudeModel& model
71 const pointField& surfacePoints = extrudePatch.localPoints();
72 const List<face>& surfaceFaces = extrudePatch.localFaces();
73 const edgeList& surfaceEdges = extrudePatch.edges();
74 const label nInternalEdges = extrudePatch.nInternalEdges();
76 const label nLayers = model.nLayers();
79 (nLayers + 1)*surfaceFaces.size() + nLayers*surfaceEdges.size();
87 for (
label layer=0; layer<nLayers; layer++)
89 label currentLayerOffset = layer*surfacePoints.size();
90 label nextLayerOffset = currentLayerOffset + surfacePoints.size();
95 const edge& e = surfaceEdges[edgeI];
96 const labelList& edgeFaces = extrudePatch.edgeFaces()[edgeI];
98 face& f = eFaces[facei++];
103 (edgeFaces[0] < edgeFaces[1])
104 == sameOrder(surfaceFaces[edgeFaces[0]], e)
107 f[0] = e[0] + currentLayerOffset;
108 f[1] = e[1] + currentLayerOffset;
109 f[2] = e[1] + nextLayerOffset;
110 f[3] = e[0] + nextLayerOffset;
114 f[0] = e[1] + currentLayerOffset;
115 f[1] = e[0] + currentLayerOffset;
116 f[2] = e[0] + nextLayerOffset;
117 f[3] = e[1] + nextLayerOffset;
122 if (layer < nLayers-1)
137 for (
label layer=0; layer<nLayers; layer++)
139 label currentLayerOffset = layer*surfacePoints.size();
140 label nextLayerOffset = currentLayerOffset + surfacePoints.size();
143 for (
label edgeI=nInternalEdges; edgeI<surfaceEdges.size(); edgeI++)
145 const edge& e = surfaceEdges[edgeI];
146 const labelList& edgeFaces = extrudePatch.edgeFaces()[edgeI];
148 face& f = eFaces[facei++];
151 if (sameOrder(surfaceFaces[edgeFaces[0]], e))
153 f[0] = e[0] + currentLayerOffset;
154 f[1] = e[1] + currentLayerOffset;
155 f[2] = e[1] + nextLayerOffset;
156 f[3] = e[0] + nextLayerOffset;
160 f[0] = e[1] + currentLayerOffset;
161 f[1] = e[0] + currentLayerOffset;
162 f[2] = e[0] + nextLayerOffset;
163 f[3] = e[1] + nextLayerOffset;
171 eFaces[facei++] = face(surfaceFaces[i]).reverseFace();
181 + nLayers*surfacePoints.size()
189 template<
class FaceList,
class Po
intField>
192 const PrimitivePatch<FaceList, PointField>& extrudePatch,
193 const extrudeModel& model
196 const List<face>& surfaceFaces = extrudePatch.localFaces();
197 const edgeList& surfaceEdges = extrudePatch.edges();
198 const label nInternalEdges = extrudePatch.nInternalEdges();
200 const label nLayers = model.nLayers();
202 cellList eCells(nLayers*surfaceFaces.size());
207 const face& f = surfaceFaces[i];
209 for (
label layer=0; layer<nLayers; layer++)
211 eCells[i + layer*surfaceFaces.size()].setSize(f.size() + 2);
221 for (
label layer=0; layer<nLayers; layer++)
227 const labelList& edgeFaces = extrudePatch.edgeFaces()[i];
230 label cell0 = layer*surfaceFaces.size() + edgeFaces[0];
231 label cell1 = layer*surfaceFaces.size() + edgeFaces[1];
233 eCells[cell0][nCellFaces[cell0]++] = facei;
234 eCells[cell1][nCellFaces[cell1]++] = facei;
240 if (layer < nLayers-1)
244 label cell0 = layer*surfaceFaces.size() + i;
245 label cell1 = (layer+1)*surfaceFaces.size() + i;
247 eCells[cell0][nCellFaces[cell0]++] = facei;
248 eCells[cell1][nCellFaces[cell1]++] = facei;
256 for (
label layer=0; layer<nLayers; layer++)
259 for (
label i=nInternalEdges; i<surfaceEdges.size(); i++)
262 const labelList& edgeFaces = extrudePatch.edgeFaces()[i];
265 label cell0 = layer*surfaceFaces.size() + edgeFaces[0];
267 eCells[cell0][nCellFaces[cell0]++] = facei;
276 eCells[i][nCellFaces[i]++] = facei;
284 label cell0 = (nLayers-1)*surfaceFaces.size() + i;
286 eCells[cell0][nCellFaces[cell0]++] = facei;
297 template<
class FaceList,
class Po
intField>
301 const PrimitivePatch<FaceList, PointField>& extrudePatch,
302 const extrudeModel& model
308 extrudedPoints(extrudePatch, model),
309 extrudedFaces(extrudePatch, model),
310 extrudedCells(extrudePatch, model)
320 *(extrudePatch.nEdges() - extrudePatch.nInternalEdges());
329 wallPolyPatch::typeName
344 facei += extrudePatch.size();
const fvPatchList & patches
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
#define forAll(list, i)
Loop across all elements in list.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
label nInternalFaces() const
extrudedMesh(const IOobject &, const PrimitivePatch< FaceList, PointField > &extrudePatch, const extrudeModel &)
Construct from the primitivePatch to extrude.
IOobject(const word &name, const fileName &instance, const objectRegistry ®istry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
Construct from name, instance, registry, io options.
vectorField pointField
pointField is a vectorField.
Pre-declare SubField and related Field type.
List< label > labelList
A List of labels.
void addPatches(const List< polyPatch *> &, const bool validBoundary=true)
Add boundary patches.
void setSize(const label)
Reset size of List.
Field< vector > vectorField
Specialisation of Field<T> for vector.
label nInternalEdges() const
Internal edges using 0,1 or 2 boundary points.
List< cell > cellList
list of cells
polyMesh(const IOobject &io)
Construct from IOobject.