108 using namespace Foam;
113 const word standardRegionName(
"region");
126 forAll(patchesToRename, i)
128 label patchi = patchesToRename[i];
131 if (isA<coupledPolyPatch>(pp))
134 <<
"Encountered coupled patch " << pp.
name()
135 <<
". Will only rename the patch itself," 136 <<
" not any referred patches." 137 <<
" This might have to be done by hand." 141 pp.
name() = prefix +
'_' + pp.
name();
148 template<
class GeoField>
162 mesh.objectRegistry::lookupClass<GeoField>()
166 const GeoField& fld = *iter();
168 Info<<
"Mapping field " << fld.name() <<
endl;
184 forAll(tSubFld().boundaryField(), patchi)
186 if (addedPatches.
found(patchi))
188 tSubFld.ref().boundaryFieldRef()[
patchi] ==
189 typename GeoField::value_type(
Zero);
194 GeoField* subFld = tSubFld.ptr();
195 subFld->rename(fld.name());
202 template<
class GeoField>
203 void subsetSurfaceFields
216 mesh.objectRegistry::lookupClass<GeoField>()
220 const GeoField& fld = *iter();
222 Info<<
"Mapping field " << fld.name() <<
endl;
238 forAll(tSubFld().boundaryField(), patchi)
240 if (addedPatches.
found(patchi))
242 tSubFld.ref().boundaryFieldRef()[
patchi] ==
243 typename GeoField::value_type(
Zero);
248 GeoField* subFld = tSubFld.ptr();
249 subFld->rename(fld.name());
261 if (cellRegion[celli] != regioni)
263 nonRegionCells.append(celli);
266 return nonRegionCells.shrink();
274 const label ownRegion,
275 const label neiRegion,
281 min(ownRegion, neiRegion),
282 max(ownRegion, neiRegion)
290 if (iter != regionsToSize.
end())
294 if (zoneFnd != iter().end())
309 zoneToSize.
insert(zoneID, 1);
310 regionsToSize.
insert(interface, zoneToSize);
317 void getInterfaceSizes
320 const bool useFaceZones,
343 if (ownRegion != neiRegion)
365 coupledRegion[i] = cellRegion[celli];
373 label neiRegion = coupledRegion[i];
375 if (ownRegion != neiRegion)
408 regionsToSize.
find(slaveIter.key());
410 if (masterIter != regionsToSize.
end())
418 label zoneID = iter.key();
419 label slaveSize = iter();
425 if (zoneFnd != masterInfo.
end())
427 zoneFnd() += slaveSize;
431 masterInfo.
insert(zoneID, slaveSize);
437 regionsToSize.
insert(slaveIter.key(), slaveIter());
451 toMaster << regionsToSize;
464 label nInterfaces = 0;
468 nInterfaces += info.
size();
471 interfaces.
setSize(nInterfaces);
472 interfaceNames.
setSize(nInterfaces);
473 interfaceSizes.
setSize(nInterfaces);
479 const edge& e = iter.key();
480 const word& name0 = regionNames[e[0]];
481 const word& name1 = regionNames[e[1]];
486 interfaces[nInterfaces] = iter.key();
487 label zoneID = infoIter.key();
492 name0 +
"_to_" + name1,
493 name1 +
"_to_" + name0
501 zoneName +
"_" + name0 +
"_to_" + name1,
502 zoneName +
"_" + name1 +
"_to_" + name0
505 interfaceSizes[nInterfaces] = infoIter();
507 if (regionsToInterface.found(e))
509 regionsToInterface[
e].insert(zoneID, nInterfaces);
514 zoneAndInterface.
insert(zoneID, nInterfaces);
515 regionsToInterface.insert(e, zoneAndInterface);
537 if (ownRegion != neiRegion)
547 min(ownRegion, neiRegion),
548 max(ownRegion, neiRegion)
551 faceToInterface[facei] = regionsToInterface[interface][zoneID];
558 label neiRegion = coupledRegion[i];
560 if (ownRegion != neiRegion)
570 min(ownRegion, neiRegion),
571 max(ownRegion, neiRegion)
574 faceToInterface[facei] = regionsToInterface[interface][zoneID];
587 const word& regionName,
608 Info<<
"Testing:" << io.objectPath() <<
endl;
613 Info<<
"Writing dummy " << regionName/io.name() <<
endl;
616 dummyDict.
add(
"divSchemes", divDict);
618 dummyDict.
add(
"gradSchemes", gradDict);
620 dummyDict.
add(
"laplacianSchemes", laplDict);
629 mesh.time().system(),
640 Info<<
"Writing dummy " << regionName/io.name() <<
endl;
648 labelList coupledRegion(mesh.nFaces()-mesh.nInternalFaces());
652 label celli = mesh.faceOwner()[i+mesh.nInternalFaces()];
653 coupledRegion[i] = cellRegion[celli];
665 labelList cellsToRemove(getNonRegionCells(cellRegion, regioni));
670 labelList exposedFaces = cellRemover.getExposedFaces(cellsToRemove);
675 label facei = exposedFaces[i];
676 label interfacei = faceToInterface[facei];
678 label ownRegion = cellRegion[mesh.faceOwner()[facei]];
679 label neiRegion = -1;
681 if (mesh.isInternalFace(facei))
683 neiRegion = cellRegion[mesh.faceNeighbour()[facei]];
687 neiRegion = coupledRegion[facei-mesh.nInternalFaces()];
694 label otherRegion = -1;
696 if (ownRegion == regioni && neiRegion != regioni)
698 otherRegion = neiRegion;
700 else if (ownRegion != regioni && neiRegion == regioni)
702 otherRegion = ownRegion;
707 <<
"Exposed face:" << facei
708 <<
" fc:" << mesh.faceCentres()[facei]
709 <<
" has owner region " << ownRegion
710 <<
" and neighbour region " << neiRegion
711 <<
" when handling region:" << regioni
716 if (regioni < otherRegion)
718 exposedPatchIDs[i] = interfacePatches[interfacei];
722 exposedPatchIDs[i] = interfacePatches[interfacei]+1;
727 cellRemover.setRefinement
741 mesh.time().timeName(),
753 void createAndWriteRegion
758 const bool prefixRegion,
762 const word& newMeshInstance
765 Info<<
"Creating mesh for region " << regioni
766 <<
' ' << regionNames[regioni] <<
endl;
774 regionNames[regioni],
783 forAll(interfacePatches, interfacei)
785 addedPatches.
insert(interfacePatches[interfacei]);
786 addedPatches.
insert(interfacePatches[interfacei]+1);
793 newMesh().updateMesh(map());
796 subsetVolFields<volScalarField>
804 subsetVolFields<volVectorField>
812 subsetVolFields<volSphericalTensorField>
820 subsetVolFields<volSymmTensorField>
828 subsetVolFields<volTensorField>
837 subsetSurfaceFields<surfaceScalarField>
845 subsetSurfaceFields<surfaceVectorField>
853 subsetSurfaceFields<surfaceSphericalTensorField>
861 subsetSurfaceFields<surfaceSymmTensorField>
869 subsetSurfaceFields<surfaceTensorField>
880 newPatches.checkParallelSync(
true);
886 labelList oldToNew(newPatches.size(), -1);
890 Info<<
"Deleting empty patches" <<
endl;
893 forAll(newPatches, patchi)
897 if (!isA<processorPolyPatch>(pp))
902 if (!addedPatches.
found(patchi))
904 sharedPatches.append(newI);
912 forAll(newPatches, patchi)
916 if (isA<processorPolyPatch>(pp) && pp.size())
918 oldToNew[
patchi] = newI++;
922 const label nNewPatches = newI;
927 if (oldToNew[patchi] == -1)
929 oldToNew[
patchi] = newI++;
939 Info<<
"Prefixing patches with region name" <<
endl;
941 renamePatches(newMesh(), regionNames[regioni], sharedPatches);
947 newMesh().setInstance(newMeshInstance);
951 Info<<
"Writing addressing to base mesh" <<
endl;
957 "pointRegionAddressing",
958 newMesh().facesInstance(),
959 newMesh().meshSubDir,
967 Info<<
"Writing map " << pointProcAddressing.name()
968 <<
" from region" << regioni
969 <<
" points back to base mesh." <<
endl;
970 pointProcAddressing.
write();
976 "faceRegionAddressing",
977 newMesh().facesInstance(),
978 newMesh().meshSubDir,
990 label oldFacei = map().faceMap()[facei];
994 map().cellMap()[newMesh().faceOwner()[facei]]
995 == mesh.faceOwner()[oldFacei]
1006 <<
" from region" << regioni
1007 <<
" faces back to base mesh." <<
endl;
1014 "cellRegionAddressing",
1015 newMesh().facesInstance(),
1016 newMesh().meshSubDir,
1024 Info<<
"Writing map " <<cellProcAddressing.name()
1025 <<
" from region" << regioni
1026 <<
" cells back to base mesh." <<
endl;
1027 cellProcAddressing.
write();
1033 "boundaryRegionAddressing",
1034 newMesh().facesInstance(),
1035 newMesh().meshSubDir,
1045 if (!addedPatches.
found(i))
1047 label newI = oldToNew[i];
1048 if (newI >= 0 && newI < nNewPatches)
1050 boundaryProcAddressing[oldToNew[i]] = i;
1054 Info<<
"Writing map " << boundaryProcAddressing.name()
1055 <<
" from region" << regioni
1056 <<
" boundary back to base mesh." <<
endl;
1057 boundaryProcAddressing.
write();
1077 forAll(interfaces, interI)
1079 const edge& e = interfaces[interI];
1080 const Pair<word>& names = interfaceNames[interI];
1130 Info<<
"For interface between region " << regionNames[e[0]]
1131 <<
" and " << regionNames[e[1]] <<
" added patches" << endl
1132 <<
" " << interfacePatches[interI]
1135 <<
" " << interfacePatches[interI]+1
1139 return interfacePatches;
1144 label findCorrespondingRegion
1148 const label nCellRegions,
1150 const label minOverlapSize
1156 forAll(cellRegion, celli)
1158 if (existingZoneID[celli] == zoneI)
1160 cellsInZone[cellRegion[celli]]++;
1171 if (cellsInZone[regioni] < minOverlapSize)
1179 forAll(cellRegion, celli)
1181 if (cellRegion[celli] == regioni && existingZoneID[celli] != zoneI)
1214 const cellZone& cz = cellZones[zoneI];
1218 label celli = cz[i];
1219 if (zoneID[celli] == -1)
1221 zoneID[celli] = zoneI;
1226 <<
"Cell " << celli <<
" with cell centre " 1228 <<
" is multiple zones. This is not allowed." << endl
1229 <<
"It is in zone " << cellZones[zoneID[celli]].
name()
1230 <<
" and in zone " << cellZones[zoneI].
name()
1249 const bool sloppyCellZones,
1252 const label nCellRegions,
1255 const word& defaultRegionName,
1264 regionToZone.
setSize(nCellRegions, -1);
1265 regionNames.
setSize(nCellRegions);
1271 getZoneID(mesh, cellZones, zoneID, neiZoneID);
1283 if (zoneNames[proci] != zoneNames[0])
1286 <<
"cellZones not synchronised across processors." << endl
1287 <<
"Master has cellZones " << zoneNames[0] << endl
1288 <<
"Processor " << proci
1289 <<
" has cellZones " << zoneNames[proci]
1298 cellZones[zoneI].size(),
1305 if (sloppyCellZones)
1307 Info<<
"Trying to match regions to existing cell zones;" 1308 <<
" region can be subset of cell zone." <<
nl <<
endl;
1312 label regioni = findCorrespondingRegion
1318 label(0.5*zoneSizes[zoneI])
1323 Info<<
"Sloppily matched region " << regioni
1325 <<
" to zone " << zoneI <<
" size " << zoneSizes[zoneI]
1327 zoneToRegion[zoneI] = regioni;
1328 regionToZone[regioni] = zoneI;
1329 regionNames[regioni] = cellZones[zoneI].
name();
1335 Info<<
"Trying to match regions to existing cell zones." <<
nl <<
endl;
1339 label regioni = findCorrespondingRegion
1350 zoneToRegion[zoneI] = regioni;
1351 regionToZone[regioni] = zoneI;
1352 regionNames[regioni] = cellZones[zoneI].
name();
1357 label nUnmatchedRegions = 0;
1359 forAll(regionToZone, regioni)
1361 if (regionToZone[regioni] == -1)
1363 nUnmatchedRegions++;
1367 if (nUnmatchedRegions)
1369 label nUnmatchedi = 1;
1372 forAll(regionToZone, regioni)
1374 if (regionToZone[regioni] == -1)
1378 nUnmatchedRegions == 1
1379 && defaultRegionName != standardRegionName
1382 regionNames[regioni] = defaultRegionName;
1386 regionNames[regioni] =
1387 defaultRegionName +
Foam::name(nUnmatchedi++);
1395 void writeCellToRegion(
const fvMesh& mesh,
const labelList& cellRegion)
1412 cellToRegion.write();
1414 Info<<
"Writing region per cell file (for manual decomposition) to " 1415 << cellToRegion.objectPath() <<
nl <<
endl;
1432 zeroGradientFvPatchScalarField::typeName
1434 forAll(cellRegion, celli)
1436 cellToRegion[celli] = cellRegion[celli];
1438 cellToRegion.write();
1440 Info<<
"Writing region per cell as volScalarField to " 1441 << cellToRegion.objectPath() <<
nl <<
endl;
1448 int main(
int argc,
char *argv[])
1452 "splits mesh into multiple regions (detected by walking across faces)" 1459 "additionally split cellZones off into separate regions" 1464 "use cellZones only to split mesh into regions; do not use walking" 1468 "cellZonesFileOnly",
1470 "like -cellZonesOnly, but use specified file" 1476 "specify additional region boundaries that walking does not cross" 1481 "place cells into cellZones instead of splitting mesh" 1486 "only write largest region" 1492 "only write region containing point" 1502 "try to match heuristically regions to existing cell zones" 1507 "use faceZones to patch inter-region faces instead of single patch" 1512 "prefix region name to all patches, not just coupling patches" 1516 "defaultRegionName",
1518 "base name of the unspecified regions, defaults to \"region\"" 1523 "do not update fields" 1535 word blockedFacesName;
1538 Info<<
"Reading blocked internal faces from faceSet " 1539 << blockedFacesName <<
nl <<
endl;
1557 (useCellZonesOnly || useCellZonesFile)
1558 && (useCellZones || blockedFacesName.size())
1562 <<
"You cannot specify both -cellZonesOnly or -cellZonesFileOnly" 1563 <<
" (which specify complete split)" 1564 <<
" in combination with -blockedFaces or -cellZones" 1565 <<
" (which imply a split based on topology)" 1572 Info<<
"Using current faceZones to divide inter-region interfaces" 1573 <<
" into multiple patches." 1578 Info<<
"Creating single patch per inter-region interface." 1583 if (insidePoint && largestOnly)
1586 <<
"You cannot specify both -largestOnly" 1587 <<
" (keep region with most cells)" 1588 <<
" and -insidePoint (keep region containing point)" 1592 const word defaultRegionName
1603 getZoneID(mesh, cellZones, zoneID, neiZoneID);
1619 label nCellRegions = 0;
1620 if (useCellZonesOnly)
1622 Info<<
"Using current cellZones to split mesh into regions." 1623 <<
" This requires all" 1624 <<
" cells to be in one and only one cellZone." <<
nl <<
endl;
1627 if (unzonedCelli != -1)
1630 <<
"For the cellZonesOnly option all cells " 1631 <<
"have to be in a cellZone." << endl
1632 <<
"Cell " << unzonedCelli
1634 <<
" is not in a cellZone. There might be more unzoned cells." 1637 cellRegion = zoneID;
1638 nCellRegions =
gMax(cellRegion)+1;
1639 regionToZone.
setSize(nCellRegions);
1640 regionNames.
setSize(nCellRegions);
1641 zoneToRegion.
setSize(cellZones.size(), -1);
1642 for (
label regioni = 0; regioni < nCellRegions; regioni++)
1644 regionToZone[regioni] = regioni;
1645 zoneToRegion[regioni] = regioni;
1646 regionNames[regioni] = cellZones[regioni].name();
1649 else if (useCellZonesFile)
1652 Info<<
"Reading split from cellZones file " << zoneFile << endl
1653 <<
"This requires all" 1654 <<
" cells to be in one and only one cellZone." <<
nl <<
endl;
1673 getZoneID(mesh, newCellZones, newZoneID, newNeiZoneID);
1676 if (unzonedCelli != -1)
1679 <<
"For the cellZonesFileOnly option all cells " 1680 <<
"have to be in a cellZone." << endl
1681 <<
"Cell " << unzonedCelli
1683 <<
" is not in a cellZone. There might be more unzoned cells." 1686 cellRegion = newZoneID;
1687 nCellRegions =
gMax(cellRegion)+1;
1688 zoneToRegion.
setSize(newCellZones.size(), -1);
1689 regionToZone.
setSize(nCellRegions);
1690 regionNames.
setSize(nCellRegions);
1691 for (
label regioni = 0; regioni < nCellRegions; regioni++)
1693 regionToZone[regioni] = regioni;
1694 zoneToRegion[regioni] = regioni;
1695 regionNames[regioni] = newCellZones[regioni].name();
1707 if (blockedFacesName.size())
1709 faceSet blockedFaceSet(mesh, blockedFacesName);
1712 <<
" blocked faces from set " << blockedFacesName <<
nl <<
endl;
1718 blockedFace[iter.key()] =
true;
1732 if (zoneID[own] != zoneID[nei])
1734 blockedFace[facei] =
true;
1743 if (zoneID[mesh.
faceOwner()[facei]] != neiZoneID[i])
1745 blockedFace[facei] =
true;
1752 nCellRegions = regions.nRegions();
1770 if (largestOnly || insidePoint)
1772 forAll(regionToZone, regioni)
1774 if (regionToZone[regioni] == -1)
1780 else if (insidePoint)
1782 regionNames[regioni] =
"insidePoint";
1784 else if (largestOnly)
1786 regionNames[regioni] =
"largestOnly";
1793 Info<< endl <<
"Number of regions:" << nCellRegions <<
nl <<
endl;
1797 writeCellToRegion(mesh, cellRegion);
1806 forAll(cellRegion, celli)
1808 regionSizes[cellRegion[celli]]++;
1810 forAll(regionSizes, regioni)
1815 Info<<
"Region\tCells" <<
nl 1816 <<
"------\t-----" <<
endl;
1818 forAll(regionSizes, regioni)
1820 Info<< regioni <<
'\t' << regionSizes[regioni] <<
nl;
1827 Info<<
"Region\tZone\tName" <<
nl 1828 <<
"------\t----\t----" <<
endl;
1829 forAll(regionToZone, regioni)
1831 Info<< regioni <<
'\t' << regionToZone[regioni] <<
'\t' 1832 << regionNames[regioni] <<
nl;
1869 Info<<
"Sizes of interfaces between regions:" <<
nl <<
nl 1870 <<
"Interface\tRegion\tRegion\tFaces" <<
nl 1871 <<
"---------\t------\t------\t-----" <<
endl;
1873 forAll(interfaces, interI)
1875 const edge& e = interfaces[interI];
1878 <<
"\t\t" << e[0] <<
'\t' << e[1]
1879 <<
'\t' << interfaceSizes[interI] <<
nl;
1895 if (fields)
Info<<
"Reading geometric fields" <<
nl <<
endl;
1908 if (nCellRegions == 1)
1910 Info<<
"Only one region. Doing nothing." <<
endl;
1912 else if (makeCellZones)
1914 Info<<
"Putting cells into cellZones instead of splitting mesh." 1919 for (
label regioni = 0; regioni < nCellRegions; regioni++)
1921 label zoneI = regionToZone[regioni];
1925 Info<<
" Region " << regioni <<
" : corresponds to existing" 1927 << zoneI <<
' ' << cellZones[zoneI].name() <<
endl;
1936 zoneI = cellZones.findZoneID(zoneName);
1940 zoneI = cellZones.size();
1959 Info<<
" Region " << regioni <<
" : created new cellZone " 1960 << zoneI <<
' ' << cellZones[zoneI].name() <<
endl;
1984 Info<<
"Writing cellSets corresponding to cellZones." <<
nl <<
endl;
1988 const cellZone& cz = cellZones[zoneI];
2032 Info<<
nl <<
"Found point " << insidePoint <<
" in cell " << celli
2037 regioni = cellRegion[celli];
2043 <<
"Subsetting region " << regioni
2044 <<
" containing point " << insidePoint <<
endl;
2049 <<
"Point " << insidePoint
2050 <<
" is not inside the mesh." <<
nl 2051 <<
"Bounding box of the mesh:" << mesh.
bounds()
2055 createAndWriteRegion
2067 else if (largestOnly)
2072 <<
"Subsetting region " << regioni
2073 <<
" of size " << regionSizes[regioni]
2074 <<
" as named region " << regionNames[regioni] <<
endl;
2076 createAndWriteRegion
2091 for (
label regioni = 0; regioni < nCellRegions; regioni++)
2094 <<
"Region " << regioni <<
nl 2095 <<
"-------- " <<
endl;
2097 createAndWriteRegion
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order. Return.
This class separates the mesh into distinct unconnected regions, each of which is then given a label ...
void clearOut()
Clear all geometry and addressing.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
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.
void clearAddressing()
Clear addressing.
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.
static int masterNo()
Process index of the master.
const word & name() const
Return name.
bool set(const label) const
Is element set.
List of IOobjects with searching and retrieving facilities.
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.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
void off()
Switch the function objects off.
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 > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label nInternalFaces() const
virtual const labelList & faceNeighbour() const
Return face neighbour.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
static int firstSlave()
Process index of first slave.
PtrList< labelIOList > & faceProcAddressing
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
void size(const label)
Override size to be inconsistent with allocated storage.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Given list of cells to remove insert all the topology changes.
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
static bool master(const label communicator=0)
Am I the master process.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
Field reading functions for post-processing utilities.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
const Time & time() const
Return the top-level database.
labelList findIndices(const ListType &, typename ListType::const_reference, const label start=0)
Find all occurrences of given element. Linear search.
virtual bool write(const bool write=true) const
Write mesh using IO settings from time.
bool insert(const Key &key)
Insert a new entry.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
label size() const
Return number of elements in table.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Input inter-processor communications stream.
bool insert(const edge &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const edge &)
Find and return an iterator set at the hashedEntry.
T optionLookupOrDefault(const word &opt, const T &deflt) const
Read a value from the named option if present.
const fileName & pointsInstance() const
Return the current instance directory for points.
T optionRead(const word &opt) const
Read a value from the named option.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
bool found(const Key &) const
Return true if hashedEntry is found in table.
A class for handling words, derived from string.
const cellZoneMesh & cellZones() const
Return cell zone mesh.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
virtual const labelList & faceOwner() const
Return face owner.
List< label > labelList
A List of labels.
const word & name() const
Return name.
An STL-conforming hash table.
const vectorField & cellCentres() const
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
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.
label findMax(const ListType &, const label start=0)
Find index of max element (and larger than given element).
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order. Return.
Map from edge (expressed as its endpoints) to value.
void updateMesh()
Correct polyBoundaryMesh after topology update.
Type gMax(const FieldField< Field, Type > &f)
Output inter-processor communications stream.
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 > &)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
word name(const complex &)
Return a string representation of a complex.
void setInstance(const fileName &)
Set the instance for mesh files.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
label size() const
Return the number of elements in the UPtrList.
void setSize(const label)
Reset size of List.
const boundBox & bounds() const
Return mesh bounding box.
writeOption writeOpt() const
static bool & parRun()
Is this a parallel run?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
const functionObjectList & functionObjects() const
Return the list of function objects.
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A collection of cell labels.
Mesh data needed to do the Finite Volume discretisation.
Direct mesh changes based on v1.3 polyTopoChange syntax.
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
wordList names() const
Return a list of zone names.
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...
virtual Ostream & write(const token &)=0
Write next token to stream.
const doubleScalar e
Elementary charge.
Mesh consisting of general polyhedral cells.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
static void addNote(const string &)
Add extra notes for the usage information.
A class for managing temporary objects.
A patch is a list of labels that address the faces in the global face list.
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.
static tmp< GeometricField< Type, fvPatchField, volMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &, const fvMesh &sMesh, const labelList &patchMap, const labelList &cellMap, const labelList &faceMap)
Map volume field.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
static const Vector< scalar > zero
const string & option(const word &opt) const
Return the argument string associated with the named option.
static int lastSlave(const label communicator=0)
Process index of last slave.