Go to the documentation of this file.
111 using namespace Foam;
125 forAll(patchesToRename, i)
127 label patchi = patchesToRename[i];
130 if (isA<coupledPolyPatch>(pp))
133 <<
"Encountered coupled patch " << pp.
name()
134 <<
". Will only rename the patch itself,"
135 <<
" not any referred patches."
136 <<
" This might have to be done by hand."
140 pp.
name() = prefix +
'_' + pp.
name();
147 template<
class GeoField>
161 mesh.objectRegistry::lookupClass<GeoField>()
165 const GeoField&
fld = *iter.val();
183 forAll(tSubFld().boundaryField(), patchi)
185 if (addedPatches.
found(patchi))
187 tSubFld.ref().boundaryFieldRef()[patchi] ==
188 typename GeoField::value_type(
Zero);
193 GeoField* subFld = tSubFld.ptr();
194 subFld->rename(
fld.name());
201 template<
class GeoField>
202 void subsetSurfaceFields
215 mesh.objectRegistry::lookupClass<GeoField>()
219 const GeoField&
fld = *iter.val();
237 forAll(tSubFld().boundaryField(), patchi)
239 if (addedPatches.
found(patchi))
241 tSubFld.ref().boundaryFieldRef()[patchi] ==
242 typename GeoField::value_type(
Zero);
247 GeoField* subFld = tSubFld.ptr();
248 subFld->rename(
fld.name());
260 if (cellRegion[celli] != regionI)
262 nonRegionCells.append(celli);
265 return nonRegionCells.shrink();
273 const label ownRegion,
274 const label neiRegion,
280 min(ownRegion, neiRegion),
281 max(ownRegion, neiRegion)
289 auto zoneIter = iter().find(
zoneID);
290 if (zoneIter.found())
305 zoneToSize.insert(
zoneID, 1);
313 void getInterfaceSizes
316 const bool useFaceZones,
339 if (ownRegion != neiRegion)
361 coupledRegion[i] = cellRegion[celli];
369 label neiRegion = coupledRegion[i];
371 if (ownRegion != neiRegion)
405 auto masterIter = regionsToSize.
find(slaveIter.key());
407 if (masterIter.found())
414 const label
zoneID = iter.key();
415 const label slaveSize = iter.val();
417 auto zoneIter = masterInfo.find(
zoneID);
418 if (zoneIter.found())
420 *zoneIter += slaveSize;
424 masterInfo.insert(
zoneID, slaveSize);
430 regionsToSize.
insert(slaveIter.key(), slaveInfo);
444 toMaster << regionsToSize;
457 label nInterfaces = 0;
461 nInterfaces += info.size();
464 interfaces.
setSize(nInterfaces);
465 interfaceNames.
setSize(nInterfaces);
466 interfaceSizes.
setSize(nInterfaces);
472 const edge&
e = iter.key();
475 const word& name0 = regionNames[
e[0]];
476 const word& name1 = regionNames[
e[1]];
480 interfaces[nInterfaces] = iter.key();
481 label
zoneID = infoIter.key();
486 name0 +
"_to_" + name1,
487 name1 +
"_to_" + name0
495 zoneName +
"_" + name0 +
"_to_" + name1,
496 zoneName +
"_" + name1 +
"_to_" + name0
499 interfaceSizes[nInterfaces] = infoIter();
501 if (regionsToInterface.found(
e))
503 regionsToInterface[
e].insert(
zoneID, nInterfaces);
508 zoneAndInterface.insert(
zoneID, nInterfaces);
509 regionsToInterface.insert(
e, zoneAndInterface);
531 if (ownRegion != neiRegion)
541 min(ownRegion, neiRegion),
542 max(ownRegion, neiRegion)
552 label neiRegion = coupledRegion[i];
554 if (ownRegion != neiRegion)
564 min(ownRegion, neiRegion),
565 max(ownRegion, neiRegion)
598 coupledRegion[i] = cellRegion[celli];
610 labelList cellsToRemove(getNonRegionCells(cellRegion, regionI));
615 labelList exposedFaces = cellRemover.getExposedFaces(cellsToRemove);
617 labelList exposedPatchIDs(exposedFaces.size());
620 label facei = exposedFaces[i];
621 label interfacei = faceToInterface[facei];
624 label neiRegion = -1;
639 label otherRegion = -1;
641 if (ownRegion == regionI && neiRegion != regionI)
643 otherRegion = neiRegion;
645 else if (ownRegion != regionI && neiRegion == regionI)
647 otherRegion = ownRegion;
652 <<
"Exposed face:" << facei
654 <<
" has owner region " << ownRegion
655 <<
" and neighbour region " << neiRegion
656 <<
" when handling region:" << regionI
661 if (regionI < otherRegion)
663 exposedPatchIDs[i] = interfacePatches[interfacei];
667 exposedPatchIDs[i] = interfacePatches[interfacei]+1;
672 cellRemover.setRefinement
698 void createAndWriteRegion
703 const bool prefixRegion,
707 const word& newMeshInstance
710 Info<<
"Creating mesh for region " << regionI
711 <<
' ' << regionNames[regionI] <<
endl;
719 regionNames[regionI],
728 forAll(interfacePatches, interfacei)
730 addedPatches.
insert(interfacePatches[interfacei]);
731 addedPatches.
insert(interfacePatches[interfacei]+1);
738 newMesh().updateMesh(map());
741 subsetVolFields<volScalarField>
749 subsetVolFields<volVectorField>
757 subsetVolFields<volSphericalTensorField>
765 subsetVolFields<volSymmTensorField>
773 subsetVolFields<volTensorField>
782 subsetSurfaceFields<surfaceScalarField>
790 subsetSurfaceFields<surfaceVectorField>
798 subsetSurfaceFields<surfaceSphericalTensorField>
806 subsetSurfaceFields<surfaceSymmTensorField>
814 subsetSurfaceFields<surfaceTensorField>
831 labelList oldToNew(newPatches.size(), -1);
835 Info<<
"Deleting empty patches" <<
endl;
838 forAll(newPatches, patchi)
840 const polyPatch& pp = newPatches[patchi];
842 if (!isA<processorPolyPatch>(pp))
846 oldToNew[patchi] = newI;
847 if (!addedPatches.
found(patchi))
849 sharedPatches.
append(newI);
857 forAll(newPatches, patchi)
859 const polyPatch& pp = newPatches[patchi];
861 if (isA<processorPolyPatch>(pp) && pp.size())
863 oldToNew[patchi] = newI++;
867 const label nNewPatches = newI;
872 if (oldToNew[patchi] == -1)
874 oldToNew[patchi] = newI++;
884 Info<<
"Prefixing patches with region name" <<
endl;
886 renamePatches(newMesh(), regionNames[regionI], sharedPatches);
892 newMesh().setInstance(newMeshInstance);
898 Info<<
"Writing addressing to base mesh" <<
endl;
904 "pointRegionAddressing",
905 newMesh().facesInstance(),
906 newMesh().meshSubDir,
914 Info<<
"Writing map " << pointProcAddressing.name()
915 <<
" from region" << regionI
916 <<
" points back to base mesh." <<
endl;
917 pointProcAddressing.
write();
923 "faceRegionAddressing",
924 newMesh().facesInstance(),
925 newMesh().meshSubDir,
937 label oldFacei = map().faceMap()[facei];
941 map().cellMap()[newMesh().faceOwner()[facei]]
953 <<
" from region" << regionI
954 <<
" faces back to base mesh." <<
endl;
961 "cellRegionAddressing",
962 newMesh().facesInstance(),
963 newMesh().meshSubDir,
971 Info<<
"Writing map " <<cellProcAddressing.name()
972 <<
" from region" << regionI
973 <<
" cells back to base mesh." <<
endl;
974 cellProcAddressing.
write();
980 "boundaryRegionAddressing",
981 newMesh().facesInstance(),
982 newMesh().meshSubDir,
992 if (!addedPatches.
found(i))
994 label newI = oldToNew[i];
995 if (newI >= 0 && newI < nNewPatches)
997 boundaryProcAddressing[oldToNew[i]] = i;
1001 Info<<
"Writing map " << boundaryProcAddressing.name()
1002 <<
" from region" << regionI
1003 <<
" boundary back to base mesh." <<
endl;
1004 boundaryProcAddressing.
write();
1022 labelList interfacePatches(interfaces.size());
1024 forAll(interfaces, interI)
1026 const edge&
e = interfaces[interI];
1027 const Pair<word>& names = interfaceNames[interI];
1077 Info<<
"For interface between region " << regionNames[
e[0]]
1078 <<
" and " << regionNames[
e[1]] <<
" added patches" <<
endl
1079 <<
" " << interfacePatches[interI]
1082 <<
" " << interfacePatches[interI]+1
1086 return interfacePatches;
1091 label findCorrespondingRegion
1095 const label nCellRegions,
1097 const label minOverlapSize
1103 forAll(cellRegion, celli)
1105 if (existingZoneID[celli] == zoneI)
1107 cellsInZone[cellRegion[celli]]++;
1115 label regionI =
findMax(cellsInZone);
1118 if (cellsInZone[regionI] < minOverlapSize)
1126 forAll(cellRegion, celli)
1128 if (cellRegion[celli] == regionI && existingZoneID[celli] != zoneI)
1161 const cellZone& cz = cellZones[zoneI];
1165 label celli = cz[i];
1173 <<
"Cell " << celli <<
" with cell centre "
1175 <<
" is multiple zones. This is not allowed." <<
endl
1176 <<
"It is in zone " << cellZones[
zoneID[celli]].name()
1177 <<
" and in zone " << cellZones[zoneI].name()
1196 const bool sloppyCellZones,
1199 const label nCellRegions,
1209 regionToZone.
setSize(nCellRegions, -1);
1210 regionNames.
setSize(nCellRegions);
1211 zoneToRegion.
setSize(cellZones.size(), -1);
1216 getZoneID(
mesh, cellZones,
zoneID, neiZoneID);
1228 if (zoneNames[proci] != zoneNames[0])
1231 <<
"cellZones not synchronised across processors." <<
endl
1232 <<
"Master has cellZones " << zoneNames[0] <<
endl
1233 <<
"Processor " << proci
1234 <<
" has cellZones " << zoneNames[proci]
1243 cellZones[zoneI].size(),
1250 if (sloppyCellZones)
1252 Info<<
"Trying to match regions to existing cell zones;"
1253 <<
" region can be subset of cell zone." <<
nl <<
endl;
1257 label regionI = findCorrespondingRegion
1263 label(0.5*zoneSizes[zoneI])
1268 Info<<
"Sloppily matched region " << regionI
1270 <<
" to zone " << zoneI <<
" size " << zoneSizes[zoneI]
1272 zoneToRegion[zoneI] = regionI;
1273 regionToZone[regionI] = zoneI;
1274 regionNames[regionI] = cellZones[zoneI].name();
1280 Info<<
"Trying to match regions to existing cell zones." <<
nl <<
endl;
1284 label regionI = findCorrespondingRegion
1295 zoneToRegion[zoneI] = regionI;
1296 regionToZone[regionI] = zoneI;
1297 regionNames[regionI] = cellZones[zoneI].name();
1302 forAll(regionToZone, regionI)
1304 if (regionToZone[regionI] == -1)
1306 regionNames[regionI] =
"domain" +
Foam::name(regionI);
1329 cellToRegion.write();
1331 Info<<
"Writing region per cell file (for manual decomposition) to "
1332 << cellToRegion.objectPath() <<
nl <<
endl;
1349 zeroGradientFvPatchScalarField::typeName
1351 forAll(cellRegion, celli)
1353 cellToRegion[celli] = cellRegion[celli];
1355 cellToRegion.write();
1357 Info<<
"Writing region per cell as volScalarField to "
1358 << cellToRegion.objectPath() <<
nl <<
endl;
1365 int main(
int argc,
char *argv[])
1369 "Split mesh into multiple regions (detected by walking across faces)"
1376 "Additionally split cellZones off into separate regions"
1381 "Use cellZones only to split mesh into regions; do not use walking"
1385 "cellZonesFileOnly",
1387 "Like -cellZonesOnly, but use specified file"
1393 "Specify additional region boundaries that walking does not cross"
1398 "Place cells into cellZones instead of splitting mesh"
1403 "Only write largest region"
1409 "Only write region containing point"
1419 "Try to match heuristically regions to existing cell zones"
1424 "Use faceZones to patch inter-region faces instead of single patch"
1429 "Prefix region name to all patches, not just coupling patches"
1440 word blockedFacesName;
1443 Info<<
"Reading blocked internal faces from faceSet "
1444 << blockedFacesName <<
nl <<
endl;
1447 const bool makeCellZones =
args.
found(
"makeCellZones");
1448 const bool largestOnly =
args.
found(
"largestOnly");
1449 const bool insidePoint =
args.
found(
"insidePoint");
1450 const bool useCellZones =
args.
found(
"cellZones");
1451 const bool useCellZonesOnly =
args.
found(
"cellZonesOnly");
1452 const bool useCellZonesFile =
args.
found(
"cellZonesFileOnly");
1453 const bool overwrite =
args.
found(
"overwrite");
1454 const bool detectOnly =
args.
found(
"detectOnly");
1455 const bool sloppyCellZones =
args.
found(
"sloppyCellZones");
1456 const bool useFaceZones =
args.
found(
"useFaceZones");
1457 const bool prefixRegion =
args.
found(
"prefixRegion");
1462 (useCellZonesOnly || useCellZonesFile)
1463 && (useCellZones || blockedFacesName.size())
1467 <<
"You cannot specify both -cellZonesOnly or -cellZonesFileOnly"
1468 <<
" (which specify complete split)"
1469 <<
" in combination with -blockedFaces or -cellZones"
1470 <<
" (which imply a split based on topology)"
1477 Info<<
"Using current faceZones to divide inter-region interfaces"
1478 <<
" into multiple patches."
1483 Info<<
"Creating single patch per inter-region interface."
1489 if (insidePoint && largestOnly)
1492 <<
"You cannot specify both -largestOnly"
1493 <<
" (keep region with most cells)"
1494 <<
" and -insidePoint (keep region containing point)"
1505 getZoneID(
mesh, cellZones,
zoneID, neiZoneID);
1521 label nCellRegions = 0;
1522 if (useCellZonesOnly)
1524 Info<<
"Using current cellZones to split mesh into regions."
1525 <<
" This requires all"
1526 <<
" cells to be in one and only one cellZone." <<
nl <<
endl;
1528 label unzonedCelli =
zoneID.find(-1);
1529 if (unzonedCelli != -1)
1532 <<
"For the cellZonesOnly option all cells "
1533 <<
"have to be in a cellZone." <<
endl
1534 <<
"Cell " << unzonedCelli
1536 <<
" is not in a cellZone. There might be more unzoned cells."
1540 nCellRegions =
gMax(cellRegion)+1;
1541 regionToZone.
setSize(nCellRegions);
1542 regionNames.
setSize(nCellRegions);
1543 zoneToRegion.
setSize(cellZones.size(), -1);
1544 for (label regionI = 0; regionI < nCellRegions; regionI++)
1546 regionToZone[regionI] = regionI;
1547 zoneToRegion[regionI] = regionI;
1548 regionNames[regionI] = cellZones[regionI].name();
1551 else if (useCellZonesFile)
1553 const word zoneFile(
args[
"cellZonesFileOnly"]);
1554 Info<<
"Reading split from cellZones file " << zoneFile <<
endl
1555 <<
"This requires all"
1556 <<
" cells to be in one and only one cellZone." <<
nl <<
endl;
1575 getZoneID(
mesh, newCellZones, newZoneID, newNeiZoneID);
1577 label unzonedCelli = newZoneID.find(-1);
1578 if (unzonedCelli != -1)
1581 <<
"For the cellZonesFileOnly option all cells "
1582 <<
"have to be in a cellZone." <<
endl
1583 <<
"Cell " << unzonedCelli
1585 <<
" is not in a cellZone. There might be more unzoned cells."
1588 cellRegion = newZoneID;
1589 nCellRegions =
gMax(cellRegion)+1;
1590 zoneToRegion.
setSize(newCellZones.size(), -1);
1591 regionToZone.
setSize(nCellRegions);
1592 regionNames.
setSize(nCellRegions);
1593 for (label regionI = 0; regionI < nCellRegions; regionI++)
1595 regionToZone[regionI] = regionI;
1596 zoneToRegion[regionI] = regionI;
1597 regionNames[regionI] = newCellZones[regionI].name();
1609 if (blockedFacesName.size())
1614 <<
" blocked faces from set " << blockedFacesName <<
nl <<
endl;
1618 for (
const label facei : blockedFaceSet)
1620 blockedFace[facei] =
true;
1636 blockedFace[facei] =
true;
1647 blockedFace[facei] =
true;
1654 nCellRegions = regions.nRegions();
1671 if (largestOnly || insidePoint)
1673 forAll(regionToZone, regionI)
1675 if (regionToZone[regionI] == -1)
1681 else if (insidePoint)
1683 regionNames[regionI] =
"insidePoint";
1685 else if (largestOnly)
1687 regionNames[regionI] =
"largestOnly";
1694 Info<<
endl <<
"Number of regions:" << nCellRegions <<
nl <<
endl;
1698 writeCellToRegion(
mesh, cellRegion);
1707 forAll(cellRegion, celli)
1709 regionSizes[cellRegion[celli]]++;
1711 forAll(regionSizes, regionI)
1716 Info<<
"Region\tCells" <<
nl
1717 <<
"------\t-----" <<
endl;
1719 forAll(regionSizes, regionI)
1721 Info<< regionI <<
'\t' << regionSizes[regionI] <<
nl;
1728 Info<<
"Region\tZone\tName" <<
nl
1729 <<
"------\t----\t----" <<
endl;
1730 forAll(regionToZone, regionI)
1732 Info<< regionI <<
'\t' << regionToZone[regionI] <<
'\t'
1733 << regionNames[regionI] <<
nl;
1770 Info<<
"Sizes of interfaces between regions:" <<
nl <<
nl
1771 <<
"Interface\tRegion\tRegion\tFaces" <<
nl
1772 <<
"---------\t------\t------\t-----" <<
endl;
1774 forAll(interfaces, interI)
1776 const edge&
e = interfaces[interI];
1779 <<
"\t\t" <<
e[0] <<
'\t' <<
e[1]
1780 <<
'\t' << interfaceSizes[interI] <<
nl;
1839 if (nCellRegions == 1)
1841 Info<<
"Only one region. Doing nothing." <<
endl;
1843 else if (makeCellZones)
1845 Info<<
"Putting cells into cellZones instead of splitting mesh."
1850 for (label regionI = 0; regionI < nCellRegions; regionI++)
1852 label zoneI = regionToZone[regionI];
1856 Info<<
" Region " << regionI <<
" : corresponds to existing"
1858 << zoneI <<
' ' << cellZones[zoneI].name() <<
endl;
1871 zoneI = cellZones.size();
1879 std::move(regionCells),
1890 Info<<
" Region " << regionI <<
" : created new cellZone "
1891 << zoneI <<
' ' << cellZones[zoneI].name() <<
endl;
1915 Info<<
"Writing cellSets corresponding to cellZones." <<
nl <<
endl;
1919 const cellZone& cz = cellZones[zoneI];
1963 Info<<
nl <<
"Found point " << insidePoint <<
" in cell " << celli
1968 regionI = cellRegion[celli];
1974 <<
"Subsetting region " << regionI
1975 <<
" containing point " << insidePoint <<
endl;
1980 <<
"Point " << insidePoint
1981 <<
" is not inside the mesh." <<
nl
1982 <<
"Bounding box of the mesh:" <<
mesh.
bounds()
1986 createAndWriteRegion
1998 else if (largestOnly)
2000 label regionI =
findMax(regionSizes);
2003 <<
"Subsetting region " << regionI
2004 <<
" of size " << regionSizes[regionI]
2005 <<
" as named region " << regionNames[regionI] <<
endl;
2007 createAndWriteRegion
2022 for (label regionI = 0; regionI < nCellRegions; regionI++)
2025 <<
"Region " << regionI <<
nl
2026 <<
"-------- " <<
endl;
2028 createAndWriteRegion
List< label > labelList
A List of labels.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
PtrList< labelIOList > & faceProcAddressing
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
static constexpr int masterNo() noexcept
Process index of the master.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
const word & name() const
Return name.
A class for handling words, derived from Foam::string.
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
static word defaultRegion
Return the default region name.
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.
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)
Given list of cells to remove, insert all the topology changes.
Output inter-processor communications stream.
label nInternalFaces() const
Number of internal faces.
interfaceProperties interface(alpha1, U, thermo->transportPropertiesDict())
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
label nFaces() const
Number of mesh faces.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
static bool & parRun()
Is this a parallel run?
static word timeName(const scalar t, const int precision=precision_)
Direct mesh changes based on v1.3 polyTopoChange syntax.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
static void addNote(const string ¬e)
Add extra notes for the usage information.
const fileName & facesInstance() const
Return the current instance directory for faces.
bool insert(const edge &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
const cellZoneMesh & cellZones() const
Return cell zone mesh.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
T get(const label index) const
Get a value from the argument at index.
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
const faceZoneMesh & faceZones() const
Return face zone mesh.
const fileName & pointsInstance() const
Return the current instance directory for points.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order. Return.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
label nCells() const
Number of mesh cells.
static int lastSlave(const label communicator=0)
Process index of last slave.
messageStream Info
Information stream (uses stdout - output is on the master only)
A patch is a list of labels that address the faces in the global face list.
word name(const complex &c)
Return string representation of complex.
virtual const labelList & faceOwner() const
Return face owner.
void transfer(List< T > &list)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
This class separates the mesh into distinct unconnected regions, each of which is then given a label ...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
void append(T *ptr)
Append an element to the end of the list.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
label nBoundaryFaces() const
Number of boundary faces (== nFaces - nInternalFaces)
const labelIOList & zoneID
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
Mesh data needed to do the Finite Volume discretisation.
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
const word & name() const
Return name.
A collection of cell labels.
label findZoneID(const word &zoneName) const
Find zone index given a name, return -1 if not found.
List of IOobjects with searching and retrieving facilities.
iterator find(const edge &key)
Find and return an iterator set at the hashed entry.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
wordList names() const
A list of the zone names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static bool master(const label communicator=0)
Am I the master process.
static constexpr int firstSlave() noexcept
Process index of first slave.
A HashTable similar to std::unordered_map.
void updateMesh()
Correct polyBoundaryMesh after topology update.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
const boundBox & bounds() const
Return mesh bounding box.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Map from edge (expressed as its endpoints) to value. For easier forward declaration it is currently i...
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
const vectorField & cellCentres() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
Field reading functions for post-processing utilities.
forAllConstIters(mixture.phases(), phase)
nearest face on selected patch
label findMax(const ListType &input, label start=0)
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
const vectorField & faceCentres() const
static void removeFiles(const polyMesh &mesh)
Helper: remove all procAddressing files from mesh instance.
const dimensionedScalar e
Elementary charge.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
static tmp< GeometricField< Type, fvPatchField, volMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &, const fvMesh &sMesh, const labelUList &patchMap, const labelUList &cellMap, const labelUList &faceMap)
Map volume field.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
const Time & time() const
Return the top-level database.
static const Vector< Cmpt > zero
labelList findIndices(const ListType &input, typename ListType::const_reference val, label start=0)
Linear search to find all occurrences of given element.
Input inter-processor communications stream.
void clearAddressing()
Clear addressing.
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
bool found(const Key &key) const
Return true if hashed entry is found in table.
void setSize(const label newSize)
Alias for resize(const label)
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
Foam::argList args(argc, argv)
static void removeFiles(const polyMesh &)
Helper: remove all sets files from mesh instance.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order.
const word & name() const
The patch name.
#define WarningInFunction
Report a warning using Foam::Warning.
Type gMax(const FieldField< Field, Type > &f)
void setInstance(const fileName &instance, const IOobject::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
virtual const labelList & faceNeighbour() const
Return face neighbour.
void clearOut()
Clear all geometry and addressing.
bool found(const word &optName) const
Return true if the named option is found.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.