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];
483 && !pbm[patchi].coupled()
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 label patchi = zoneToPatch[zoneI];
1135 if (isA<mappedWallPolyPatch>(pp))
1153 forAll(newPatches, patchi)
1155 if (!newPatches[patchi])
1164 Pout<<
"*** setCouplingInfo addFvPAtches:" <<
nl;
1165 printPatches(
Pout, newPatches);
1166 Pout<<
"*** setCouplingInfo end of addFvPAtches:" <<
endl;
1175 void extrudeGeometricProperties
1220 bitSet sameEdgeOrientation;
1268 label celli = regionMesh.
faceOwner()[facei];
1275 label layerI = (celli % model.
nLayers());
1289 faceCentres[facei] = model
1291 patchFaceCentres[patchFacei],
1309 patchEdgeCentres[patchEdgeI],
1310 patchEdgeNormals[patchEdgeI],
1316 patchEdgeCentres[patchEdgeI],
1317 patchEdgeNormals[patchEdgeI],
1322 faceCentres[facei] = 0.5*(pt0+pt1);
1346 label layerI = (celli % model.
nLayers());
1351 patchFaceCentres[patchFacei],
1357 patchFaceCentres[patchFacei],
1363 cellCentres[celli] = 0.5*(pt0+pt1);
1373 forAll(faceCentres, facei)
1375 Pout<<
"Model :" << faceCentres[facei] <<
endl
1386 forAll(cellCentres, celli)
1388 Pout<<
"Model :" << cellCentres[celli] <<
endl
1403 Info<<
"Writing geometric properties for mesh " << regionMesh.
name()
1407 bool ok = faceCentres.
write() && cellCentres.write();
1412 <<
"Failed writing " << faceCentres.objectPath()
1413 <<
" and " << cellCentres.objectPath()
1419 int main(
int argc,
char *argv[])
1423 "Create region mesh by extruding a faceZone or faceSet"
1431 "dict",
"file",
"Alternative extrudeToRegionMeshDict"
1446 <<
"Patches are not synchronised on all processors."
1447 <<
" Per processor patches " << allNames
1453 const bool overwrite =
args.
found(
"overwrite");
1471 const bool hasZones =
dict.
found(
"faceZones");
1481 <<
"Please supply faces to extrude either through 'faceZones'"
1482 <<
" or 'faceSets' entry. Found both."
1496 const bool oneD(
dict.
get<
bool>(
"oneD"));
1497 bool oneDNonManifoldEdges(
false);
1498 word oneDPatchType(emptyPolyPatch::typeName);
1502 oneDPatchType =
dict.
get<
word>(
"oneDPolyPatchType");
1505 const bool adaptMesh(
dict.
get<
bool>(
"adaptMesh"));
1509 Info<<
"Extruding zones " << zoneNames
1511 <<
" into shell mesh " << shellRegionName
1516 Info<<
"Extruding faceSets " << zoneNames
1518 <<
" into shell mesh " << shellRegionName
1525 <<
"Cannot extrude into same region as mesh." <<
endl
1527 <<
"Shell region : " << shellRegionName
1534 if (oneDNonManifoldEdges)
1536 Info<<
"Extruding as 1D columns with sides in patch type "
1538 <<
" and connected points (except on non-manifold areas)."
1543 Info<<
"Extruding as 1D columns with sides in patch type "
1545 <<
" and duplicated points (overlapping volumes)."
1612 meshInstance = oldInstance;
1614 Info<<
"Writing meshes to " << meshInstance <<
nl <<
endl;
1628 boolList isInternal(zoneNames.size(),
false);
1644 meshZoneID.
setSize(zoneNames.size());
1647 meshZoneID[i] = faceZones.
findZoneID(zoneNames[i]);
1648 if (meshZoneID[i] == -1)
1651 <<
"Cannot find zone " << zoneNames[i] <<
endl
1652 <<
"Valid zones are " << faceZones.
names()
1657 label nExtrudeFaces = 0;
1660 nExtrudeFaces += faceZones[meshZoneID[i]].size();
1662 extrudeMeshFaces.setSize(nExtrudeFaces);
1663 zoneFaces.
setSize(nExtrudeFaces);
1665 zoneFlipMap.
setSize(nExtrudeFaces);
1669 const faceZone& fz = faceZones[meshZoneID[i]];
1673 extrudeMeshFaces[nExtrudeFaces] = fz[j];
1674 zoneFaces[nExtrudeFaces] = fzp[j];
1675 zoneID[nExtrudeFaces] = i;
1676 zoneFlipMap[nExtrudeFaces] = fz.
flipMap()[j];
1681 isInternal[i] =
true;
1689 if (zoneShadowNames.size())
1691 zoneShadowIDs.
setSize(zoneShadowNames.size());
1692 forAll(zoneShadowNames, i)
1694 zoneShadowIDs[i] = faceZones.
findZoneID(zoneShadowNames[i]);
1695 if (zoneShadowIDs[i] == -1)
1698 <<
"Cannot find zone " << zoneShadowNames[i] <<
endl
1699 <<
"Valid zones are " << faceZones.
names()
1704 label nShadowFaces = 0;
1707 nShadowFaces += faceZones[zoneShadowIDs[i]].size();
1710 extrudeMeshShadowFaces.
setSize(nShadowFaces);
1711 zoneShadowFlipMap.
setSize(nShadowFaces);
1712 zoneShadowID.
setSize(nShadowFaces);
1717 const faceZone& fz = faceZones[zoneShadowIDs[i]];
1720 extrudeMeshShadowFaces[nShadowFaces] = fz[j];
1721 zoneShadowFlipMap[nShadowFaces] = fz.
flipMap()[j];
1722 zoneShadowID[nShadowFaces] = i;
1730 meshZoneID.
setSize(zoneNames.size(), -1);
1735 Info<<
"Loading faceSet " << zoneNames[i] <<
endl;
1741 label nExtrudeFaces = 0;
1744 nExtrudeFaces += zones[i].size();
1746 extrudeMeshFaces.setSize(nExtrudeFaces);
1747 zoneFaces.
setSize(nExtrudeFaces);
1749 zoneFlipMap.
setSize(nExtrudeFaces);
1755 for (
const label facei : fz)
1760 <<
"faceSet " << fz.name()
1761 <<
"contains internal faces."
1762 <<
" This is not permitted."
1765 extrudeMeshFaces[nExtrudeFaces] = facei;
1766 zoneFaces[nExtrudeFaces] =
mesh.
faces()[facei];
1767 zoneID[nExtrudeFaces] = i;
1768 zoneFlipMap[nExtrudeFaces] =
false;
1773 isInternal[i] =
true;
1783 if (zoneShadowNames.size())
1785 zoneShadowIDs.
setSize(zoneShadowNames.size(), -1);
1786 forAll(zoneShadowNames, i)
1788 shadowZones.set(i,
new faceSet(
mesh, zoneShadowNames[i]));
1791 label nShadowFaces = 0;
1792 for (
const faceSet& fz : shadowZones)
1794 nShadowFaces += fz.size();
1797 if (nExtrudeFaces != nShadowFaces)
1800 <<
"Extruded faces " << nExtrudeFaces <<
endl
1801 <<
"is different from shadow faces. " << nShadowFaces
1802 <<
"This is not permitted " <<
endl
1806 extrudeMeshShadowFaces.
setSize(nShadowFaces);
1807 zoneShadowFlipMap.
setSize(nShadowFaces);
1808 zoneShadowID.
setSize(nShadowFaces);
1813 const faceSet& fz = shadowZones[i];
1814 for (
const label facei : fz)
1819 <<
"faceSet " << fz.name()
1820 <<
"contains internal faces."
1821 <<
" This is not permitted."
1824 extrudeMeshShadowFaces[nShadowFaces] = facei;
1825 zoneShadowFlipMap[nShadowFaces] =
false;
1826 zoneShadowID[nShadowFaces] = i;
1839 checkZoneInside(
mesh, zoneNames,
zoneID, extrudeMeshFaces, isInternal);
1847 Info<<
"extrudePatch :"
1848 <<
" faces:" << extrudePatch.size()
1849 <<
" points:" << extrudePatch.
nPoints()
1850 <<
" edges:" << extrudePatch.
nEdges()
1868 const globalIndex globalExtrudeFaces(extrudePatch.size());
1885 extrudeEdgeGlobalFaces,
1899 extrudeEdgeFacesMap,
1900 extrudeEdgeGlobalFaces,
1914 if (!isA<processorPolyPatch>(
patches[patchi]))
1916 label newPatchi = regionPatches.size();
1917 regionPatches.append
1949 interRegionTopPatch,
1950 interRegionBottomPatch
1966 if (!isA<processorPolyPatch>(
patches[patchi]))
1969 clonedPatch->index() = newPatches.size();
1970 newPatches.
append(clonedPatch.ptr());
1987 interMeshBottomPatch
1993 if (isA<processorPolyPatch>(
patches[patchi]))
1996 clonedPatch->index() = newPatches.size();
1997 newPatches.
append(clonedPatch.ptr());
2003 Pout<<
"*** adaptMesh : addFvPAtches:" <<
nl;
2004 printPatches(
Pout, newPatches);
2005 Pout<<
"*** end of adaptMesh : addFvPAtches:" <<
endl;
2019 labelList extrudeTopPatchID(extrudePatch.size());
2020 labelList extrudeBottomPatchID(extrudePatch.size());
2024 extrudeTopPatchID[facei] = interRegionTopPatch[
zoneID[facei]];
2025 extrudeBottomPatchID[facei] = interRegionBottomPatch[
zoneID[facei]];
2035 labelList zoneZonePatch_min(zoneNames.size()*zoneNames.size(),
Zero);
2037 labelList zoneZonePatch_max(zoneNames.size()*zoneNames.size(),
Zero);
2048 extrudeEdgeGlobalFaces,
2095 extrudeEdgeFacesMap,
2096 extrudeEdgeGlobalFaces,
2146 const labelList& eFaces = edgeFaces[edgeI];
2148 labelList& ePatches = extrudeEdgePatches[edgeI];
2152 ePatches.
setSize(eFaces.size());
2155 ePatches[i] = zoneSidePatch[
zoneID[eFaces[i]]];
2158 if (oneDNonManifoldEdges)
2163 if (eFaces.size() != 2)
2165 nonManifoldEdge.
set(edgeI);
2170 nonManifoldEdge.set(edgeI);
2173 else if (eFaces.size() == 2)
2175 label zone0 =
zoneID[eFaces[0]];
2176 label zone1 =
zoneID[eFaces[1]];
2180 label minZone =
min(zone0,zone1);
2181 label maxZone =
max(zone0,zone1);
2182 label index = minZone*zoneNames.size()+maxZone;
2184 ePatches.
setSize(eFaces.size());
2186 if (zone0 == minZone)
2188 ePatches[0] = zoneZonePatch_min[index];
2189 ePatches[1] = zoneZonePatch_max[index];
2193 ePatches[0] = zoneZonePatch_max[index];
2194 ePatches[1] = zoneZonePatch_min[index];
2197 nonManifoldEdge.
set(edgeI);
2200 else if (sidePatchID[edgeI] != -1)
2203 ePatches.
setSize(eFaces.size());
2206 ePatches[i] = sidePatchID[edgeI];
2211 label facei = findUncoveredPatchFace
2215 extrudeMeshEdges[edgeI]
2220 label newPatchi = findPatchID
2225 ePatches.
setSize(eFaces.size(), newPatchi);
2229 ePatches.
setSize(eFaces.size());
2232 ePatches[i] = zoneSidePatch[
zoneID[eFaces[i]]];
2235 nonManifoldEdge.
set(edgeI);
2262 labelList localRegionPoints(localToGlobalRegion.size());
2263 forAll(pointLocalRegions, facei)
2266 const face& pRegions = pointLocalRegions[facei];
2269 localRegionPoints[pRegions[fp]] =
f[fp];
2274 pointField localRegionNormals(localToGlobalRegion.size());
2278 forAll(pointLocalRegions, facei)
2280 const face& pRegions = pointLocalRegions[facei];
2283 label localRegionI = pRegions[fp];
2284 localSum[localRegionI] += extrudePatch.
faceNormals()[facei];
2288 Map<point> globalSum(2*localToGlobalRegion.size());
2290 forAll(localSum, localRegionI)
2292 label globalRegionI = localToGlobalRegion[localRegionI];
2293 globalSum.insert(globalRegionI, localSum[localRegionI]);
2300 forAll(localToGlobalRegion, localRegionI)
2302 label globalRegionI = localToGlobalRegion[localRegionI];
2303 localRegionNormals[localRegionI] = globalSum[globalRegionI];
2305 localRegionNormals /=
mag(localRegionNormals);
2317 forAll(pointLocalRegions, facei)
2319 const face&
f = extrudeFaces[facei];
2323 label region = pointLocalRegions[facei][fp];
2324 const point& pt = extrudePoints[
f[fp]];
2331 pt+thickness*localRegionNormals[region]
2334 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
2342 forAll(firstDisp, regionI)
2349 localRegionPoints[regionI]
2352 const vector&
n = localRegionNormals[regionI];
2353 firstDisp[regionI] = model()(regionPt,
n, 1) - regionPt;
2385 forAll(regionPatches, patchi)
2387 polyPatch* ppPtr = regionPatches[patchi];
2393 Pout<<
"*** regionPatches : regionPatches:" <<
nl;
2394 printPatches(
Pout, regionPatches);
2395 Pout<<
"*** end of regionPatches : regionPatches:" <<
endl;
2400 regionMesh.removeFvBoundary();
2401 regionMesh.addFvPatches(regionPatches,
true);
2409 model().expansionRatio(),
2412 extrudeBottomPatchID,
2425 label meshPointi = extrudePatch.
localPoints().size();
2426 forAll(localRegionPoints, regionI)
2428 label pointi = localRegionPoints[regionI];
2430 const vector&
n = localRegionNormals[regionI];
2432 for (label layerI = 1; layerI <= model().
nLayers(); layerI++)
2434 newPoints[meshPointi++] = model()(pt,
n, layerI);
2438 shellMap = meshMod.changeMesh
2463 if (isA<mappedWallPolyPatch>(pp))
2465 if (interRegionTopPatch.found(patchi))
2467 label zoneI = interRegionTopPatch.find(patchi);
2468 topOffsets[zoneI] = calcOffset(extrudePatch, extruder, pp);
2470 else if (interRegionBottomPatch.found(patchi))
2472 label zoneI = interRegionBottomPatch.find(patchi);
2473 bottomOffsets[zoneI] = calcOffset(extrudePatch, extruder, pp);
2487 interRegionTopPatch,
2497 interRegionBottomPatch,
2504 deleteEmptyPatches(regionMesh);
2526 interMeshBottomPatch,
2542 "cellToPatchFaceAddressing",
2552 cellToPatchFaceAddressing.
note() =
"cell to patch face addressing";
2558 "faceToPatchFaceAddressing",
2568 faceToPatchFaceAddressing.
note() =
2569 "front/back face + turning index to patch face addressing";
2575 "faceToPatchEdgeAddressing",
2585 faceToPatchEdgeAddressing.
note() =
2586 "side face to patch edge addressing";
2592 "pointToPatchPointAddressing",
2602 pointToPatchPointAddressing.
note() =
2603 "point to patch point addressing";
2606 Info<<
"Writing mesh " << regionMesh.
name()
2612 && cellToPatchFaceAddressing.write()
2613 && faceToPatchFaceAddressing.write()
2614 && faceToPatchEdgeAddressing.write()
2615 && pointToPatchPointAddressing.write();
2620 <<
"Failed writing mesh " << regionMesh.
name()
2643 Info<<
"Reading patch face,edge centres : "
2644 << io.name() <<
" and patchEdgeCentres" <<
endl;
2646 extrudeGeometricProperties
2670 forAll(extrudeMeshFaces, zoneFacei)
2672 label meshFacei = extrudeMeshFaces[zoneFacei];
2673 label zoneI =
zoneID[zoneFacei];
2674 bool flip = zoneFlipMap[zoneFacei];
2686 interMeshBottomPatch[zoneI],
2700 interMeshBottomPatch[zoneI],
2707 if (zoneShadowNames.size() > 0)
2709 forAll(extrudeMeshFaces, zoneFacei)
2711 label meshFacei = extrudeMeshShadowFaces[zoneFacei];
2712 label zoneI = zoneShadowID[zoneFacei];
2713 bool flip = zoneShadowFlipMap[zoneFacei];
2725 interMeshTopPatch[zoneI],
2739 interMeshTopPatch[zoneI],
2749 forAll(extrudeMeshFaces, zoneFacei)
2751 label meshFacei = extrudeMeshFaces[zoneFacei];
2752 label zoneI =
zoneID[zoneFacei];
2753 bool flip = zoneFlipMap[zoneFacei];
2769 interMeshTopPatch[zoneI],
2786 interMeshTopPatch[zoneI],
2795 addBafflesMap = meshMod.changeMesh(
mesh,
false);
2806 if (addBafflesMap().hasMotionPoints())
2814 deleteEmptyPatches(
mesh);
2823 <<
"Failed writing mesh " <<
mesh.
name()