44 if (faces[faceI].size() != 2)
47 <<
"Face " << faceI <<
" size " << faces[faceI].size()
48 <<
" is not of size 2: mesh is not a valid two-dimensional "
85 const dictionary&
dict,
86 const extrudeModel& model
112 const polyBoundaryMesh&
patches = mesh_.boundaryMesh();
114 frontPatchI_ =
patches.findPatchID(
"front");
115 backPatchI_ =
patches.findPatchID(
"back");
122 const polyPatch& pp =
patches[patchI];
134 if (frontPatchI_ == -1)
138 newPatches[frontPatchI_] =
157 Info<<
"Adding patch " << newPatches[frontPatchI_]->name()
158 <<
" at index " << frontPatchI_
159 <<
" for front faces." <<
nl <<
endl;
162 if (backPatchI_ == -1)
164 backPatchI_ =
patches.size() + 1;
166 newPatches[backPatchI_] =
185 Info<<
"Adding patch " << newPatches[backPatchI_]->name()
186 <<
" at index " << backPatchI_
187 <<
" for back faces." <<
nl <<
endl;
190 mesh_.removeBoundary();
191 mesh_.addPatches(newPatches);
197 polyTopoChange& meshMod
200 const label nLayers = model_.nLayers();
204 for (
label layer = 0; layer < nLayers; ++layer)
206 label offset = layer * mesh_.nCells();
208 forAll(mesh_.cells(), cellI)
216 mesh_.cellZones().whichZone(cellI)
225 for (
label layer = 0; layer <= nLayers; ++layer)
233 point newPoint = model_
249 Pout<<
"Added " <<
points.size() <<
" points to layer "
257 const faceList& faces = mesh_.faces();
258 const polyBoundaryMesh&
patches = mesh_.boundaryMesh();
260 for (
label layer = 0; layer < nLayers; ++layer)
262 label currentLayerOffset = layer * mesh_.nPoints();
263 label nextLayerOffset = currentLayerOffset + mesh_.nPoints();
265 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
267 label zoneID = mesh_.faceZones().whichZone(faceI);
268 bool zoneFlip =
false;
271 const faceZone& fZone = mesh_.faceZones()[zoneID];
272 zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
276 const face&
f = faces[faceI];
277 newFace[0] =
f[0] + currentLayerOffset;
278 newFace[1] =
f[1] + currentLayerOffset;
279 newFace[2] =
f[1] + nextLayerOffset;
280 newFace[3] =
f[0] + nextLayerOffset;
299 label offset = layer * mesh_.nCells();
304 mesh_.faceOwner()[faceI] + offset,
305 mesh_.faceNeighbour()[faceI] + offset,
317 Info<< newFace <<
" "
318 << mesh_.faceOwner()[faceI] + offset <<
" "
319 << mesh_.faceNeighbour()[faceI] + offset <<
" "
328 for (
label layer=0; layer < nLayers; layer++)
330 label currentLayerOffset = layer*mesh_.nPoints();
331 label nextLayerOffset = currentLayerOffset + mesh_.nPoints();
336 for (
label faceI = startFaceI; faceI < endFaceI; faceI++)
338 label zoneID = mesh_.faceZones().whichZone(faceI);
339 bool zoneFlip =
false;
342 const faceZone& fZone = mesh_.faceZones()[zoneID];
343 zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
347 const face&
f = faces[faceI];
348 newFace[0] =
f[0] + currentLayerOffset;
349 newFace[1] =
f[1] + currentLayerOffset;
350 newFace[2] =
f[1] + nextLayerOffset;
351 newFace[3] =
f[0] + nextLayerOffset;
353 label offset = layer * mesh_.nCells();
358 mesh_.faceOwner()[faceI] + offset,
371 Info<< newFace <<
" "
372 << mesh_.faceOwner()[faceI] + offset <<
" "
382 forAll(mesh_.cells(), cellI)
384 const cell& cFaces = mesh_.cells()[cellI];
386 face frontFace(cFaces.size());
389 label nextFaceI = cFaces[0];
391 const face&
f = faces[nextFaceI];
394 if (mesh_.faceOwner()[nextFaceI] == cellI)
406 for (
label i = 1; i < frontFace.size(); i++)
408 frontFace[i] = nextPointI;
413 label faceI = cFaces[cFaceI];
414 if (faceI != nextFaceI)
416 const face&
f = faces[faceI];
418 if (
f[0] == nextPointI)
424 else if (
f[1] == nextPointI)
434 for (
label layer = 0; layer < nLayers - 1; ++layer)
439 frontFace[fp] += mesh_.nPoints();
442 label offset = layer * mesh_.nCells();
445 if (layer != nLayers - 1)
447 nei = cellI + offset + mesh_.nCells();
466 Info<< frontFace <<
" "
467 << cellI + offset <<
" "
478 forAll(mesh_.cells(), cellI)
480 const cell& cFaces = mesh_.cells()[cellI];
482 face frontFace(cFaces.size());
485 label nextFaceI = cFaces[0];
487 const face&
f = faces[nextFaceI];
490 if (mesh_.faceOwner()[nextFaceI] == cellI)
502 for (
label i = 1; i < frontFace.size(); i++)
504 frontFace[i] = nextPointI;
509 label faceI = cFaces[cFaceI];
510 if (faceI != nextFaceI)
512 const face&
f = faces[faceI];
514 if (
f[0] == nextPointI)
520 else if (
f[1] == nextPointI)
533 frontFace.reverseFace(),
547 Info<<
nl<<frontFace.reverseFace() <<
" "
556 frontFace[fp] += mesh_.nPoints()* (nLayers);
559 label offset = (nLayers - 1) * mesh_.nCells();
577 Info<< frontFace <<
" "
578 << cellI + offset <<
" "