149 using namespace Foam;
169 for (
const polyPatch* ppPtr : newPatches)
172 os <<
" name:" << pp.
name() <<
" index:" << pp.
index()
173 <<
" start:" << pp.
start() <<
" size:" << pp.size()
174 <<
" type:" << pp.type() <<
nl;
180 template<
class PatchType>
184 const word& patchName,
188 label patchi = findPatchID(newPatches, patchName);
192 if (isA<PatchType>(*newPatches[patchi]))
200 <<
"Already have patch " << patchName
201 <<
" but of type " << newPatches[patchi]->type()
207 patchi = newPatches.size();
209 label startFacei = 0;
212 const polyPatch& pp = *newPatches.last();
213 startFacei = pp.
start()+pp.size();
217 Pout<<
"addPatch : starting newPatches:"
218 <<
" patch:" << patchi <<
" startFace:" << startFacei <<
nl;
219 printPatches(
Pout, newPatches);
220 Pout<<
"*** end of addPatch:" <<
endl;
240 template<
class PatchType>
244 const word& patchName,
249 label patchi = findPatchID(newPatches, patchName);
253 if (isA<PatchType>(*newPatches[patchi]))
261 <<
"Already have patch " << patchName
262 <<
" but of type " << newPatches[patchi]->type()
268 patchi = newPatches.size();
270 label startFacei = 0;
273 const polyPatch& pp = *newPatches.last();
274 startFacei = pp.
start()+pp.size();
279 Pout<<
"addPatch : starting newPatches:"
280 <<
" patch:" << patchi <<
" startFace:" << startFacei <<
nl;
281 printPatches(
Pout, newPatches);
282 Pout<<
"*** end of addPatch:" <<
endl;
287 patchDict.set(
"type", PatchType::typeName);
288 patchDict.set(
"nFaces", 0);
289 patchDict.set(
"startFace", startFacei);
321 label notUsedI =
patches.size();
324 forAll(masterNames, masterI)
330 if (isA<processorPolyPatch>(
patches[patchi]))
335 Pout<<
"Deleting processor patch " << patchi
338 oldToNew[patchi] = --notUsedI;
342 oldToNew[patchi] = usedI++;
350 Pout<<
"Deleting patch " << patchi
353 oldToNew[patchi] = --notUsedI;
357 oldToNew[patchi] = usedI++;
366 if (oldToNew[patchi] == -1)
372 Pout<<
"Deleting processor patch " << patchi
375 oldToNew[patchi] = --notUsedI;
379 oldToNew[patchi] = usedI++;
402 Info<<
"Zone " << zoneNames[i] <<
" has internal faces" <<
endl;
406 Info<<
"Zone " << zoneNames[i] <<
" has boundary faces" <<
endl;
410 forAll(extrudeMeshFaces, i)
412 label facei = extrudeMeshFaces[i];
417 <<
"Zone " << zoneNames[zoneI]
418 <<
" is not consistently all internal or all boundary faces."
420 <<
" is the first occurrence."
444 globalEdgeFaces[edgeI] = globalFaces.
toGlobal(edgeFaces[edgeI]);
457 return globalEdgeFaces;
462 label findUncoveredPatchFace
466 const label meshEdgeI
471 extrudeFaceSet.insert(extrudeMeshFaces);
477 label facei = eFaces[i];
484 && !extrudeFaceSet.found(facei)
496 label findUncoveredCyclicPatchFace
500 const label meshEdgeI
505 extrudeFaceSet.insert(extrudeMeshFaces);
511 label facei = eFaces[i];
517 && isA<cyclicPolyPatch>(pbm[patchi])
518 && !extrudeFaceSet.found(facei)
530 void calcEdgeMinMaxZone
551 forAll(extrudeEdgeGlobalFaces, edgeI)
553 const labelList& eFaces = extrudeEdgeGlobalFaces[edgeI];
558 label zoneI = mappedZoneID[eFaces[i]];
559 minZoneID[edgeI] =
min(minZoneID[edgeI], zoneI);
560 maxZoneID[edgeI] =
max(maxZoneID[edgeI], zoneI);
588 void countExtrudePatches
613 if (eFaces.size() == 2)
616 if (minZoneID[edgeI] != maxZoneID[edgeI])
618 zoneZonePatch[minZoneID[edgeI]*
nZones+maxZoneID[edgeI]]++;
624 && extrudeEdgeGlobalFaces[edgeI].size() == 2
628 if (minZoneID[edgeI] != maxZoneID[edgeI])
634 <<
"at " << pts[
e[0]] << pts[
e[1]]
635 <<
" is a coupled edge and inbetween two different zones "
636 << minZoneID[edgeI] <<
" and " << maxZoneID[edgeI] <<
endl
637 <<
" This is currently not supported." <<
endl;
639 zoneZonePatch[minZoneID[edgeI]*
nZones+maxZoneID[edgeI]]++;
649 label facei = findUncoveredPatchFace
653 extrudeMeshEdges[edgeI]
658 zoneSidePatch[minZoneID[edgeI]]++;
671 void addCouplingPatches
675 const word& shellRegionName,
686 Pout<<
"Adding coupling patches:" <<
nl <<
nl
687 <<
"patchID\tpatch\ttype" <<
nl
688 <<
"-------\t-----\t----"
691 interRegionTopPatch.
setSize(zoneNames.size(), -1);
692 interRegionBottomPatch.
setSize(zoneNames.size(), -1);
694 label nOldPatches = newPatches.size();
706 if (isInternal[zoneI])
708 interRegionTopPatch[zoneI] = addPatch<mappedWallPolyPatch>
714 Pout<< interRegionTopPatch[zoneI]
715 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->name()
716 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->type()
719 interRegionBottomPatch[zoneI] = addPatch<mappedWallPolyPatch>
722 interName +
"_bottom",
725 Pout<< interRegionBottomPatch[zoneI]
726 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->name()
727 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->type()
730 else if (zoneShadowNames.size() == 0)
732 interRegionTopPatch[zoneI] = addPatch<polyPatch>
735 zoneNames[zoneI] +
"_top",
738 Pout<< interRegionTopPatch[zoneI]
739 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->name()
740 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->type()
743 interRegionBottomPatch[zoneI] = addPatch<mappedWallPolyPatch>
749 Pout<< interRegionBottomPatch[zoneI]
750 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->name()
751 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->type()
756 interRegionTopPatch[zoneI] = addPatch<mappedWallPolyPatch>
759 zoneShadowNames[zoneI] +
"_top",
762 Pout<< interRegionTopPatch[zoneI]
763 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->name()
764 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->type()
767 interRegionBottomPatch[zoneI] = addPatch<mappedWallPolyPatch>
773 Pout<< interRegionBottomPatch[zoneI]
774 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->name()
775 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->type()
779 Pout<<
"Added " << newPatches.size()-nOldPatches
780 <<
" inter-region patches." <<
nl
787 void addCoupledPatches
810 forAll(extrudeEdgeGlobalFaces, edgeI)
812 const labelList& eFaces = extrudeEdgeGlobalFaces[edgeI];
817 label proci = procID[eFaces[i]];
818 minProcID[edgeI] =
min(minProcID[edgeI], proci);
819 maxProcID[edgeI] =
max(maxProcID[edgeI], proci);
840 Pout<<
"Adding processor or cyclic patches:" <<
nl <<
nl
841 <<
"patchID\tpatch" <<
nl
845 label nOldPatches = newPatches.size();
855 && extrudeEdgeGlobalFaces[edgeI].size() == 2
859 label nbrProci = minProcID[edgeI];
862 nbrProci = maxProcID[edgeI];
871 label facei = findUncoveredCyclicPatchFace
875 extrudeMeshEdges[edgeI]
882 label newPatchi = findPatchID
888 sidePatchID[edgeI] = newPatchi;
893 <<
"Unable to determine coupled patch addressing"
905 sidePatchID[edgeI] = findPatchID(newPatches,
name);
907 if (sidePatchID[edgeI] == -1)
911 patchDict.
add(
"neighbProcNo", nbrProci);
913 sidePatchID[edgeI] = addPatch<processorPolyPatch>
921 Pout<< sidePatchID[edgeI] <<
'\t' <<
name
927 Pout<<
"Added " << newPatches.size()-nOldPatches
928 <<
" coupled patches." <<
nl
933 void addZoneSidePatches
937 const word& oneDPolyPatchType,
943 Pout<<
"Adding patches for sides on zones:" <<
nl <<
nl
944 <<
"patchID\tpatch" <<
nl
948 label nOldPatches = newPatches.size();
950 forAll(zoneSidePatch, zoneI)
956 if (oneDPolyPatchType ==
"empty")
958 patchName =
"oneDEmptyPatch";
959 zoneSidePatch[zoneI] = addPatch<emptyPolyPatch>
966 else if (oneDPolyPatchType ==
"wedge")
968 patchName =
"oneDWedgePatch";
969 zoneSidePatch[zoneI] = addPatch<wedgePolyPatch>
979 <<
"Type " << oneDPolyPatchType <<
" does not exist "
983 Pout<< zoneSidePatch[zoneI] <<
'\t' << patchName <<
nl;
985 else if (zoneSidePatch[zoneI] > 0)
987 word patchName = zoneNames[zoneI] +
"_" +
"side";
989 zoneSidePatch[zoneI] = addPatch<polyPatch>
996 Pout<< zoneSidePatch[zoneI] <<
'\t' << patchName <<
nl;
999 Pout<<
"Added " << newPatches.size()-nOldPatches <<
" zone-side patches."
1004 void addInterZonePatches
1015 Pout<<
"Adding inter-zone patches:" <<
nl <<
nl
1016 <<
"patchID\tpatch" <<
nl
1027 label nOldPatches = newPatches.size();
1031 forAll(zoneZonePatch_min, minZone)
1033 for (label maxZone = minZone; maxZone < zoneNames.size(); maxZone++)
1035 label index = minZone*zoneNames.size()+maxZone;
1037 if (zoneZonePatch_min[index] > 0)
1042 + zoneNames[maxZone];
1046 + zoneNames[minZone];
1049 transformDict.
set(
"neighbourPatch", maxToMin);
1050 zoneZonePatch_min[index] =
1051 addPatch<nonuniformTransformCyclicPolyPatch>
1058 Pout<< zoneZonePatch_min[index] <<
'\t' << minToMax
1062 transformDict.
set(
"neighbourPatch", minToMax);
1063 zoneZonePatch_max[index] =
1064 addPatch<nonuniformTransformCyclicPolyPatch>
1071 Pout<< zoneZonePatch_max[index] <<
'\t' << maxToMin
1079 Pout<<
"Added " << newPatches.size()-nOldPatches <<
" inter-zone patches."
1098 label meshFacei = pp.
start()+i;
1100 point patchFc = extrudePatch[patchFacei].centre
1104 offsets[i] = patchFc - fc[i];
1110 void setCouplingInfo
1114 const word& sampleRegion,
1127 forAll(zoneToPatch, zoneI)
1129 const label patchi = zoneToPatch[zoneI];
1135 if (isA<mappedWallPolyPatch>(pp))
1139 const scalar mergeSqrDist =
1157 Info<<
"Adding on " <<
mesh.
name() <<
" coupling patch "
1158 << pp.
name() <<
" with ";
1162 if (mergeSqrDist <
magSqr(10*SMALL*bb.span()))
1164 Info<<
"uniform offset " << avgOffset <<
endl;
1168 Info<<
"non-uniform offset" <<
endl;
1170 (*mappedPtr).setOffset(offsets[zoneI]);
1173 newPatches[patchi] = mappedPtr.release();
1178 forAll(newPatches, patchi)
1180 if (!newPatches[patchi])
1189 Pout<<
"*** setCouplingInfo addFvPAtches:" <<
nl;
1190 printPatches(
Pout, newPatches);
1191 Pout<<
"*** setCouplingInfo end of addFvPAtches:" <<
endl;
1200 void extrudeGeometricProperties
1245 bitSet sameEdgeOrientation;
1293 label celli = regionMesh.
faceOwner()[facei];
1300 label layerI = (celli % model.
nLayers());
1314 faceCentres[facei] = model
1316 patchFaceCentres[patchFacei],
1334 patchEdgeCentres[patchEdgeI],
1335 patchEdgeNormals[patchEdgeI],
1341 patchEdgeCentres[patchEdgeI],
1342 patchEdgeNormals[patchEdgeI],
1347 faceCentres[facei] = 0.5*(pt0+pt1);
1371 label layerI = (celli % model.
nLayers());
1376 patchFaceCentres[patchFacei],
1382 patchFaceCentres[patchFacei],
1388 cellCentres[celli] = 0.5*(pt0+pt1);
1398 forAll(faceCentres, facei)
1400 Pout<<
"Model :" << faceCentres[facei] <<
endl
1411 forAll(cellCentres, celli)
1413 Pout<<
"Model :" << cellCentres[celli] <<
endl
1428 Info<<
"Writing geometric properties for mesh " << regionMesh.
name()
1432 bool ok = faceCentres.
write() && cellCentres.write();
1437 <<
"Failed writing " << faceCentres.objectPath()
1438 <<
" and " << cellCentres.objectPath()
1444 int main(
int argc,
char *argv[])
1448 "Create region mesh by extruding a faceZone or faceSet"
1456 "dict",
"file",
"Alternative extrudeToRegionMeshDict"
1471 <<
"Patches are not synchronised on all processors."
1472 <<
" Per processor patches " << allNames
1478 const bool overwrite =
args.
found(
"overwrite");
1496 const bool hasZones =
dict.
found(
"faceZones");
1506 <<
"Please supply faces to extrude either through 'faceZones'"
1507 <<
" or 'faceSets' entry. Found both."
1521 const bool oneD(
dict.
get<
bool>(
"oneD"));
1522 bool oneDNonManifoldEdges(
false);
1523 word oneDPatchType(emptyPolyPatch::typeName);
1527 oneDPatchType =
dict.
get<
word>(
"oneDPolyPatchType");
1530 const bool adaptMesh(
dict.
get<
bool>(
"adaptMesh"));
1534 Info<<
"Extruding zones " << zoneNames
1536 <<
" into shell mesh " << shellRegionName
1541 Info<<
"Extruding faceSets " << zoneNames
1543 <<
" into shell mesh " << shellRegionName
1550 <<
"Cannot extrude into same region as mesh." <<
endl
1552 <<
"Shell region : " << shellRegionName
1559 if (oneDNonManifoldEdges)
1561 Info<<
"Extruding as 1D columns with sides in patch type "
1563 <<
" and connected points (except on non-manifold areas)."
1568 Info<<
"Extruding as 1D columns with sides in patch type "
1570 <<
" and duplicated points (overlapping volumes)."
1637 meshInstance = oldInstance;
1639 Info<<
"Writing meshes to " << meshInstance <<
nl <<
endl;
1653 boolList isInternal(zoneNames.size(),
false);
1669 meshZoneID.
setSize(zoneNames.size());
1672 meshZoneID[i] = faceZones.
findZoneID(zoneNames[i]);
1673 if (meshZoneID[i] == -1)
1676 <<
"Cannot find zone " << zoneNames[i] <<
endl
1677 <<
"Valid zones are " << faceZones.
names()
1682 label nExtrudeFaces = 0;
1685 nExtrudeFaces += faceZones[meshZoneID[i]].size();
1687 extrudeMeshFaces.
setSize(nExtrudeFaces);
1688 zoneFaces.
setSize(nExtrudeFaces);
1690 zoneFlipMap.
setSize(nExtrudeFaces);
1694 const faceZone& fz = faceZones[meshZoneID[i]];
1698 extrudeMeshFaces[nExtrudeFaces] = fz[j];
1699 zoneFaces[nExtrudeFaces] = fzp[j];
1700 zoneID[nExtrudeFaces] = i;
1701 zoneFlipMap[nExtrudeFaces] = fz.
flipMap()[j];
1706 isInternal[i] =
true;
1714 if (zoneShadowNames.size())
1716 zoneShadowIDs.
setSize(zoneShadowNames.size());
1717 forAll(zoneShadowNames, i)
1719 zoneShadowIDs[i] = faceZones.
findZoneID(zoneShadowNames[i]);
1720 if (zoneShadowIDs[i] == -1)
1723 <<
"Cannot find zone " << zoneShadowNames[i] <<
endl
1724 <<
"Valid zones are " << faceZones.
names()
1729 label nShadowFaces = 0;
1732 nShadowFaces += faceZones[zoneShadowIDs[i]].size();
1735 extrudeMeshShadowFaces.
setSize(nShadowFaces);
1736 zoneShadowFlipMap.
setSize(nShadowFaces);
1737 zoneShadowID.
setSize(nShadowFaces);
1742 const faceZone& fz = faceZones[zoneShadowIDs[i]];
1745 extrudeMeshShadowFaces[nShadowFaces] = fz[j];
1746 zoneShadowFlipMap[nShadowFaces] = fz.
flipMap()[j];
1747 zoneShadowID[nShadowFaces] = i;
1755 meshZoneID.
setSize(zoneNames.size(), -1);
1760 Info<<
"Loading faceSet " << zoneNames[i] <<
endl;
1766 label nExtrudeFaces = 0;
1769 nExtrudeFaces += zones[i].size();
1771 extrudeMeshFaces.
setSize(nExtrudeFaces);
1772 zoneFaces.
setSize(nExtrudeFaces);
1774 zoneFlipMap.
setSize(nExtrudeFaces);
1780 for (
const label facei : fz)
1785 <<
"faceSet " << fz.name()
1786 <<
"contains internal faces."
1787 <<
" This is not permitted."
1790 extrudeMeshFaces[nExtrudeFaces] = facei;
1791 zoneFaces[nExtrudeFaces] =
mesh.
faces()[facei];
1792 zoneID[nExtrudeFaces] = i;
1793 zoneFlipMap[nExtrudeFaces] =
false;
1798 isInternal[i] =
true;
1808 if (zoneShadowNames.size())
1810 zoneShadowIDs.
setSize(zoneShadowNames.size(), -1);
1811 forAll(zoneShadowNames, i)
1813 shadowZones.set(i,
new faceSet(
mesh, zoneShadowNames[i]));
1816 label nShadowFaces = 0;
1817 for (
const faceSet& fz : shadowZones)
1819 nShadowFaces += fz.size();
1822 if (nExtrudeFaces != nShadowFaces)
1825 <<
"Extruded faces " << nExtrudeFaces <<
endl
1826 <<
"is different from shadow faces. " << nShadowFaces
1827 <<
"This is not permitted " <<
endl
1831 extrudeMeshShadowFaces.
setSize(nShadowFaces);
1832 zoneShadowFlipMap.
setSize(nShadowFaces);
1833 zoneShadowID.
setSize(nShadowFaces);
1838 const faceSet& fz = shadowZones[i];
1839 for (
const label facei : fz)
1844 <<
"faceSet " << fz.name()
1845 <<
"contains internal faces."
1846 <<
" This is not permitted."
1849 extrudeMeshShadowFaces[nShadowFaces] = facei;
1850 zoneShadowFlipMap[nShadowFaces] =
false;
1851 zoneShadowID[nShadowFaces] = i;
1864 checkZoneInside(
mesh, zoneNames,
zoneID, extrudeMeshFaces, isInternal);
1872 Info<<
"extrudePatch :"
1873 <<
" faces:" << extrudePatch.size()
1874 <<
" points:" << extrudePatch.
nPoints()
1875 <<
" edges:" << extrudePatch.
nEdges()
1893 const globalIndex globalExtrudeFaces(extrudePatch.size());
1910 extrudeEdgeGlobalFaces,
1924 extrudeEdgeFacesMap,
1925 extrudeEdgeGlobalFaces,
1939 if (!isA<processorPolyPatch>(
patches[patchi]))
1941 label newPatchi = regionPatches.size();
1942 regionPatches.append
1974 interRegionTopPatch,
1975 interRegionBottomPatch
1991 if (!isA<processorPolyPatch>(
patches[patchi]))
1994 clonedPatch->index() = newPatches.size();
1995 newPatches.
append(clonedPatch.ptr());
2012 interMeshBottomPatch
2018 if (isA<processorPolyPatch>(
patches[patchi]))
2021 clonedPatch->index() = newPatches.size();
2022 newPatches.
append(clonedPatch.ptr());
2028 Pout<<
"*** adaptMesh : addFvPAtches:" <<
nl;
2029 printPatches(
Pout, newPatches);
2030 Pout<<
"*** end of adaptMesh : addFvPAtches:" <<
endl;
2044 labelList extrudeTopPatchID(extrudePatch.size());
2045 labelList extrudeBottomPatchID(extrudePatch.size());
2049 extrudeTopPatchID[facei] = interRegionTopPatch[
zoneID[facei]];
2050 extrudeBottomPatchID[facei] = interRegionBottomPatch[
zoneID[facei]];
2060 labelList zoneZonePatch_min(zoneNames.size()*zoneNames.size(),
Zero);
2062 labelList zoneZonePatch_max(zoneNames.size()*zoneNames.size(),
Zero);
2073 extrudeEdgeGlobalFaces,
2120 extrudeEdgeFacesMap,
2121 extrudeEdgeGlobalFaces,
2171 const labelList& eFaces = edgeFaces[edgeI];
2173 labelList& ePatches = extrudeEdgePatches[edgeI];
2177 ePatches.
setSize(eFaces.size());
2180 ePatches[i] = zoneSidePatch[
zoneID[eFaces[i]]];
2183 if (oneDNonManifoldEdges)
2188 if (eFaces.size() != 2)
2190 nonManifoldEdge.
set(edgeI);
2195 nonManifoldEdge.set(edgeI);
2198 else if (eFaces.size() == 2)
2200 label zone0 =
zoneID[eFaces[0]];
2201 label zone1 =
zoneID[eFaces[1]];
2205 label minZone =
min(zone0,zone1);
2206 label maxZone =
max(zone0,zone1);
2207 label index = minZone*zoneNames.size()+maxZone;
2209 ePatches.
setSize(eFaces.size());
2211 if (zone0 == minZone)
2213 ePatches[0] = zoneZonePatch_min[index];
2214 ePatches[1] = zoneZonePatch_max[index];
2218 ePatches[0] = zoneZonePatch_max[index];
2219 ePatches[1] = zoneZonePatch_min[index];
2222 nonManifoldEdge.
set(edgeI);
2225 else if (sidePatchID[edgeI] != -1)
2228 ePatches.
setSize(eFaces.size());
2231 ePatches[i] = sidePatchID[edgeI];
2236 label facei = findUncoveredPatchFace
2240 extrudeMeshEdges[edgeI]
2245 label newPatchi = findPatchID
2250 ePatches.
setSize(eFaces.size(), newPatchi);
2254 ePatches.
setSize(eFaces.size());
2257 ePatches[i] = zoneSidePatch[
zoneID[eFaces[i]]];
2260 nonManifoldEdge.
set(edgeI);
2287 labelList localRegionPoints(localToGlobalRegion.size());
2288 forAll(pointLocalRegions, facei)
2291 const face& pRegions = pointLocalRegions[facei];
2294 localRegionPoints[pRegions[fp]] =
f[fp];
2299 pointField localRegionNormals(localToGlobalRegion.size());
2303 forAll(pointLocalRegions, facei)
2305 const face& pRegions = pointLocalRegions[facei];
2308 label localRegionI = pRegions[fp];
2309 localSum[localRegionI] += extrudePatch.
faceNormals()[facei];
2313 Map<point> globalSum(2*localToGlobalRegion.size());
2315 forAll(localSum, localRegionI)
2317 label globalRegionI = localToGlobalRegion[localRegionI];
2318 globalSum.insert(globalRegionI, localSum[localRegionI]);
2325 forAll(localToGlobalRegion, localRegionI)
2327 label globalRegionI = localToGlobalRegion[localRegionI];
2328 localRegionNormals[localRegionI] = globalSum[globalRegionI];
2330 localRegionNormals /=
mag(localRegionNormals);
2342 forAll(pointLocalRegions, facei)
2344 const face&
f = extrudeFaces[facei];
2348 label region = pointLocalRegions[facei][fp];
2349 const point& pt = extrudePoints[
f[fp]];
2356 pt+thickness*localRegionNormals[region]
2359 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
2367 forAll(firstDisp, regionI)
2374 localRegionPoints[regionI]
2377 const vector&
n = localRegionNormals[regionI];
2378 firstDisp[regionI] = model()(regionPt,
n, 1) - regionPt;
2410 forAll(regionPatches, patchi)
2412 polyPatch* ppPtr = regionPatches[patchi];
2418 Pout<<
"*** regionPatches : regionPatches:" <<
nl;
2419 printPatches(
Pout, regionPatches);
2420 Pout<<
"*** end of regionPatches : regionPatches:" <<
endl;
2425 regionMesh.removeFvBoundary();
2426 regionMesh.addFvPatches(regionPatches,
true);
2434 model().expansionRatio(),
2437 extrudeBottomPatchID,
2450 label meshPointi = extrudePatch.
localPoints().size();
2451 forAll(localRegionPoints, regionI)
2453 label pointi = localRegionPoints[regionI];
2455 const vector&
n = localRegionNormals[regionI];
2457 for (label layerI = 1; layerI <= model().
nLayers(); layerI++)
2459 newPoints[meshPointi++] = model()(pt,
n, layerI);
2463 shellMap = meshMod.changeMesh
2488 if (isA<mappedWallPolyPatch>(pp))
2490 if (interRegionTopPatch.found(patchi))
2492 label zoneI = interRegionTopPatch.find(patchi);
2493 topOffsets[zoneI] = calcOffset(extrudePatch, extruder, pp);
2495 else if (interRegionBottomPatch.found(patchi))
2497 label zoneI = interRegionBottomPatch.find(patchi);
2498 bottomOffsets[zoneI] = calcOffset(extrudePatch, extruder, pp);
2512 interRegionTopPatch,
2522 interRegionBottomPatch,
2529 deleteEmptyPatches(regionMesh);
2551 interMeshBottomPatch,
2567 "cellToPatchFaceAddressing",
2577 cellToPatchFaceAddressing.note() =
"cell to patch face addressing";
2583 "faceToPatchFaceAddressing",
2593 faceToPatchFaceAddressing.note() =
2594 "front/back face + turning index to patch face addressing";
2600 "faceToPatchEdgeAddressing",
2610 faceToPatchEdgeAddressing.note() =
2611 "side face to patch edge addressing";
2617 "pointToPatchPointAddressing",
2627 pointToPatchPointAddressing.note() =
2628 "point to patch point addressing";
2631 Info<<
"Writing mesh " << regionMesh.
name()
2637 && cellToPatchFaceAddressing.write()
2638 && faceToPatchFaceAddressing.write()
2639 && faceToPatchEdgeAddressing.write()
2640 && pointToPatchPointAddressing.write();
2645 <<
"Failed writing mesh " << regionMesh.
name()
2668 Info<<
"Reading patch face,edge centres : "
2669 << io.name() <<
" and patchEdgeCentres" <<
endl;
2671 extrudeGeometricProperties
2695 forAll(extrudeMeshFaces, zoneFacei)
2697 label meshFacei = extrudeMeshFaces[zoneFacei];
2698 label zoneI =
zoneID[zoneFacei];
2699 bool flip = zoneFlipMap[zoneFacei];
2711 interMeshBottomPatch[zoneI],
2725 interMeshBottomPatch[zoneI],
2732 if (zoneShadowNames.size() > 0)
2734 forAll(extrudeMeshFaces, zoneFacei)
2736 label meshFacei = extrudeMeshShadowFaces[zoneFacei];
2737 label zoneI = zoneShadowID[zoneFacei];
2738 bool flip = zoneShadowFlipMap[zoneFacei];
2750 interMeshTopPatch[zoneI],
2764 interMeshTopPatch[zoneI],
2774 forAll(extrudeMeshFaces, zoneFacei)
2776 label meshFacei = extrudeMeshFaces[zoneFacei];
2777 label zoneI =
zoneID[zoneFacei];
2778 bool flip = zoneFlipMap[zoneFacei];
2794 interMeshTopPatch[zoneI],
2811 interMeshTopPatch[zoneI],
2820 addBafflesMap = meshMod.changeMesh(
mesh,
false);
2831 if (addBafflesMap().hasMotionPoints())
2839 deleteEmptyPatches(
mesh);
2848 <<
"Failed writing mesh " <<
mesh.
name()