134 forAll(patchesToRename, i)
136 label patchi = patchesToRename[i];
139 if (isA<coupledPolyPatch>(pp))
142 <<
"Encountered coupled patch " << pp.
name()
143 <<
". Will only rename the patch itself,"
144 <<
" not any referred patches."
145 <<
" This might have to be done by hand."
149 pp.
name() = prefix +
'_' + pp.
name();
156template<
class GeoField>
170 mesh.objectRegistry::lookupClass<GeoField>()
174 const GeoField&
fld = *iter.val();
180 fvMeshSubset::interpolate
192 forAll(tSubFld().boundaryField(), patchi)
194 if (addedPatches.
found(patchi))
196 tSubFld.ref().boundaryFieldRef()[patchi] ==
197 typename GeoField::value_type(Zero);
202 GeoField* subFld = tSubFld.ptr();
203 subFld->rename(
fld.name());
204 subFld->writeOpt(IOobject::AUTO_WRITE);
210template<
class GeoField>
211void subsetSurfaceFields
224 mesh.objectRegistry::lookupClass<GeoField>()
228 const GeoField&
fld = *iter.val();
234 fvMeshSubset::interpolate
246 forAll(tSubFld().boundaryField(), patchi)
248 if (addedPatches.
found(patchi))
250 tSubFld.ref().boundaryFieldRef()[patchi] ==
251 typename GeoField::value_type(Zero);
256 GeoField* subFld = tSubFld.ptr();
257 subFld->rename(
fld.name());
258 subFld->writeOpt(IOobject::AUTO_WRITE);
269 if (cellRegion[celli] != regionI)
271 nonRegionCells.append(celli);
274 return nonRegionCells.shrink();
282 const label ownRegion,
283 const label neiRegion,
289 min(ownRegion, neiRegion),
290 max(ownRegion, neiRegion)
298 auto zoneIter = iter().find(
zoneID);
299 if (zoneIter.found())
322void getInterfaceSizes
325 const bool useFaceZones,
345 label ownRegion = cellRegion[
mesh.faceOwner()[facei]];
346 label neiRegion = cellRegion[
mesh.faceNeighbour()[facei]];
348 if (ownRegion != neiRegion)
353 (useFaceZones ?
mesh.faceZones().whichZone(facei) : -1),
369 label celli =
mesh.faceOwner()[i+
mesh.nInternalFaces()];
370 coupledRegion[i] = cellRegion[celli];
372 syncTools::swapBoundaryFaceList(
mesh, coupledRegion);
376 label facei = i+
mesh.nInternalFaces();
377 label ownRegion = cellRegion[
mesh.faceOwner()[facei]];
378 label neiRegion = coupledRegion[i];
380 if (ownRegion != neiRegion)
385 (useFaceZones ?
mesh.faceZones().whichZone(facei) : -1),
394 if (Pstream::parRun())
396 if (Pstream::master())
399 for (
const int slave : Pstream::subProcs())
401 IPstream fromSlave(Pstream::commsTypes::blocking, slave);
409 auto masterIter = regionsToSize.
find(slaveIter.key());
411 if (masterIter.found())
418 const label
zoneID = iter.key();
419 const label slaveSize = iter.val();
422 if (zoneIter.found())
424 *zoneIter += slaveSize;
434 regionsToSize.
insert(slaveIter.key(), slaveInfo);
445 Pstream::commsTypes::blocking,
448 toMaster << regionsToSize;
455 Pstream::broadcast(regionsToSize);
460 label nInterfaces = 0;
464 nInterfaces += info.
size();
467 interfaces.
setSize(nInterfaces);
468 interfaceNames.
setSize(nInterfaces);
469 interfaceSizes.
setSize(nInterfaces);
475 const edge&
e = iter.key();
483 interfaces[nInterfaces] = iter.key();
484 label
zoneID = infoIter.key();
489 name0 +
"_to_" + name1,
490 name1 +
"_to_" + name0
498 zoneName +
"_" + name0 +
"_to_" + name1,
499 zoneName +
"_" + name1 +
"_to_" + name0
502 interfaceSizes[nInterfaces] = infoIter();
504 if (regionsToInterface.found(
e))
506 regionsToInterface[
e].insert(
zoneID, nInterfaces);
512 regionsToInterface.insert(
e, zoneAndInterface);
534 label ownRegion = cellRegion[
mesh.faceOwner()[facei]];
535 label neiRegion = cellRegion[
mesh.faceNeighbour()[facei]];
537 if (ownRegion != neiRegion)
547 min(ownRegion, neiRegion),
548 max(ownRegion, neiRegion)
556 label facei = i+
mesh.nInternalFaces();
557 label ownRegion = cellRegion[
mesh.faceOwner()[facei]];
558 label neiRegion = coupledRegion[i];
560 if (ownRegion != neiRegion)
570 min(ownRegion, neiRegion),
571 max(ownRegion, neiRegion)
603 label celli =
mesh.faceOwner()[i+
mesh.nInternalFaces()];
604 coupledRegion[i] = cellRegion[celli];
606 syncTools::swapBoundaryFaceList(
mesh, coupledRegion);
616 labelList cellsToRemove(getNonRegionCells(cellRegion, regionI));
621 labelList exposedFaces = cellRemover.getExposedFaces(cellsToRemove);
626 label facei = exposedFaces[i];
627 label interfacei = faceToInterface[facei];
629 label ownRegion = cellRegion[
mesh.faceOwner()[facei]];
630 label neiRegion = -1;
632 if (
mesh.isInternalFace(facei))
634 neiRegion = cellRegion[
mesh.faceNeighbour()[facei]];
638 neiRegion = coupledRegion[facei-
mesh.nInternalFaces()];
645 label otherRegion = -1;
647 if (ownRegion == regionI && neiRegion != regionI)
649 otherRegion = neiRegion;
651 else if (ownRegion != regionI && neiRegion == regionI)
653 otherRegion = ownRegion;
658 <<
"Exposed face:" << facei
659 <<
" fc:" <<
mesh.faceCentres()[facei]
660 <<
" has owner region " << ownRegion
661 <<
" and neighbour region " << neiRegion
662 <<
" when handling region:" << regionI
667 if (regionI < otherRegion)
669 exposedPatchIDs[i] = interfacePatches[interfacei];
673 exposedPatchIDs[i] = interfacePatches[interfacei]+1;
678 cellRemover.setRefinement
692 mesh.time().timeName(),
694 IOobject::READ_IF_PRESENT,
704void createAndWriteRegion
709 const bool prefixRegion,
713 const word& newMeshInstance
716 Info<<
"Creating mesh for region " << regionI
734 forAll(interfacePatches, interfacei)
736 addedPatches.
insert(interfacePatches[interfacei]);
737 addedPatches.
insert(interfacePatches[interfacei]+1);
744 newMesh().updateMesh(map());
747 subsetVolFields<volScalarField>
755 subsetVolFields<volVectorField>
763 subsetVolFields<volSphericalTensorField>
771 subsetVolFields<volSymmTensorField>
779 subsetVolFields<volTensorField>
788 subsetSurfaceFields<surfaceScalarField>
796 subsetSurfaceFields<surfaceVectorField>
804 subsetSurfaceFields<surfaceSphericalTensorField>
812 subsetSurfaceFields<surfaceSymmTensorField>
820 subsetSurfaceFields<surfaceTensorField>
841 Info<<
"Deleting empty patches" <<
endl;
844 forAll(newPatches, patchi)
846 const polyPatch& pp = newPatches[patchi];
848 if (!isA<processorPolyPatch>(pp))
852 oldToNew[patchi] = newI;
853 if (!addedPatches.
found(patchi))
855 sharedPatches.
append(newI);
863 forAll(newPatches, patchi)
865 const polyPatch& pp = newPatches[patchi];
867 if (isA<processorPolyPatch>(pp) && pp.size())
869 oldToNew[patchi] = newI++;
873 const label nNewPatches = newI;
878 if (oldToNew[patchi] == -1)
880 oldToNew[patchi] = newI++;
885 fvMeshTools::reorderPatches(newMesh(), oldToNew, nNewPatches,
true);
890 Info<<
"Prefixing patches with region name" <<
endl;
892 renamePatches(newMesh(),
regionNames[regionI], sharedPatches);
898 newMesh().setInstance(newMeshInstance);
900 topoSet::removeFiles(newMesh());
901 processorMeshes::removeFiles(newMesh());
904 Info<<
"Writing addressing to base mesh" <<
endl;
910 "pointRegionAddressing",
911 newMesh().facesInstance(),
912 newMesh().meshSubDir,
920 Info<<
"Writing map " << pointProcAddressing.name()
921 <<
" from region" << regionI
922 <<
" points back to base mesh." <<
endl;
923 pointProcAddressing.
write();
929 "faceRegionAddressing",
930 newMesh().facesInstance(),
931 newMesh().meshSubDir,
939 forAll(faceProcAddressing, facei)
943 label oldFacei = map().faceMap()[facei];
947 map().cellMap()[newMesh().faceOwner()[facei]]
948 ==
mesh.faceOwner()[oldFacei]
951 faceProcAddressing[facei] = oldFacei+1;
955 faceProcAddressing[facei] = -(oldFacei+1);
958 Info<<
"Writing map " << faceProcAddressing.name()
959 <<
" from region" << regionI
960 <<
" faces back to base mesh." <<
endl;
961 faceProcAddressing.
write();
967 "cellRegionAddressing",
968 newMesh().facesInstance(),
969 newMesh().meshSubDir,
977 Info<<
"Writing map " <<cellProcAddressing.name()
978 <<
" from region" << regionI
979 <<
" cells back to base mesh." <<
endl;
980 cellProcAddressing.
write();
986 "boundaryRegionAddressing",
987 newMesh().facesInstance(),
988 newMesh().meshSubDir,
998 if (!addedPatches.
found(i))
1000 label newI = oldToNew[i];
1001 if (newI >= 0 && newI < nNewPatches)
1003 boundaryProcAddressing[oldToNew[i]] = i;
1007 Info<<
"Writing map " << boundaryProcAddressing.name()
1008 <<
" from region" << regionI
1009 <<
" boundary back to base mesh." <<
endl;
1010 boundaryProcAddressing.
write();
1030 forAll(interfaces, interI)
1032 const edge&
e = interfaces[interI];
1047 mappedPatchBase::NEARESTPATCHFACE,
1053 interfacePatches[interI] = fvMeshTools::addPatch
1069 mappedPatchBase::NEARESTPATCHFACE,
1074 fvMeshTools::addPatch
1085 <<
" " << interfacePatches[interI]
1086 <<
"\t" <<
mesh.boundaryMesh()[interfacePatches[interI]].name()
1088 <<
" " << interfacePatches[interI]+1
1089 <<
"\t" <<
mesh.boundaryMesh()[interfacePatches[interI]+1].name()
1092 return interfacePatches;
1097label findCorrespondingRegion
1101 const label nCellRegions,
1103 const label minOverlapSize
1107 labelList cellsInZone(nCellRegions, Zero);
1109 forAll(cellRegion, celli)
1111 if (existingZoneID[celli] == zoneI)
1113 cellsInZone[cellRegion[celli]]++;
1120 label regionI =
findMax(cellsInZone);
1123 if (cellsInZone[regionI] < minOverlapSize)
1131 forAll(cellRegion, celli)
1133 if (cellRegion[celli] == regionI && existingZoneID[celli] != zoneI)
1163 forAll(clusterToZones, clusterI)
1165 for (
const label zoneI : clusterToZones[clusterI])
1167 const cellZone& cz = cellZones[zoneI];
1171 label celli = cz[i];
1172 if (clusterID[celli] == -1)
1174 clusterID[celli] = clusterI;
1179 <<
"Cell " << celli <<
" with cell centre "
1180 <<
mesh.cellCentres()[celli]
1181 <<
" is multiple zones. This is not allowed." <<
endl
1182 <<
"It is in zone " << clusterNames[clusterID[celli]]
1183 <<
" and in zone " << clusterNames[clusterI]
1184 <<
exit(FatalError);
1191 syncTools::swapBoundaryCellList(
mesh, clusterID, neiClusterID);
1198 const label regioni,
1215 for (label i = 1; i <
zoneIDs.size(); i++)
1237 clusterNames.
clear();
1238 clusterToZones.
clear();
1242 if (zoneClusters.
size())
1244 forAll(zoneClusters, clusteri)
1250 zoneClusterNames[clusteri].size()
1251 ? zoneClusterNames[clusteri]
1263 forAll(zoneToCluster, zonei)
1265 if (zoneToCluster[zonei] == -1)
1267 clusterNames.
append(cellZones[zonei].
name());
1269 zoneToCluster[zonei] = clusterToZones.
size();
1275 for (
const auto&
cellZone : cellZones)
1277 const label nClusters = clusterToZones.
size();
1288 const bool sloppyCellZones,
1295 const label nCellRegions,
1305 regionToZones.
setSize(nCellRegions);
1314 forAll(clusterToZones, clusterI)
1316 for (
const label zoneI : clusterToZones[clusterI])
1318 clusterSizes[clusterI] += cellZones[zoneI].
size();
1323 if (sloppyCellZones)
1325 Info<<
"Trying to match regions to existing cell zones;"
1326 <<
" region can be subset of cell zone." <<
nl <<
endl;
1328 forAll(clusterToZones, clusterI)
1330 label regionI = findCorrespondingRegion
1336 label(0.5*clusterSizes[clusterI])
1341 Info<<
"Sloppily matched region " << regionI
1343 <<
" to cluster " << clusterI
1344 <<
" size " << clusterSizes[clusterI]
1349 clusterToZones[clusterI]
1351 regionToZones[regionI] = clusterToZones[clusterI];
1358 Info<<
"Trying to match regions to existing cell zones." <<
nl <<
endl;
1360 forAll(clusterToZones, clusterI)
1362 label regionI = findCorrespondingRegion
1368 clusterSizes[clusterI]
1376 clusterToZones[clusterI]
1378 regionToZones[regionI] = clusterToZones[clusterI];
1392 regionToZones[regionI]
1408 mesh.facesInstance(),
1416 cellToRegion.write();
1418 Info<<
"Writing region per cell file (for manual decomposition) to "
1419 << cellToRegion.objectPath() <<
nl <<
endl;
1428 mesh.time().timeName(),
1438 forAll(cellRegion, celli)
1440 cellToRegion[celli] = cellRegion[celli];
1442 cellToRegion.write();
1444 Info<<
"Writing region per cell as volScalarField to "
1445 << cellToRegion.objectPath() <<
nl <<
endl;
1452int main(
int argc,
char *argv[])
1456 "Split mesh into multiple regions (detected by walking across faces)"
1460 argList::addBoolOption
1463 "Additionally split cellZones off into separate regions"
1465 argList::addBoolOption
1468 "Use cellZones only to split mesh into regions; do not use walking"
1472 "cellZonesFileOnly",
1474 "Like -cellZonesOnly, but use specified file"
1480 "Combine zones in follow-on analysis"
1486 "Combine zones in follow-on analysis"
1492 "Specify additional region boundaries that walking does not cross"
1494 argList::addBoolOption
1497 "Place cells into cellZones instead of splitting mesh"
1499 argList::addBoolOption
1502 "Only write largest region"
1508 "Only write region containing point"
1510 argList::addBoolOption
1515 argList::addBoolOption
1518 "Try to match heuristically regions to existing cell zones"
1520 argList::addBoolOption
1523 "Use faceZones to patch inter-region faces instead of single patch"
1525 argList::addBoolOption
1528 "Prefix region name to all patches, not just coupling patches"
1531 argList::noFunctionObjects();
1537 const word oldInstance =
mesh.pointsInstance();
1539 word blockedFacesName;
1542 Info<<
"Reading blocked internal faces from faceSet "
1543 << blockedFacesName <<
nl <<
endl;
1546 const bool makeCellZones =
args.
found(
"makeCellZones");
1547 const bool largestOnly =
args.
found(
"largestOnly");
1548 const bool insidePoint =
args.
found(
"insidePoint");
1549 const bool useCellZones =
args.
found(
"cellZones");
1550 const bool useCellZonesOnly =
args.
found(
"cellZonesOnly");
1551 const bool useCellZonesFile =
args.
found(
"cellZonesFileOnly");
1552 const bool combineZones =
args.
found(
"combineZones");
1553 const bool addZones =
args.
found(
"addZones");
1554 const bool overwrite =
args.
found(
"overwrite");
1555 const bool detectOnly =
args.
found(
"detectOnly");
1556 const bool sloppyCellZones =
args.
found(
"sloppyCellZones");
1557 const bool useFaceZones =
args.
found(
"useFaceZones");
1558 const bool prefixRegion =
args.
found(
"prefixRegion");
1563 (useCellZonesOnly || useCellZonesFile)
1564 && (useCellZones || blockedFacesName.size())
1568 <<
"You cannot specify both -cellZonesOnly or -cellZonesFileOnly"
1569 <<
" (which specify complete split)"
1570 <<
" in combination with -blockedFaces or -cellZones"
1571 <<
" (which imply a split based on topology)"
1572 <<
exit(FatalError);
1578 Info<<
"Using current faceZones to divide inter-region interfaces"
1579 <<
" into multiple patches."
1584 Info<<
"Creating single patch per inter-region interface."
1590 if (insidePoint && largestOnly)
1593 <<
"You cannot specify both -largestOnly"
1594 <<
" (keep region with most cells)"
1595 <<
" and -insidePoint (keep region containing point)"
1596 <<
exit(FatalError);
1601 mesh.cellZones().checkParallelSync(
true);
1610 <<
"Cannot specify both combineZones and addZones"
1611 <<
exit(FatalError);
1620 forAll(zoneClusters, clusteri)
1624 wordRes& wrs = zoneClusters[clusteri];
1626 zoneClusterNames[clusteri] = wrs[0];
1628 for (label i = 1; i < wrs.
size(); i++)
1649 label nCellRegions = 0;
1650 if (useCellZonesOnly)
1652 Info<<
"Using current cellZones to split mesh into regions."
1653 <<
" This requires all"
1654 <<
" cells to be in one and only one cellZone." <<
nl <<
endl;
1685 label unzonedCelli = clusterID.
find(-1);
1686 if (unzonedCelli != -1)
1689 <<
"For the cellZonesOnly option all cells "
1690 <<
"have to be in a cellZone." <<
endl
1691 <<
"Cell " << unzonedCelli
1692 <<
" at" <<
mesh.cellCentres()[unzonedCelli]
1693 <<
" is not in a cellZone. There might be more unzoned cells."
1694 <<
exit(FatalError);
1696 cellRegion = clusterID;
1697 nCellRegions =
gMax(cellRegion)+1;
1698 zoneToRegion = zoneToCluster;
1699 regionToZones = clusterToZones;
1702 else if (useCellZonesFile)
1704 const word zoneFile(
args[
"cellZonesFileOnly"]);
1705 Info<<
"Reading split from cellZones file " << zoneFile <<
endl
1706 <<
"This requires all"
1707 <<
" cells to be in one and only one cellZone." <<
nl <<
endl;
1714 mesh.facesInstance(),
1715 polyMesh::meshSubDir,
1717 IOobject::MUST_READ,
1753 label unzonedCelli = clusterID.
find(-1);
1754 if (unzonedCelli != -1)
1757 <<
"For the cellZonesFileOnly option all cells "
1758 <<
"have to be in a cellZone." <<
endl
1759 <<
"Cell " << unzonedCelli
1760 <<
" at" <<
mesh.cellCentres()[unzonedCelli]
1761 <<
" is not in a cellZone. There might be more unzoned cells."
1762 <<
exit(FatalError);
1764 cellRegion = clusterID;
1765 nCellRegions =
gMax(cellRegion)+1;
1766 zoneToRegion = zoneToCluster;
1767 regionToZones = clusterToZones;
1779 if (blockedFacesName.size())
1784 <<
" blocked faces from set " << blockedFacesName <<
nl <<
endl;
1788 for (
const label facei : blockedFaceSet)
1790 blockedFace[facei] =
true;
1829 for (label facei = 0; facei <
mesh.nInternalFaces(); facei++)
1831 label ownCluster = clusterID[
mesh.faceOwner()[facei]];
1832 label neiCluster = clusterID[
mesh.faceNeighbour()[facei]];
1834 if (ownCluster != neiCluster)
1836 blockedFace[facei] =
true;
1843 label facei = i+
mesh.nInternalFaces();
1844 label ownCluster = clusterID[
mesh.faceOwner()[facei]];
1845 label neiCluster = neiClusterID[i];
1847 if (ownCluster != neiCluster)
1849 blockedFace[facei] =
true;
1856 nCellRegions = regions.nRegions();
1881 if (largestOnly || insidePoint)
1883 forAll(regionToZones, regionI)
1885 if (regionToZones[regionI].empty())
1891 else if (insidePoint)
1895 else if (largestOnly)
1904 Info<<
endl <<
"Number of regions:" << nCellRegions <<
nl <<
endl;
1908 writeCellToRegion(
mesh, cellRegion);
1915 labelList regionSizes(nCellRegions, Zero);
1917 forAll(cellRegion, celli)
1919 regionSizes[cellRegion[celli]]++;
1921 forAll(regionSizes, regionI)
1926 Info<<
"Region\tCells" <<
nl
1927 <<
"------\t-----" <<
endl;
1929 forAll(regionSizes, regionI)
1931 Info<< regionI <<
"\t\t" << regionSizes[regionI] <<
nl;
1938 Info<<
"Region\tZone\tName" <<
nl
1939 <<
"------\t----\t----" <<
endl;
1940 forAll(regionToZones, regionI)
1952 mesh.boundaryMesh().checkParallelSync(
true);
1953 mesh.faceZones().checkParallelSync(
true);
1981 Info<<
"Sizes of interfaces between regions:" <<
nl <<
nl
1982 <<
"Interface\tRegion\tRegion\tFaces" <<
nl
1983 <<
"---------\t------\t------\t-----" <<
endl;
1985 forAll(interfaces, interI)
1987 const edge&
e = interfaces[interI];
1990 <<
"\t\t\t" <<
e[0] <<
"\t\t" <<
e[1]
1991 <<
"\t\t" << interfaceSizes[interI] <<
nl;
2050 if (nCellRegions == 1)
2052 Info<<
"Only one region. Doing nothing." <<
endl;
2054 else if (makeCellZones)
2056 Info<<
"Putting cells into cellZones instead of splitting mesh."
2061 for (label regionI = 0; regionI < nCellRegions; regionI++)
2063 const labelList& zones = regionToZones[regionI];
2065 if (zones.
size() == 1 && zones[0] != -1)
2068 const label zoneI = zones[0];
2069 Info<<
" Region " << regionI <<
" : corresponds to existing"
2071 << zoneI <<
' ' <<
mesh.cellZones()[zoneI].name() <<
endl;
2080 label zoneI =
mesh.cellZones().findZoneID(zoneName);
2084 zoneI =
mesh.cellZones().size();
2085 mesh.cellZones().setSize(zoneI+1);
2086 mesh.cellZones().set
2092 std::move(regionCells),
2100 mesh.cellZones()[zoneI].clearAddressing();
2101 mesh.cellZones()[zoneI] = regionCells;
2103 Info<<
" Region " << regionI <<
" : created new cellZone "
2104 << zoneI <<
' ' <<
mesh.cellZones()[zoneI].name() <<
endl;
2107 mesh.cellZones().writeOpt(IOobject::AUTO_WRITE);
2116 mesh.setInstance(oldInstance);
2119 Info<<
"Writing cellZones as new mesh to time " <<
runTime.timeName()
2128 Info<<
"Writing cellSets corresponding to cellZones." <<
nl <<
endl;
2130 for (
const auto& cz :
mesh.cellZones())
2170 (void)
mesh.tetBasePtIs();
2172 label celli =
mesh.findCell(insidePoint);
2174 Info<<
nl <<
"Found point " << insidePoint <<
" in cell " << celli
2179 regionI = cellRegion[celli];
2185 <<
"Subsetting region " << regionI
2186 <<
" containing point " << insidePoint <<
endl;
2191 <<
"Point " << insidePoint
2192 <<
" is not inside the mesh." <<
nl
2193 <<
"Bounding box of the mesh:" <<
mesh.bounds()
2194 <<
exit(FatalError);
2197 createAndWriteRegion
2206 (overwrite ? oldInstance :
runTime.timeName())
2209 else if (largestOnly)
2211 label regionI =
findMax(regionSizes);
2214 <<
"Subsetting region " << regionI
2215 <<
" of size " << regionSizes[regionI]
2218 createAndWriteRegion
2227 (overwrite ? oldInstance :
runTime.timeName())
2233 for (label regionI = 0; regionI < nCellRegions; regionI++)
2236 <<
"Region " << regionI <<
nl
2237 <<
"-------- " <<
endl;
2239 createAndWriteRegion
2248 (overwrite ? oldInstance :
runTime.timeName())
Field reading functions for post-processing utilities.
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
reduce(hasMovingMesh, orOp< bool >())
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Map from edge (expressed as its endpoints) to value. For easier forward declaration it is currently i...
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
A HashTable similar to std::unordered_map.
bool found(const Key &key) const
Return true if hashed entry is found in table.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
label size() const noexcept
The number of elements in table.
iterator find(const Key &key)
Find and return an iterator set at the hashed entry.
List of IOobjects with searching and retrieving facilities.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
Input inter-processor communications stream.
void transfer(List< T > &list)
void setSize(const label n)
Alias for resize()
void append(const T &val)
Append an element at the end of the list.
void clear()
Clear the list, i.e. set size to zero.
A HashTable to objects of type <T> with a label key.
Output inter-processor communications stream.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
An ordered pair of two objects of type <T> with first() and second() elements.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
void append(T *ptr)
Append an element to the end of the list.
A List with indirect addressing. Like IndirectList but does not store addressing.
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.
void size(const label n)
Older name for setAddressableSize.
label size() const noexcept
The number of elements in the list.
labelList indices(const wordRe &matcher, const bool useGroups=true) const
Return (sorted) zone indices for all matches.
T get(const label index) const
Get a value from the argument at index.
bool found(const word &optName) const
Return true if the named option is found.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
A collection of cell labels.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Mesh data needed to do the Finite Volume discretisation.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
const word & name() const noexcept
The patch name.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order.
void updateMesh()
Correct polyBoundaryMesh after topology update.
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
Direct mesh changes based on v1.3 polyTopoChange syntax.
virtual bool write(const bool valid=true) const
Write using setting from DB.
This class separates the mesh into distinct unconnected regions, each of which is then given a label ...
Given list of cells to remove, insert all the topology changes.
A class for managing temporary objects.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
label index() const noexcept
The index of this zone in the zone list.
const word & name() const noexcept
The zone name.
Foam::word regionName(Foam::polyMesh::defaultRegion)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
const labelIOList & zoneIDs
const labelIOList & zoneID
#define WarningInFunction
Report a warning using Foam::Warning.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
wordList ReadFields(const typename GeoMesh::Mesh &mesh, const IOobjectList &objects, PtrList< GeometricField< Type, PatchField, GeoMesh > > &fields, const bool syncPar=true, const bool readOldTime=false)
Read Geometric fields of templated type.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
label findMax(const ListType &input, label start=0)
labelList findIndices(const ListType &input, typename ListType::const_reference val, label start=0)
Linear search to find all occurrences of given element.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Type gMax(const FieldField< Field, Type > &f)
constexpr char nl
The newline '\n' character (0x0a)
Foam::argList args(argc, argv)
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
interfaceProperties interface(alpha1, U, thermo->transportPropertiesDict())
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
static const char *const typeName
The type name used in ensight case files.
A non-counting (dummy) refCount.