131 using namespace Foam;
139 if (newPatches[i]->
name() == name)
148 template<
class PatchType>
152 const word& patchName,
156 label patchi = findPatchID(newPatches, patchName);
160 if (isA<PatchType>(*newPatches[patchi]))
168 <<
"Already have patch " << patchName
169 <<
" but of type " << newPatches[
patchi]->type()
175 patchi = newPatches.
size();
177 label startFacei = 0;
181 startFacei = pp.
start()+pp.size();
202 template<
class PatchType>
206 const word& patchName,
211 label patchi = findPatchID(newPatches, patchName);
215 if (isA<PatchType>(*newPatches[patchi]))
223 <<
"Already have patch " << patchName
224 <<
" but of type " << newPatches[
patchi]->type()
230 patchi = newPatches.
size();
232 label startFacei = 0;
236 startFacei = pp.
start()+pp.size();
240 patchDict.
set(
"type", PatchType::typeName);
241 patchDict.
set(
"nFaces", 0);
242 patchDict.
set(
"startFace", startFacei);
260 void deleteEmptyPatches(
fvMesh& mesh)
267 masterNames = patches.
names();
277 forAll(masterNames, masterI)
283 if (isA<processorPolyPatch>(patches[patchi]))
286 if (patches[patchi].size() == 0)
288 Pout<<
"Deleting processor patch " << patchi
291 oldToNew[
patchi] = --notUsedI;
295 oldToNew[
patchi] = usedI++;
303 Pout<<
"Deleting patch " << patchi
306 oldToNew[
patchi] = --notUsedI;
310 oldToNew[
patchi] = usedI++;
319 if (oldToNew[patchi] == -1)
323 if (patches[patchi].size() == 0)
325 Pout<<
"Deleting processor patch " << patchi
328 oldToNew[
patchi] = --notUsedI;
332 oldToNew[
patchi] = usedI++;
341 void createDummyFvMeshFiles(
const polyMesh& mesh,
const word& regionName)
356 Info<<
"Testing:" << io.objectPath() <<
endl;
360 Info<<
"Writing dummy " << regionName/io.name() <<
endl;
363 dummyDict.
add(
"divSchemes", divDict);
365 dummyDict.
add(
"gradSchemes", gradDict);
367 dummyDict.
add(
"laplacianSchemes", laplDict);
376 mesh.time().system(),
386 Info<<
"Writing dummy " << regionName/io.name() <<
endl;
408 Info<<
"Zone " << zoneNames[i] <<
" has internal faces" <<
endl;
412 Info<<
"Zone " << zoneNames[i] <<
" has boundary faces" <<
endl;
416 forAll(extrudeMeshFaces, i)
418 label facei = extrudeMeshFaces[i];
419 label zoneI = zoneID[i];
423 <<
"Zone " << zoneNames[zoneI]
424 <<
" is not consistently all internal or all boundary faces." 425 <<
" Face " << facei <<
" at " << mesh.
faceCentres()[facei]
426 <<
" is the first occurrence." 480 const labelList& eFaces = edgeFaces[edgeI];
483 labelList& globalEFaces = globalEdgeFaces[edgeI];
487 globalEFaces[i] = globalFaces.
toGlobal(eFaces[i]);
501 return globalEdgeFaces;
506 label findUncoveredPatchFace
510 const label meshEdgeI
515 forAll(extrudeMeshFaces, i)
517 extrudeFaceSet.insert(extrudeMeshFaces[i]);
524 label facei = eFaces[i];
530 && !pbm[patchi].coupled()
531 && !extrudeFaceSet.found(facei)
542 label findUncoveredCyclicPatchFace
546 const label meshEdgeI
551 forAll(extrudeMeshFaces, i)
553 extrudeFaceSet.insert(extrudeMeshFaces[i]);
560 label facei = eFaces[i];
566 && isA<cyclicPolyPatch>(pbm[patchi])
567 && !extrudeFaceSet.found(facei)
578 void calcEdgeMinMaxZone
599 forAll(extrudeEdgeGlobalFaces, edgeI)
601 const labelList& eFaces = extrudeEdgeGlobalFaces[edgeI];
606 label zoneI = mappedZoneID[eFaces[i]];
607 minZoneID[edgeI] =
min(minZoneID[edgeI], zoneI);
608 maxZoneID[edgeI] =
max(maxZoneID[edgeI], zoneI);
636 void countExtrudePatches
661 if (eFaces.
size() == 2)
664 if (minZoneID[edgeI] != maxZoneID[edgeI])
666 zoneZonePatch[minZoneID[edgeI]*nZones+maxZoneID[edgeI]]++;
672 && extrudeEdgeGlobalFaces[edgeI].
size() == 2
676 if (minZoneID[edgeI] != maxZoneID[edgeI])
678 const edge& e = extrudePatch.
edges()[edgeI];
682 <<
"at " << pts[e[0]] << pts[e[1]]
683 <<
" is a coupled edge and in between two different zones " 684 << minZoneID[edgeI] <<
" and " << maxZoneID[edgeI] << endl
685 <<
" This is currently not supported." <<
endl;
687 zoneZonePatch[minZoneID[edgeI]*nZones+maxZoneID[edgeI]]++;
697 label facei = findUncoveredPatchFace
701 extrudeMeshEdges[edgeI]
706 zoneSidePatch[minZoneID[edgeI]]++;
719 void addCouplingPatches
722 const word& regionName,
723 const word& shellRegionName,
734 Pout<<
"Adding coupling patches:" <<
nl <<
nl 735 <<
"patchID\tpatch\ttype" <<
nl 736 <<
"-------\t-----\t----" 740 interRegionBottomPatch.
setSize(zoneNames.
size(), -1);
754 if (isInternal[zoneI])
756 interRegionTopPatch[zoneI] = addPatch<mappedWallPolyPatch>
762 Pout<< interRegionTopPatch[zoneI]
763 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->name()
764 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->type()
767 interRegionBottomPatch[zoneI] = addPatch<mappedWallPolyPatch>
770 interName +
"_bottom",
773 Pout<< interRegionBottomPatch[zoneI]
774 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->name()
775 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->type()
778 else if (zoneShadowNames.
size() == 0)
780 interRegionTopPatch[zoneI] = addPatch<polyPatch>
783 zoneNames[zoneI] +
"_top",
786 Pout<< interRegionTopPatch[zoneI]
787 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->name()
788 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->type()
791 interRegionBottomPatch[zoneI] = addPatch<mappedWallPolyPatch>
797 Pout<< interRegionBottomPatch[zoneI]
798 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->name()
799 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->type()
804 interRegionTopPatch[zoneI] = addPatch<mappedWallPolyPatch>
807 zoneShadowNames[zoneI] +
"_top",
810 Pout<< interRegionTopPatch[zoneI]
811 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->name()
812 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->type()
815 interRegionBottomPatch[zoneI] = addPatch<mappedWallPolyPatch>
821 Pout<< interRegionBottomPatch[zoneI]
822 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->name()
823 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->type()
827 Pout<<
"Added " << newPatches.
size()-nOldPatches
828 <<
" inter-region patches." <<
nl 835 void addCoupledPatches
858 forAll(extrudeEdgeGlobalFaces, edgeI)
860 const labelList& eFaces = extrudeEdgeGlobalFaces[edgeI];
865 label proci = procID[eFaces[i]];
866 minProcID[edgeI] =
min(minProcID[edgeI], proci);
867 maxProcID[edgeI] =
max(maxProcID[edgeI], proci);
888 Pout<<
"Adding processor or cyclic patches:" <<
nl <<
nl 889 <<
"patchID\tpatch" <<
nl 903 && extrudeEdgeGlobalFaces[edgeI].
size() == 2
907 label nbrProci = minProcID[edgeI];
910 nbrProci = maxProcID[edgeI];
919 label facei = findUncoveredCyclicPatchFace
923 extrudeMeshEdges[edgeI]
930 label newPatchi = findPatchID
936 sidePatchID[edgeI] = newPatchi;
941 <<
"Unable to determine coupled patch addressing" 953 sidePatchID[edgeI] = findPatchID(newPatches, name);
955 if (sidePatchID[edgeI] == -1)
959 patchDict.
add(
"neighbProcNo", nbrProci);
961 sidePatchID[edgeI] = addPatch<processorPolyPatch>
969 Pout<< sidePatchID[edgeI] <<
'\t' << name
975 Pout<<
"Added " << newPatches.
size()-nOldPatches
976 <<
" coupled patches." <<
nl 981 void addZoneSidePatches
985 const word& oneDPolyPatchType,
991 Pout<<
"Adding patches for sides on zones:" <<
nl <<
nl 992 <<
"patchID\tpatch" <<
nl 998 forAll(zoneSidePatch, zoneI)
1004 if (oneDPolyPatchType ==
"empty")
1006 patchName =
"oneDEmptyPatch";
1007 zoneSidePatch[zoneI] = addPatch<emptyPolyPatch>
1014 else if (oneDPolyPatchType ==
"wedge")
1016 patchName =
"oneDWedgePatch";
1017 zoneSidePatch[zoneI] = addPatch<wedgePolyPatch>
1027 <<
"Type " << oneDPolyPatchType <<
" does not exist " 1031 Pout<< zoneSidePatch[zoneI] <<
'\t' << patchName <<
nl;
1033 else if (zoneSidePatch[zoneI] > 0)
1035 word patchName = zoneNames[zoneI] +
"_" +
"side";
1037 zoneSidePatch[zoneI] = addPatch<polyPatch>
1044 Pout<< zoneSidePatch[zoneI] <<
'\t' << patchName <<
nl;
1047 Pout<<
"Added " << newPatches.
size()-nOldPatches <<
" zone-side patches." 1068 point patchFc = extrudePatch[patchFacei].centre
1072 offsets[i] = patchFc - fc[i];
1078 void setCouplingInfo
1082 const word& sampleRegion,
1095 forAll(zoneToPatch, zoneI)
1097 label patchi = zoneToPatch[zoneI];
1103 if (isA<mappedWallPolyPatch>(pp))
1121 forAll(newPatches, patchi)
1123 if (!newPatches[patchi])
1135 void extrudeGeometricProperties
1249 faceCentres[facei] = model
1251 patchFaceCentres[patchFacei],
1269 patchEdgeCentres[patchEdgeI],
1270 patchEdgeNormals[patchEdgeI],
1276 patchEdgeCentres[patchEdgeI],
1277 patchEdgeNormals[patchEdgeI],
1282 faceCentres[facei] = 0.5*(pt0+pt1);
1311 patchFaceCentres[patchFacei],
1317 patchFaceCentres[patchFacei],
1323 cellCentres[celli] = 0.5*(pt0+pt1);
1333 forAll(faceCentres, facei)
1335 Pout<<
"Model :" << faceCentres[facei] << endl
1346 forAll(cellCentres, celli)
1348 Pout<<
"Model :" << cellCentres[celli] << endl
1363 Info<<
"Writing geometric properties for mesh " << regionMesh.
name()
1367 bool ok = faceCentres.write() && cellCentres.write();
1372 <<
"Failed writing " << faceCentres.objectPath()
1373 <<
" and " << cellCentres.objectPath()
1381 int main(
int argc,
char *argv[])
1400 <<
"Patches are not synchronised on all processors." 1401 <<
" Per processor patches " << allNames
1418 const word shellRegionName(dict.
lookup(
"region"));
1424 bool hasZones = dict.
found(
"faceZones");
1427 dict.
lookup(
"faceZones") >> zoneNames;
1431 if (dict.
found(
"faceSets"))
1434 <<
"Please supply faces to extrude either through 'faceZones'" 1435 <<
" or 'faceSets' entry. Found both." 1441 dict.
lookup(
"faceSets") >> zoneNames;
1450 Switch oneDNonManifoldEdges(
false);
1451 word oneDPatchType(emptyPolyPatch::typeName);
1455 dict.
lookup(
"oneDPolyPatchType") >> oneDPatchType;
1462 Info<<
"Extruding zones " << zoneNames
1463 <<
" on mesh " << regionName
1464 <<
" into shell mesh " << shellRegionName
1469 Info<<
"Extruding faceSets " << zoneNames
1470 <<
" on mesh " << regionName
1471 <<
" into shell mesh " << shellRegionName
1475 if (shellRegionName == regionName)
1478 <<
"Cannot extrude into same region as mesh." << endl
1479 <<
"Mesh region : " << regionName << endl
1480 <<
"Shell region : " << shellRegionName
1487 if (oneDNonManifoldEdges)
1489 Info<<
"Extruding as 1D columns with sides in patch type " 1491 <<
" and connected points (except on non-manifold areas)." 1496 Info<<
"Extruding as 1D columns with sides in patch type " 1498 <<
" and duplicated points (overlapping volumes)." 1505 createDummyFvMeshFiles(mesh, shellRegionName);
1512 meshInstance = runTime.timeName();
1516 meshInstance = oldInstance;
1518 Info<<
"Writing meshes to " << meshInstance <<
nl <<
endl;
1532 boolList isInternal(zoneNames.size(),
false);
1548 meshZoneID.
setSize(zoneNames.size());
1551 meshZoneID[i] = faceZones.
findZoneID(zoneNames[i]);
1552 if (meshZoneID[i] == -1)
1555 <<
"Cannot find zone " << zoneNames[i] << endl
1556 <<
"Valid zones are " << faceZones.
names()
1561 label nExtrudeFaces = 0;
1564 nExtrudeFaces += faceZones[meshZoneID[i]].
size();
1566 extrudeMeshFaces.setSize(nExtrudeFaces);
1567 zoneFaces.
setSize(nExtrudeFaces);
1568 zoneID.
setSize(nExtrudeFaces);
1569 zoneFlipMap.
setSize(nExtrudeFaces);
1573 const faceZone& fz = faceZones[meshZoneID[i]];
1577 extrudeMeshFaces[nExtrudeFaces] = fz[j];
1578 zoneFaces[nExtrudeFaces] = fzp[j];
1579 zoneID[nExtrudeFaces] = i;
1580 zoneFlipMap[nExtrudeFaces] = fz.
flipMap()[j];
1585 isInternal[i] =
true;
1593 if (zoneShadowNames.
size())
1596 forAll(zoneShadowNames, i)
1598 zoneShadowIDs[i] = faceZones.
findZoneID(zoneShadowNames[i]);
1599 if (zoneShadowIDs[i] == -1)
1602 <<
"Cannot find zone " << zoneShadowNames[i] << endl
1603 <<
"Valid zones are " << faceZones.
names()
1608 label nShadowFaces = 0;
1611 nShadowFaces += faceZones[zoneShadowIDs[i]].
size();
1614 extrudeMeshShadowFaces.
setSize(nShadowFaces);
1615 zoneShadowFlipMap.
setSize(nShadowFaces);
1616 zoneShadowID.
setSize(nShadowFaces);
1621 const faceZone& fz = faceZones[zoneShadowIDs[i]];
1624 extrudeMeshShadowFaces[nShadowFaces] = fz[j];
1625 zoneShadowFlipMap[nShadowFaces] = fz.
flipMap()[j];
1626 zoneShadowID[nShadowFaces] = i;
1634 meshZoneID.setSize(zoneNames.size(), -1);
1639 Info<<
"Loading faceSet " << zoneNames[i] <<
endl;
1640 zones.set(i,
new faceSet(mesh, zoneNames[i]));
1645 label nExtrudeFaces = 0;
1648 nExtrudeFaces += zones[i].size();
1650 extrudeMeshFaces.setSize(nExtrudeFaces);
1651 zoneFaces.
setSize(nExtrudeFaces);
1652 zoneID.
setSize(nExtrudeFaces);
1653 zoneFlipMap.
setSize(nExtrudeFaces);
1661 label facei = iter.key();
1665 <<
"faceSet " << fz.
name()
1666 <<
"contains internal faces." 1667 <<
" This is not permitted." 1670 extrudeMeshFaces[nExtrudeFaces] = facei;
1671 zoneFaces[nExtrudeFaces] = mesh.
faces()[facei];
1672 zoneID[nExtrudeFaces] = i;
1673 zoneFlipMap[nExtrudeFaces] =
false;
1678 isInternal[i] =
true;
1688 if (zoneShadowNames.
size())
1690 zoneShadowIDs.
setSize(zoneShadowNames.
size(), -1);
1691 forAll(zoneShadowNames, i)
1693 shadowZones.set(i,
new faceSet(mesh, zoneShadowNames[i]));
1696 label nShadowFaces = 0;
1699 nShadowFaces += shadowZones[i].size();
1702 if (nExtrudeFaces != nShadowFaces)
1705 <<
"Extruded faces " << nExtrudeFaces << endl
1706 <<
"is different from shadow faces. " << nShadowFaces
1707 <<
"This is not permitted " << endl
1711 extrudeMeshShadowFaces.
setSize(nShadowFaces);
1712 zoneShadowFlipMap.
setSize(nShadowFaces);
1713 zoneShadowID.
setSize(nShadowFaces);
1718 const faceSet& fz = shadowZones[i];
1721 label facei = iter.key();
1725 <<
"faceSet " << fz.
name()
1726 <<
"contains internal faces." 1727 <<
" This is not permitted." 1730 extrudeMeshShadowFaces[nShadowFaces] = facei;
1731 zoneShadowFlipMap[nShadowFaces] =
false;
1732 zoneShadowID[nShadowFaces] = i;
1745 checkZoneInside(mesh, zoneNames, zoneID, extrudeMeshFaces, isInternal);
1754 Info<<
"extrudePatch :" 1755 <<
" faces:" << extrudePatch.size()
1756 <<
" points:" << extrudePatch.
nPoints()
1757 <<
" edges:" << extrudePatch.
nEdges()
1775 const globalIndex globalExtrudeFaces(extrudePatch.size());
1792 extrudeEdgeGlobalFaces,
1806 extrudeEdgeFacesMap,
1807 extrudeEdgeGlobalFaces,
1821 if (!isA<processorPolyPatch>(patches[patchi]))
1823 label newPatchi = regionPatches.size();
1824 regionPatches.append
1826 patches[patchi].
clone 1856 interRegionTopPatch,
1857 interRegionBottomPatch
1873 newPatches.
append(patches[patchi].
clone(patches).ptr());
1889 interMeshBottomPatch
1894 mesh.removeFvBoundary();
1895 mesh.addFvPatches(newPatches,
true);
1902 labelList extrudeTopPatchID(extrudePatch.size());
1903 labelList extrudeBottomPatchID(extrudePatch.size());
1907 extrudeTopPatchID[facei] = interRegionTopPatch[zoneID[facei]];
1908 extrudeBottomPatchID[facei] = interRegionBottomPatch[zoneID[facei]];
1916 labelList zoneSidePatch(zoneNames.size(), 0);
1918 labelList zoneZonePatch_min(zoneNames.size()*zoneNames.size(), 0);
1920 labelList zoneZonePatch_max(zoneNames.size()*zoneNames.size(), 0);
1931 extrudeEdgeGlobalFaces,
1965 extrudeEdgeFacesMap,
1966 extrudeEdgeGlobalFaces,
2016 const labelList& eFaces = edgeFaces[edgeI];
2018 labelList& ePatches = extrudeEdgePatches[edgeI];
2025 ePatches[i] = zoneSidePatch[zoneID[eFaces[i]]];
2028 if (oneDNonManifoldEdges)
2033 if (eFaces.
size() != 2)
2035 nonManifoldEdge[edgeI] = 1;
2040 nonManifoldEdge[edgeI] = 1;
2043 else if (eFaces.
size() == 2)
2045 label zone0 = zoneID[eFaces[0]];
2046 label zone1 = zoneID[eFaces[1]];
2052 label index = minZone*zoneNames.size()+maxZone;
2054 ePatches.
setSize(eFaces.size());
2056 if (zone0 == minZone)
2058 ePatches[0] = zoneZonePatch_min[index];
2059 ePatches[1] = zoneZonePatch_max[index];
2063 ePatches[0] = zoneZonePatch_max[index];
2064 ePatches[1] = zoneZonePatch_min[index];
2067 nonManifoldEdge[edgeI] = 1;
2070 else if (sidePatchID[edgeI] != -1)
2073 ePatches.
setSize(eFaces.size());
2076 ePatches[i] = sidePatchID[edgeI];
2081 label facei = findUncoveredPatchFace
2085 extrudeMeshEdges[edgeI]
2090 label newPatchi = findPatchID
2095 ePatches.
setSize(eFaces.size(), newPatchi);
2099 ePatches.
setSize(eFaces.size());
2102 ePatches[i] = zoneSidePatch[zoneID[eFaces[i]]];
2105 nonManifoldEdge[edgeI] = 1;
2133 forAll(pointLocalRegions, facei)
2136 const face& pRegions = pointLocalRegions[facei];
2139 localRegionPoints[pRegions[fp]] = f[fp];
2148 forAll(pointLocalRegions, facei)
2150 const face& pRegions = pointLocalRegions[facei];
2153 label localRegionI = pRegions[fp];
2154 localSum[localRegionI] += extrudePatch.
faceNormals()[facei];
2160 forAll(localSum, localRegionI)
2162 label globalRegionI = localToGlobalRegion[localRegionI];
2163 globalSum.insert(globalRegionI, localSum[localRegionI]);
2170 forAll(localToGlobalRegion, localRegionI)
2172 label globalRegionI = localToGlobalRegion[localRegionI];
2173 localRegionNormals[localRegionI] = globalSum[globalRegionI];
2175 localRegionNormals /=
mag(localRegionNormals);
2182 OFstream str(runTime.path()/
"localRegionNormals.obj");
2187 forAll(pointLocalRegions, facei)
2189 const face& f = extrudeFaces[facei];
2193 label region = pointLocalRegions[facei][fp];
2194 const point& pt = extrudePoints[f[fp]];
2201 pt+thickness*localRegionNormals[region]
2204 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
2212 forAll(firstDisp, regionI)
2219 localRegionPoints[regionI]
2222 const vector& n = localRegionNormals[regionI];
2223 firstDisp[regionI] = model()(regionPt,
n, 1) - regionPt;
2258 forAll(regionPatches, patchi)
2265 regionMesh.removeFvBoundary();
2266 regionMesh.addFvPatches(regionPatches,
true);
2274 model().expansionRatio(),
2277 extrudeBottomPatchID,
2291 forAll(localRegionPoints, regionI)
2293 label pointi = localRegionPoints[regionI];
2295 const vector& n = localRegionNormals[regionI];
2297 for (
label layerI = 1; layerI <= model().
nLayers(); layerI++)
2299 newPoints[meshPointi++] = model()(pt,
n, layerI);
2303 shellMap = meshMod.changeMesh
2328 if (isA<mappedWallPolyPatch>(pp))
2330 if (
findIndex(interRegionTopPatch, patchi) != -1)
2333 topOffsets[zoneI] = calcOffset(extrudePatch, extruder, pp);
2335 else if (
findIndex(interRegionBottomPatch, patchi) != -1)
2338 bottomOffsets[zoneI] = calcOffset(extrudePatch, extruder, pp);
2352 interRegionTopPatch,
2362 interRegionBottomPatch,
2369 deleteEmptyPatches(regionMesh);
2391 interMeshBottomPatch,
2407 "cellToPatchFaceAddressing",
2417 cellToPatchFaceAddressing.
note() =
"cell to patch face addressing";
2423 "faceToPatchFaceAddressing",
2433 faceToPatchFaceAddressing.
note() =
2434 "front/back face + turning index to patch face addressing";
2440 "faceToPatchEdgeAddressing",
2450 faceToPatchEdgeAddressing.
note() =
2451 "side face to patch edge addressing";
2457 "pointToPatchPointAddressing",
2467 pointToPatchPointAddressing.
note() =
2468 "point to patch point addressing";
2471 Info<<
"Writing mesh " << regionMesh.
name()
2477 && cellToPatchFaceAddressing.write()
2478 && faceToPatchFaceAddressing.write()
2479 && faceToPatchEdgeAddressing.write()
2480 && pointToPatchPointAddressing.write();
2485 <<
"Failed writing mesh " << regionMesh.
name()
2507 Info<<
"Reading patch face,edge centres : " 2508 << io.name() <<
" and patchEdgeCentres" <<
endl;
2510 extrudeGeometricProperties
2534 forAll(extrudeMeshFaces, zoneFacei)
2536 label meshFacei = extrudeMeshFaces[zoneFacei];
2537 label zoneI = zoneID[zoneFacei];
2538 bool flip = zoneFlipMap[zoneFacei];
2539 const face& f = mesh.
faces()[meshFacei];
2550 interMeshBottomPatch[zoneI],
2564 interMeshBottomPatch[zoneI],
2571 if (zoneShadowNames.
size() > 0)
2573 forAll(extrudeMeshFaces, zoneFacei)
2575 label meshFacei = extrudeMeshShadowFaces[zoneFacei];
2576 label zoneI = zoneShadowID[zoneFacei];
2577 bool flip = zoneShadowFlipMap[zoneFacei];
2578 const face& f = mesh.
faces()[meshFacei];
2589 interMeshTopPatch[zoneI],
2603 interMeshTopPatch[zoneI],
2613 forAll(extrudeMeshFaces, zoneFacei)
2615 label meshFacei = extrudeMeshFaces[zoneFacei];
2616 label zoneI = zoneID[zoneFacei];
2617 bool flip = zoneFlipMap[zoneFacei];
2618 const face& f = mesh.
faces()[meshFacei];
2633 interMeshTopPatch[zoneI],
2650 interMeshTopPatch[zoneI],
2659 addBafflesMap = meshMod.changeMesh(mesh,
false);
2670 if (addBafflesMap().hasMotionPoints())
2672 mesh.
setPoints(addBafflesMap().preMotionPoints());
2678 deleteEmptyPatches(mesh);
2680 Info<<
"Writing mesh " << mesh.
name()
2687 <<
"Failed writing mesh " << mesh.
name()
const fvPatchList & patches
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
label nPoints() const
Return number of points supporting patch faces.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
static void calcPointRegions(const globalMeshData &globalData, const primitiveFacePatch &patch, const PackedBoolList &nonManifoldEdge, const bool syncNonCollocated, faceList &pointGlobalRegions, faceList &pointLocalRegions, labelList &localToGlobalRegion)
Helper: calculate point regions. The point region is the.
autoPtr< IOobject > clone() const
Clone.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
label findZoneID(const word &zoneName) const
Find zone index given a name.
const word & executable() const
Name of executable without the path.
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
#define forAll(list, i)
Loop across all elements in list.
mode_t mode(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file mode.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
void removeFvBoundary()
Remove boundary patches. Warning: fvPatchFields hold ref to.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
virtual Ostream & write(const char)=0
Write character.
const word & name() const
Return name.
const word & name() const
Return name.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const fileName & facesInstance() const
Return the current instance directory for faces.
A face is a list of labels corresponding to mesh vertices.
A list of keyword definitions, which are a keyword followed by any number of values (e...
void addFvPatches(const List< polyPatch *> &, const bool validBoundary=true)
Add boundary patches. Constructor helper.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
virtual const labelList & faceNeighbour() const
Return face neighbour.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const labelListList & pointEdges() const
Templated form of IOobject providing type information for file reading and header type checking...
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
void size(const label)
Override size to be inconsistent with allocated storage.
const boolList & flipMap() const
Return face flip map.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static word newName(const label myProcNo, const label neighbProcNo)
Return the name of a processorPolyPatch.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
static bool master(const label communicator=0)
Am I the master process.
label findPatchID(const word &patchName) const
Find patch index given a name.
const labelList & faceToEdgeMap() const
From region side-face to patch edge. -1 for non-edge faces.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
Pre-declare related SubField type.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute data using default commsType.
IOdictionary systemDict(const word &dictName, const argList &args, const objectRegistry &ob, const word ®ionName=polyMesh::defaultRegion)
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
label size() const
Return number of elements in table.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
virtual const pointField & points() const
Return raw points.
Top level extrusion model class.
static void mapCombineScatter(const List< commsStruct > &comms, Container &Values, const int tag, const label comm)
Scatter data. Reverse of combineGather.
wordList names() const
Return a list of zone names.
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
string & note()
Return non-constant access to the optional note.
A list of faces which address into the list of points.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
face reverseFace() const
Return face with reverse direction.
vectorField pointField
pointField is a vectorField.
const fileName & pointsInstance() const
Return the current instance directory for points.
void topoChange(const polyTopoChangeMap &)
Update any locally stored mesh information.
const labelList & cellToFaceMap() const
From region cell to patch face. Consecutively added so.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
static autoPtr< extrudeModel > New(const dictionary &)
Select null constructed.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A class for handling words, derived from string.
label size() const
Return the number of elements in the list.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
wordList names() const
Return a list of patch names.
virtual const labelList & faceOwner() const
Return face owner.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
const labelList & faceToFaceMap() const
From region face to patch face. Contains turning index:
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
Creates mesh by extruding a patch.
const Field< PointType > & points() const
Return reference to global points.
static const word null
An empty word.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const labelListList & edgeFaces() const
Return edge-face addressing.
const globalMeshData & globalData() const
Return parallel info.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
static const label labelMax
List< label > labelList
A List of labels.
static void mapCombineGather(const List< commsStruct > &comms, Container &Values, const CombineOp &cop, const int tag, const label comm)
virtual const faceList & faces() const
Return raw faces.
const Field< PointType > & faceNormals() const
Return face normals for patch.
const vectorField & cellCentres() const
errorManip< error > abort(error &err)
const word & system() const
Return system name.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order. Return.
label nEdges() const
Return number of edges in patch.
OFstream which keeps track of vertices.
const Time & time() const
Return time.
scalar sumThickness(const label layer) const
Helper: calculate cumulative relative thickness for layer.
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
static const NamedEnum< sampleMode, 6 > sampleModeNames_
word name(const complex &)
Return a string representation of a complex.
void setInstance(const fileName &)
Set the instance for mesh files.
label size() const
Return the number of elements in the UPtrList.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const indirectPrimitivePatch & coupledPatch() const
Return patch of all coupled faces.
const vectorField & faceCentres() const
void setSize(const label)
Reset size of List.
label toGlobal(const label i) const
From local to global.
Class containing processor-to-processor mapping information.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define WarningInFunction
Report a warning using Foam::Warning.
const labelList & pointToPointMap() const
From region point to patch point.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
labelList meshEdges(const edgeList &allEdges, const labelListList &cellEdges, const labelList &faceCells) const
Return labels of patch edges in the global edge list using.
prefixOSstream Pout(cout, "Pout")
const meshFaceZones & faceZones() const
Return face zones.
const List< FaceType > & localFaces() const
Return patch faces addressing into local point list.
Mesh data needed to do the Finite Volume discretisation.
A List with indirect addressing.
Direct mesh changes based on v1.3 polyTopoChange syntax.
sampleMode
Mesh items to sample.
label start() const
Return start label of this patch in the polyMesh face list.
void set(entry *)
Assign a new entry, overwrite any existing entry.
dimensioned< scalar > mag(const dimensioned< Type > &)
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Return a pointer to a new patch created on freestore from.
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.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Mesh consisting of general polyhedral cells.
A subset of mesh faces organised as a primitive patch.
static void addNote(const string &)
Add extra notes for the usage information.
virtual bool write(const bool write=true) const
Write using setting from DB.
A class for managing temporary objects.
A patch is a list of labels that address the faces in the global face list.
virtual void setPoints(const pointField &)
Reset the points.
T & last()
Return the last element of the list.
label size() const
Return the number of elements in the UList.
Foam::argList args(argc, argv)
fileName path() const
Return path.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
A primitive field of type <T> with automated input and output.
const labelListList & edgeFaces() const
static const label labelMin
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
A HashTable to objects of type <T> with a label key.
const vectorField::subField faceCentres() const
Return face centres.