130 using namespace Foam;
138 if (newPatches[i]->
name() == name)
147 template<
class PatchType>
151 const word& patchName,
155 label patchi = findPatchID(newPatches, patchName);
159 if (isA<PatchType>(*newPatches[patchi]))
167 <<
"Already have patch " << patchName
168 <<
" but of type " << newPatches[
patchi]->type()
174 patchi = newPatches.
size();
176 label startFacei = 0;
180 startFacei = pp.
start()+pp.size();
201 template<
class PatchType>
205 const word& patchName,
210 label patchi = findPatchID(newPatches, patchName);
214 if (isA<PatchType>(*newPatches[patchi]))
222 <<
"Already have patch " << patchName
223 <<
" but of type " << newPatches[
patchi]->type()
229 patchi = newPatches.
size();
231 label startFacei = 0;
235 startFacei = pp.
start()+pp.size();
239 patchDict.
set(
"type", PatchType::typeName);
240 patchDict.
set(
"nFaces", 0);
241 patchDict.
set(
"startFace", startFacei);
259 void deleteEmptyPatches(
fvMesh& mesh)
266 masterNames = patches.
names();
276 forAll(masterNames, masterI)
282 if (isA<processorPolyPatch>(patches[patchi]))
285 if (patches[patchi].size() == 0)
287 Pout<<
"Deleting processor patch " << patchi
290 oldToNew[
patchi] = --notUsedI;
294 oldToNew[
patchi] = usedI++;
302 Pout<<
"Deleting patch " << patchi
305 oldToNew[
patchi] = --notUsedI;
309 oldToNew[
patchi] = usedI++;
318 if (oldToNew[patchi] == -1)
322 if (patches[patchi].size() == 0)
324 Pout<<
"Deleting processor patch " << patchi
327 oldToNew[
patchi] = --notUsedI;
331 oldToNew[
patchi] = usedI++;
340 void createDummyFvMeshFiles(
const polyMesh& mesh,
const word& regionName)
355 Info<<
"Testing:" << io.objectPath() <<
endl;
359 Info<<
"Writing dummy " << regionName/io.name() <<
endl;
362 dummyDict.
add(
"divSchemes", divDict);
364 dummyDict.
add(
"gradSchemes", gradDict);
366 dummyDict.
add(
"laplacianSchemes", laplDict);
375 mesh.time().system(),
385 Info<<
"Writing dummy " << regionName/io.name() <<
endl;
407 Info<<
"Zone " << zoneNames[i] <<
" has internal faces" <<
endl;
411 Info<<
"Zone " << zoneNames[i] <<
" has boundary faces" <<
endl;
415 forAll(extrudeMeshFaces, i)
417 label facei = extrudeMeshFaces[i];
418 label zoneI = zoneID[i];
422 <<
"Zone " << zoneNames[zoneI]
423 <<
" is not consistently all internal or all boundary faces." 424 <<
" Face " << facei <<
" at " << mesh.
faceCentres()[facei]
425 <<
" is the first occurrence." 479 const labelList& eFaces = edgeFaces[edgeI];
482 labelList& globalEFaces = globalEdgeFaces[edgeI];
486 globalEFaces[i] = globalFaces.
toGlobal(eFaces[i]);
500 return globalEdgeFaces;
505 label findUncoveredPatchFace
509 const label meshEdgeI
514 forAll(extrudeMeshFaces, i)
516 extrudeFaceSet.insert(extrudeMeshFaces[i]);
523 label facei = eFaces[i];
529 && !pbm[patchi].coupled()
530 && !extrudeFaceSet.found(facei)
541 label findUncoveredCyclicPatchFace
545 const label meshEdgeI
550 forAll(extrudeMeshFaces, i)
552 extrudeFaceSet.insert(extrudeMeshFaces[i]);
559 label facei = eFaces[i];
565 && isA<cyclicPolyPatch>(pbm[patchi])
566 && !extrudeFaceSet.found(facei)
577 void calcEdgeMinMaxZone
598 forAll(extrudeEdgeGlobalFaces, edgeI)
600 const labelList& eFaces = extrudeEdgeGlobalFaces[edgeI];
605 label zoneI = mappedZoneID[eFaces[i]];
606 minZoneID[edgeI] =
min(minZoneID[edgeI], zoneI);
607 maxZoneID[edgeI] =
max(maxZoneID[edgeI], zoneI);
635 void countExtrudePatches
660 if (eFaces.
size() == 2)
663 if (minZoneID[edgeI] != maxZoneID[edgeI])
665 zoneZonePatch[minZoneID[edgeI]*nZones+maxZoneID[edgeI]]++;
671 && extrudeEdgeGlobalFaces[edgeI].
size() == 2
675 if (minZoneID[edgeI] != maxZoneID[edgeI])
677 const edge& e = extrudePatch.
edges()[edgeI];
681 <<
"at " << pts[e[0]] << pts[e[1]]
682 <<
" is a coupled edge and in between two different zones " 683 << minZoneID[edgeI] <<
" and " << maxZoneID[edgeI] << endl
684 <<
" This is currently not supported." <<
endl;
686 zoneZonePatch[minZoneID[edgeI]*nZones+maxZoneID[edgeI]]++;
696 label facei = findUncoveredPatchFace
700 extrudeMeshEdges[edgeI]
705 zoneSidePatch[minZoneID[edgeI]]++;
718 void addCouplingPatches
721 const word& regionName,
722 const word& shellRegionName,
733 Pout<<
"Adding coupling patches:" <<
nl <<
nl 734 <<
"patchID\tpatch\ttype" <<
nl 735 <<
"-------\t-----\t----" 739 interRegionBottomPatch.
setSize(zoneNames.
size(), -1);
753 if (isInternal[zoneI])
755 interRegionTopPatch[zoneI] = addPatch<mappedWallPolyPatch>
761 Pout<< interRegionTopPatch[zoneI]
762 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->name()
763 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->type()
766 interRegionBottomPatch[zoneI] = addPatch<mappedWallPolyPatch>
769 interName +
"_bottom",
772 Pout<< interRegionBottomPatch[zoneI]
773 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->name()
774 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->type()
777 else if (zoneShadowNames.
size() == 0)
779 interRegionTopPatch[zoneI] = addPatch<polyPatch>
782 zoneNames[zoneI] +
"_top",
785 Pout<< interRegionTopPatch[zoneI]
786 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->name()
787 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->type()
790 interRegionBottomPatch[zoneI] = addPatch<mappedWallPolyPatch>
796 Pout<< interRegionBottomPatch[zoneI]
797 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->name()
798 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->type()
803 interRegionTopPatch[zoneI] = addPatch<mappedWallPolyPatch>
806 zoneShadowNames[zoneI] +
"_top",
809 Pout<< interRegionTopPatch[zoneI]
810 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->name()
811 <<
'\t' << newPatches[interRegionTopPatch[zoneI]]->type()
814 interRegionBottomPatch[zoneI] = addPatch<mappedWallPolyPatch>
820 Pout<< interRegionBottomPatch[zoneI]
821 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->name()
822 <<
'\t' << newPatches[interRegionBottomPatch[zoneI]]->type()
826 Pout<<
"Added " << newPatches.
size()-nOldPatches
827 <<
" inter-region patches." <<
nl 834 void addCoupledPatches
857 forAll(extrudeEdgeGlobalFaces, edgeI)
859 const labelList& eFaces = extrudeEdgeGlobalFaces[edgeI];
864 label proci = procID[eFaces[i]];
865 minProcID[edgeI] =
min(minProcID[edgeI], proci);
866 maxProcID[edgeI] =
max(maxProcID[edgeI], proci);
887 Pout<<
"Adding processor or cyclic patches:" <<
nl <<
nl 888 <<
"patchID\tpatch" <<
nl 902 && extrudeEdgeGlobalFaces[edgeI].
size() == 2
906 label nbrProci = minProcID[edgeI];
909 nbrProci = maxProcID[edgeI];
918 label facei = findUncoveredCyclicPatchFace
922 extrudeMeshEdges[edgeI]
929 label newPatchi = findPatchID
935 sidePatchID[edgeI] = newPatchi;
940 <<
"Unable to determine coupled patch addressing" 952 sidePatchID[edgeI] = findPatchID(newPatches, name);
954 if (sidePatchID[edgeI] == -1)
958 patchDict.
add(
"neighbProcNo", nbrProci);
960 sidePatchID[edgeI] = addPatch<processorPolyPatch>
968 Pout<< sidePatchID[edgeI] <<
'\t' << name
974 Pout<<
"Added " << newPatches.
size()-nOldPatches
975 <<
" coupled patches." <<
nl 980 void addZoneSidePatches
984 const word& oneDPolyPatchType,
990 Pout<<
"Adding patches for sides on zones:" <<
nl <<
nl 991 <<
"patchID\tpatch" <<
nl 997 forAll(zoneSidePatch, zoneI)
1003 if (oneDPolyPatchType ==
"empty")
1005 patchName =
"oneDEmptyPatch";
1006 zoneSidePatch[zoneI] = addPatch<emptyPolyPatch>
1013 else if (oneDPolyPatchType ==
"wedge")
1015 patchName =
"oneDWedgePatch";
1016 zoneSidePatch[zoneI] = addPatch<wedgePolyPatch>
1026 <<
"Type " << oneDPolyPatchType <<
" does not exist " 1030 Pout<< zoneSidePatch[zoneI] <<
'\t' << patchName <<
nl;
1032 else if (zoneSidePatch[zoneI] > 0)
1034 word patchName = zoneNames[zoneI] +
"_" +
"side";
1036 zoneSidePatch[zoneI] = addPatch<polyPatch>
1043 Pout<< zoneSidePatch[zoneI] <<
'\t' << patchName <<
nl;
1046 Pout<<
"Added " << newPatches.
size()-nOldPatches <<
" zone-side patches." 1067 point patchFc = extrudePatch[patchFacei].centre
1071 offsets[i] = patchFc - fc[i];
1077 void setCouplingInfo
1081 const word& sampleRegion,
1094 forAll(zoneToPatch, zoneI)
1096 label patchi = zoneToPatch[zoneI];
1102 if (isA<mappedWallPolyPatch>(pp))
1120 forAll(newPatches, patchi)
1122 if (!newPatches[patchi])
1134 void extrudeGeometricProperties
1248 faceCentres[facei] = model
1250 patchFaceCentres[patchFacei],
1268 patchEdgeCentres[patchEdgeI],
1269 patchEdgeNormals[patchEdgeI],
1275 patchEdgeCentres[patchEdgeI],
1276 patchEdgeNormals[patchEdgeI],
1281 faceCentres[facei] = 0.5*(pt0+pt1);
1310 patchFaceCentres[patchFacei],
1316 patchFaceCentres[patchFacei],
1322 cellCentres[celli] = 0.5*(pt0+pt1);
1332 forAll(faceCentres, facei)
1334 Pout<<
"Model :" << faceCentres[facei] << endl
1345 forAll(cellCentres, celli)
1347 Pout<<
"Model :" << cellCentres[celli] << endl
1362 Info<<
"Writing geometric properties for mesh " << regionMesh.
name()
1366 bool ok = faceCentres.
write() && cellCentres.
write();
1371 <<
"Failed writing " << faceCentres.objectPath()
1372 <<
" and " << cellCentres.objectPath()
1380 int main(
int argc,
char *argv[])
1399 <<
"Patches are not synchronised on all processors." 1400 <<
" Per processor patches " << allNames
1421 const word shellRegionName(dict.
lookup(
"region"));
1427 bool hasZones = dict.
found(
"faceZones");
1430 dict.
lookup(
"faceZones") >> zoneNames;
1434 if (dict.
found(
"faceSets"))
1437 <<
"Please supply faces to extrude either through 'faceZones'" 1438 <<
" or 'faceSets' entry. Found both." 1444 dict.
lookup(
"faceSets") >> zoneNames;
1453 Switch oneDNonManifoldEdges(
false);
1454 word oneDPatchType(emptyPolyPatch::typeName);
1458 dict.
lookup(
"oneDPolyPatchType") >> oneDPatchType;
1465 Info<<
"Extruding zones " << zoneNames
1466 <<
" on mesh " << regionName
1467 <<
" into shell mesh " << shellRegionName
1472 Info<<
"Extruding faceSets " << zoneNames
1473 <<
" on mesh " << regionName
1474 <<
" into shell mesh " << shellRegionName
1478 if (shellRegionName == regionName)
1481 <<
"Cannot extrude into same region as mesh." << endl
1482 <<
"Mesh region : " << regionName << endl
1483 <<
"Shell region : " << shellRegionName
1490 if (oneDNonManifoldEdges)
1492 Info<<
"Extruding as 1D columns with sides in patch type " 1494 <<
" and connected points (except on non-manifold areas)." 1499 Info<<
"Extruding as 1D columns with sides in patch type " 1501 <<
" and duplicated points (overlapping volumes)." 1508 createDummyFvMeshFiles(mesh, shellRegionName);
1519 meshInstance = oldInstance;
1521 Info<<
"Writing meshes to " << meshInstance <<
nl <<
endl;
1535 boolList isInternal(zoneNames.size(),
false);
1551 meshZoneID.
setSize(zoneNames.size());
1554 meshZoneID[i] = faceZones.
findZoneID(zoneNames[i]);
1555 if (meshZoneID[i] == -1)
1558 <<
"Cannot find zone " << zoneNames[i] << endl
1559 <<
"Valid zones are " << faceZones.
names()
1564 label nExtrudeFaces = 0;
1567 nExtrudeFaces += faceZones[meshZoneID[i]].
size();
1569 extrudeMeshFaces.setSize(nExtrudeFaces);
1570 zoneFaces.
setSize(nExtrudeFaces);
1571 zoneID.
setSize(nExtrudeFaces);
1572 zoneFlipMap.
setSize(nExtrudeFaces);
1576 const faceZone& fz = faceZones[meshZoneID[i]];
1580 extrudeMeshFaces[nExtrudeFaces] = fz[j];
1581 zoneFaces[nExtrudeFaces] = fzp[j];
1582 zoneID[nExtrudeFaces] = i;
1583 zoneFlipMap[nExtrudeFaces] = fz.
flipMap()[j];
1588 isInternal[i] =
true;
1596 if (zoneShadowNames.
size())
1599 forAll(zoneShadowNames, i)
1601 zoneShadowIDs[i] = faceZones.
findZoneID(zoneShadowNames[i]);
1602 if (zoneShadowIDs[i] == -1)
1605 <<
"Cannot find zone " << zoneShadowNames[i] << endl
1606 <<
"Valid zones are " << faceZones.
names()
1611 label nShadowFaces = 0;
1614 nShadowFaces += faceZones[zoneShadowIDs[i]].
size();
1617 extrudeMeshShadowFaces.
setSize(nShadowFaces);
1618 zoneShadowFlipMap.
setSize(nShadowFaces);
1619 zoneShadowID.
setSize(nShadowFaces);
1624 const faceZone& fz = faceZones[zoneShadowIDs[i]];
1627 extrudeMeshShadowFaces[nShadowFaces] = fz[j];
1628 zoneShadowFlipMap[nShadowFaces] = fz.
flipMap()[j];
1629 zoneShadowID[nShadowFaces] = i;
1637 meshZoneID.
setSize(zoneNames.size(), -1);
1642 Info<<
"Loading faceSet " << zoneNames[i] <<
endl;
1643 zones.set(i,
new faceSet(mesh, zoneNames[i]));
1648 label nExtrudeFaces = 0;
1651 nExtrudeFaces += zones[i].size();
1653 extrudeMeshFaces.setSize(nExtrudeFaces);
1654 zoneFaces.
setSize(nExtrudeFaces);
1655 zoneID.
setSize(nExtrudeFaces);
1656 zoneFlipMap.
setSize(nExtrudeFaces);
1664 label facei = iter.key();
1668 <<
"faceSet " << fz.
name()
1669 <<
"contains internal faces." 1670 <<
" This is not permitted." 1673 extrudeMeshFaces[nExtrudeFaces] = facei;
1674 zoneFaces[nExtrudeFaces] = mesh.
faces()[facei];
1675 zoneID[nExtrudeFaces] = i;
1676 zoneFlipMap[nExtrudeFaces] =
false;
1681 isInternal[i] =
true;
1691 if (zoneShadowNames.
size())
1693 zoneShadowIDs.
setSize(zoneShadowNames.
size(), -1);
1694 forAll(zoneShadowNames, i)
1696 shadowZones.set(i,
new faceSet(mesh, zoneShadowNames[i]));
1699 label nShadowFaces = 0;
1702 nShadowFaces += shadowZones[i].size();
1705 if (nExtrudeFaces != nShadowFaces)
1708 <<
"Extruded faces " << nExtrudeFaces << endl
1709 <<
"is different from shadow faces. " << nShadowFaces
1710 <<
"This is not permitted " << endl
1714 extrudeMeshShadowFaces.
setSize(nShadowFaces);
1715 zoneShadowFlipMap.
setSize(nShadowFaces);
1716 zoneShadowID.
setSize(nShadowFaces);
1721 const faceSet& fz = shadowZones[i];
1724 label facei = iter.key();
1728 <<
"faceSet " << fz.
name()
1729 <<
"contains internal faces." 1730 <<
" This is not permitted." 1733 extrudeMeshShadowFaces[nShadowFaces] = facei;
1734 zoneShadowFlipMap[nShadowFaces] =
false;
1735 zoneShadowID[nShadowFaces] = i;
1748 checkZoneInside(mesh, zoneNames, zoneID, extrudeMeshFaces, isInternal);
1757 Info<<
"extrudePatch :" 1758 <<
" faces:" << extrudePatch.size()
1759 <<
" points:" << extrudePatch.
nPoints()
1760 <<
" edges:" << extrudePatch.
nEdges()
1778 const globalIndex globalExtrudeFaces(extrudePatch.size());
1795 extrudeEdgeGlobalFaces,
1809 extrudeEdgeFacesMap,
1810 extrudeEdgeGlobalFaces,
1824 if (!isA<processorPolyPatch>(patches[patchi]))
1826 label newPatchi = regionPatches.size();
1827 regionPatches.append
1829 patches[patchi].
clone 1859 interRegionTopPatch,
1860 interRegionBottomPatch
1876 newPatches.
append(patches[patchi].
clone(patches).ptr());
1892 interMeshBottomPatch
1897 mesh.removeFvBoundary();
1898 mesh.addFvPatches(newPatches,
true);
1905 labelList extrudeTopPatchID(extrudePatch.size());
1906 labelList extrudeBottomPatchID(extrudePatch.size());
1910 extrudeTopPatchID[facei] = interRegionTopPatch[zoneID[facei]];
1911 extrudeBottomPatchID[facei] = interRegionBottomPatch[zoneID[facei]];
1919 labelList zoneSidePatch(zoneNames.size(), 0);
1921 labelList zoneZonePatch_min(zoneNames.size()*zoneNames.size(), 0);
1923 labelList zoneZonePatch_max(zoneNames.size()*zoneNames.size(), 0);
1934 extrudeEdgeGlobalFaces,
1968 extrudeEdgeFacesMap,
1969 extrudeEdgeGlobalFaces,
2019 const labelList& eFaces = edgeFaces[edgeI];
2021 labelList& ePatches = extrudeEdgePatches[edgeI];
2028 ePatches[i] = zoneSidePatch[zoneID[eFaces[i]]];
2031 if (oneDNonManifoldEdges)
2036 if (eFaces.
size() != 2)
2038 nonManifoldEdge[edgeI] = 1;
2043 nonManifoldEdge[edgeI] = 1;
2046 else if (eFaces.
size() == 2)
2048 label zone0 = zoneID[eFaces[0]];
2049 label zone1 = zoneID[eFaces[1]];
2055 label index = minZone*zoneNames.size()+maxZone;
2057 ePatches.
setSize(eFaces.size());
2059 if (zone0 == minZone)
2061 ePatches[0] = zoneZonePatch_min[index];
2062 ePatches[1] = zoneZonePatch_max[index];
2066 ePatches[0] = zoneZonePatch_max[index];
2067 ePatches[1] = zoneZonePatch_min[index];
2070 nonManifoldEdge[edgeI] = 1;
2073 else if (sidePatchID[edgeI] != -1)
2076 ePatches.
setSize(eFaces.size());
2079 ePatches[i] = sidePatchID[edgeI];
2084 label facei = findUncoveredPatchFace
2088 extrudeMeshEdges[edgeI]
2093 label newPatchi = findPatchID
2098 ePatches.
setSize(eFaces.size(), newPatchi);
2102 ePatches.
setSize(eFaces.size());
2105 ePatches[i] = zoneSidePatch[zoneID[eFaces[i]]];
2108 nonManifoldEdge[edgeI] = 1;
2136 forAll(pointLocalRegions, facei)
2139 const face& pRegions = pointLocalRegions[facei];
2142 localRegionPoints[pRegions[fp]] = f[fp];
2151 forAll(pointLocalRegions, facei)
2153 const face& pRegions = pointLocalRegions[facei];
2156 label localRegionI = pRegions[fp];
2157 localSum[localRegionI] += extrudePatch.
faceNormals()[facei];
2163 forAll(localSum, localRegionI)
2165 label globalRegionI = localToGlobalRegion[localRegionI];
2166 globalSum.insert(globalRegionI, localSum[localRegionI]);
2173 forAll(localToGlobalRegion, localRegionI)
2175 label globalRegionI = localToGlobalRegion[localRegionI];
2176 localRegionNormals[localRegionI] = globalSum[globalRegionI];
2178 localRegionNormals /=
mag(localRegionNormals);
2190 forAll(pointLocalRegions, facei)
2192 const face& f = extrudeFaces[facei];
2196 label region = pointLocalRegions[facei][fp];
2197 const point& pt = extrudePoints[f[fp]];
2204 pt+thickness*localRegionNormals[region]
2207 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
2215 forAll(firstDisp, regionI)
2222 localRegionPoints[regionI]
2225 const vector& n = localRegionNormals[regionI];
2226 firstDisp[regionI] = model()(regionPt,
n, 1) - regionPt;
2261 forAll(regionPatches, patchi)
2268 regionMesh.removeFvBoundary();
2269 regionMesh.addFvPatches(regionPatches,
true);
2277 model().expansionRatio(),
2280 extrudeBottomPatchID,
2294 forAll(localRegionPoints, regionI)
2296 label pointi = localRegionPoints[regionI];
2298 const vector& n = localRegionNormals[regionI];
2300 for (
label layerI = 1; layerI <= model().
nLayers(); layerI++)
2302 newPoints[meshPointi++] = model()(pt,
n, layerI);
2306 shellMap = meshMod.changeMesh
2331 if (isA<mappedWallPolyPatch>(pp))
2333 if (
findIndex(interRegionTopPatch, patchi) != -1)
2336 topOffsets[zoneI] = calcOffset(extrudePatch, extruder, pp);
2338 else if (
findIndex(interRegionBottomPatch, patchi) != -1)
2341 bottomOffsets[zoneI] = calcOffset(extrudePatch, extruder, pp);
2355 interRegionTopPatch,
2365 interRegionBottomPatch,
2372 deleteEmptyPatches(regionMesh);
2394 interMeshBottomPatch,
2410 "cellToPatchFaceAddressing",
2420 cellToPatchFaceAddressing.
note() =
"cell to patch face addressing";
2426 "faceToPatchFaceAddressing",
2436 faceToPatchFaceAddressing.
note() =
2437 "front/back face + turning index to patch face addressing";
2443 "faceToPatchEdgeAddressing",
2453 faceToPatchEdgeAddressing.
note() =
2454 "side face to patch edge addressing";
2460 "pointToPatchPointAddressing",
2470 pointToPatchPointAddressing.
note() =
2471 "point to patch point addressing";
2474 Info<<
"Writing mesh " << regionMesh.
name()
2480 && cellToPatchFaceAddressing.write()
2481 && faceToPatchFaceAddressing.write()
2482 && faceToPatchEdgeAddressing.write()
2483 && pointToPatchPointAddressing.write();
2488 <<
"Failed writing mesh " << regionMesh.
name()
2509 Info<<
"Reading patch face,edge centres : " 2510 << io.name() <<
" and patchEdgeCentres" <<
endl;
2512 extrudeGeometricProperties
2536 forAll(extrudeMeshFaces, zoneFacei)
2538 label meshFacei = extrudeMeshFaces[zoneFacei];
2539 label zoneI = zoneID[zoneFacei];
2540 bool flip = zoneFlipMap[zoneFacei];
2541 const face& f = mesh.
faces()[meshFacei];
2552 interMeshBottomPatch[zoneI],
2566 interMeshBottomPatch[zoneI],
2573 if (zoneShadowNames.
size() > 0)
2575 forAll(extrudeMeshFaces, zoneFacei)
2577 label meshFacei = extrudeMeshShadowFaces[zoneFacei];
2578 label zoneI = zoneShadowID[zoneFacei];
2579 bool flip = zoneShadowFlipMap[zoneFacei];
2580 const face& f = mesh.
faces()[meshFacei];
2591 interMeshTopPatch[zoneI],
2605 interMeshTopPatch[zoneI],
2615 forAll(extrudeMeshFaces, zoneFacei)
2617 label meshFacei = extrudeMeshFaces[zoneFacei];
2618 label zoneI = zoneID[zoneFacei];
2619 bool flip = zoneFlipMap[zoneFacei];
2620 const face& f = mesh.
faces()[meshFacei];
2635 interMeshTopPatch[zoneI],
2652 interMeshTopPatch[zoneI],
2661 addBafflesMap = meshMod.changeMesh(mesh,
false);
2672 if (addBafflesMap().hasMotionPoints())
2674 mesh.
movePoints(addBafflesMap().preMotionPoints());
2680 deleteEmptyPatches(mesh);
2682 Info<<
"Writing mesh " << mesh.
name()
2689 <<
"Failed writing mesh " << mesh.
name()
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.
const word & executable() const
Name of executable without the path.
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
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)
fileName path() const
Return path.
void removeFvBoundary()
Remove boundary patches. Warning: fvPatchFields hold ref to.
virtual Ostream & write(const char)=0
Write character.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
const word & name() const
Return name.
const faceZoneMesh & faceZones() const
Return face zone mesh.
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...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void addFvPatches(const List< polyPatch *> &, const bool validBoundary=true)
Add boundary patches. Constructor helper.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual const labelList & faceNeighbour() const
Return face neighbour.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute data using default commsType.
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
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.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
Pre-declare related SubField type.
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.
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.
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...
label findZoneID(const word &zoneName) const
Find zone index given a name.
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...
virtual void updateMesh(const mapPolyMesh &mpm)
Update the mesh corresponding to given map.
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.
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.
const word dictName("particleTrackDict")
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
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
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.
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.
void updateMesh(const mapPolyMesh &)
Update any locally stored mesh information.
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,.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
static const NamedEnum< sampleMode, 6 > sampleModeNames_
word name(const complex &)
Return a string representation of a complex.
IOobject dictIO(dictName, runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE)
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.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
Class containing processor-to-processor mapping information.
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 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.
wordList names() const
Return a list of zone names.
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.
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)
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.