108 using namespace Foam;
122 forAll(patchesToRename, i)
124 label patchi = patchesToRename[i];
127 if (isA<coupledPolyPatch>(pp))
130 <<
"Encountered coupled patch " << pp.
name()
131 <<
". Will only rename the patch itself," 132 <<
" not any referred patches." 133 <<
" This might have to be done by hand." 137 pp.
name() = prefix +
'_' + pp.
name();
144 template<
class GeoField>
158 mesh.objectRegistry::lookupClass<GeoField>()
162 const GeoField& fld = *iter();
164 Info<<
"Mapping field " << fld.name() <<
endl;
180 forAll(tSubFld().boundaryField(), patchi)
182 if (addedPatches.
found(patchi))
184 tSubFld.ref().boundaryFieldRef()[
patchi] ==
185 typename GeoField::value_type(
Zero);
190 GeoField* subFld = tSubFld.ptr();
191 subFld->rename(fld.name());
198 template<
class GeoField>
199 void subsetSurfaceFields
212 mesh.objectRegistry::lookupClass<GeoField>()
216 const GeoField& fld = *iter();
218 Info<<
"Mapping field " << fld.name() <<
endl;
234 forAll(tSubFld().boundaryField(), patchi)
236 if (addedPatches.
found(patchi))
238 tSubFld.ref().boundaryFieldRef()[
patchi] ==
239 typename GeoField::value_type(
Zero);
244 GeoField* subFld = tSubFld.ptr();
245 subFld->rename(fld.name());
257 if (cellRegion[celli] != regionI)
259 nonRegionCells.append(celli);
262 return nonRegionCells.shrink();
270 const label ownRegion,
271 const label neiRegion,
277 min(ownRegion, neiRegion),
278 max(ownRegion, neiRegion)
286 if (iter != regionsToSize.
end())
290 if (zoneFnd != iter().end())
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)
404 regionsToSize.
find(slaveIter.key());
406 if (masterIter != regionsToSize.
end())
414 label zoneID = iter.key();
415 label slaveSize = iter();
421 if (zoneFnd != masterInfo.
end())
423 zoneFnd() += slaveSize;
427 masterInfo.
insert(zoneID, slaveSize);
433 regionsToSize.
insert(slaveIter.key(), slaveIter());
447 toMaster << 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();
476 const word& name0 = regionNames[e[0]];
477 const word& name1 = regionNames[e[1]];
482 interfaces[nInterfaces] = iter.key();
483 label zoneID = infoIter.key();
488 name0 +
"_to_" + name1,
489 name1 +
"_to_" + name0
497 zoneName +
"_" + name0 +
"_to_" + name1,
498 zoneName +
"_" + name1 +
"_to_" + name0
501 interfaceSizes[nInterfaces] = infoIter();
503 if (regionsToInterface.found(e))
505 regionsToInterface[
e].insert(zoneID, nInterfaces);
510 zoneAndInterface.
insert(zoneID, nInterfaces);
511 regionsToInterface.insert(e, zoneAndInterface);
533 if (ownRegion != neiRegion)
543 min(ownRegion, neiRegion),
544 max(ownRegion, neiRegion)
547 faceToInterface[facei] = regionsToInterface[
interface][zoneID];
554 label neiRegion = coupledRegion[i];
556 if (ownRegion != neiRegion)
566 min(ownRegion, neiRegion),
567 max(ownRegion, neiRegion)
570 faceToInterface[facei] = regionsToInterface[
interface][zoneID];
583 const word& regionName,
604 Info<<
"Testing:" << io.objectPath() <<
endl;
609 Info<<
"Writing dummy " << regionName/io.name() <<
endl;
612 dummyDict.
add(
"divSchemes", divDict);
614 dummyDict.
add(
"gradSchemes", gradDict);
616 dummyDict.
add(
"laplacianSchemes", laplDict);
625 mesh.time().system(),
636 Info<<
"Writing dummy " << regionName/io.name() <<
endl;
644 labelList coupledRegion(mesh.nFaces()-mesh.nInternalFaces());
648 label celli = mesh.faceOwner()[i+mesh.nInternalFaces()];
649 coupledRegion[i] = cellRegion[celli];
661 labelList cellsToRemove(getNonRegionCells(cellRegion, regionI));
666 labelList exposedFaces = cellRemover.getExposedFaces(cellsToRemove);
671 label facei = exposedFaces[i];
672 label interfacei = faceToInterface[facei];
674 label ownRegion = cellRegion[mesh.faceOwner()[facei]];
675 label neiRegion = -1;
677 if (mesh.isInternalFace(facei))
679 neiRegion = cellRegion[mesh.faceNeighbour()[facei]];
683 neiRegion = coupledRegion[facei-mesh.nInternalFaces()];
690 label otherRegion = -1;
692 if (ownRegion == regionI && neiRegion != regionI)
694 otherRegion = neiRegion;
696 else if (ownRegion != regionI && neiRegion == regionI)
698 otherRegion = ownRegion;
703 <<
"Exposed face:" << facei
704 <<
" fc:" << mesh.faceCentres()[facei]
705 <<
" has owner region " << ownRegion
706 <<
" and neighbour region " << neiRegion
707 <<
" when handling region:" << regionI
712 if (regionI < otherRegion)
714 exposedPatchIDs[i] = interfacePatches[interfacei];
718 exposedPatchIDs[i] = interfacePatches[interfacei]+1;
723 cellRemover.setRefinement
737 mesh.time().timeName(),
749 void createAndWriteRegion
754 const bool prefixRegion,
758 const word& newMeshInstance
761 Info<<
"Creating mesh for region " << regionI
762 <<
' ' << regionNames[regionI] <<
endl;
770 regionNames[regionI],
779 forAll(interfacePatches, interfacei)
781 addedPatches.
insert(interfacePatches[interfacei]);
782 addedPatches.
insert(interfacePatches[interfacei]+1);
789 newMesh().updateMesh(map());
792 subsetVolFields<volScalarField>
800 subsetVolFields<volVectorField>
808 subsetVolFields<volSphericalTensorField>
816 subsetVolFields<volSymmTensorField>
824 subsetVolFields<volTensorField>
833 subsetSurfaceFields<surfaceScalarField>
841 subsetSurfaceFields<surfaceVectorField>
849 subsetSurfaceFields<surfaceSphericalTensorField>
857 subsetSurfaceFields<surfaceSymmTensorField>
865 subsetSurfaceFields<surfaceTensorField>
876 newPatches.checkParallelSync(
true);
882 labelList oldToNew(newPatches.size(), -1);
886 Info<<
"Deleting empty patches" <<
endl;
889 forAll(newPatches, patchi)
893 if (!isA<processorPolyPatch>(pp))
898 if (!addedPatches.
found(patchi))
900 sharedPatches.append(newI);
908 forAll(newPatches, patchi)
912 if (isA<processorPolyPatch>(pp) && pp.size())
914 oldToNew[
patchi] = newI++;
918 const label nNewPatches = newI;
923 if (oldToNew[patchi] == -1)
925 oldToNew[
patchi] = newI++;
935 Info<<
"Prefixing patches with region name" <<
endl;
937 renamePatches(newMesh(), regionNames[regionI], sharedPatches);
943 newMesh().setInstance(newMeshInstance);
947 Info<<
"Writing addressing to base mesh" <<
endl;
953 "pointRegionAddressing",
954 newMesh().facesInstance(),
955 newMesh().meshSubDir,
963 Info<<
"Writing map " << pointProcAddressing.name()
964 <<
" from region" << regionI
965 <<
" points back to base mesh." <<
endl;
966 pointProcAddressing.
write();
972 "faceRegionAddressing",
973 newMesh().facesInstance(),
974 newMesh().meshSubDir,
986 label oldFacei = map().faceMap()[facei];
990 map().cellMap()[newMesh().faceOwner()[facei]]
991 == mesh.faceOwner()[oldFacei]
1002 <<
" from region" << regionI
1003 <<
" faces back to base mesh." <<
endl;
1010 "cellRegionAddressing",
1011 newMesh().facesInstance(),
1012 newMesh().meshSubDir,
1020 Info<<
"Writing map " <<cellProcAddressing.name()
1021 <<
" from region" << regionI
1022 <<
" cells back to base mesh." <<
endl;
1023 cellProcAddressing.
write();
1029 "boundaryRegionAddressing",
1030 newMesh().facesInstance(),
1031 newMesh().meshSubDir,
1041 if (!addedPatches.
found(i))
1043 label newI = oldToNew[i];
1044 if (newI >= 0 && newI < nNewPatches)
1046 boundaryProcAddressing[oldToNew[i]] = i;
1050 Info<<
"Writing map " << boundaryProcAddressing.name()
1051 <<
" from region" << regionI
1052 <<
" boundary back to base mesh." <<
endl;
1053 boundaryProcAddressing.
write();
1073 forAll(interfaces, interI)
1075 const edge& e = interfaces[interI];
1076 const Pair<word>& names = interfaceNames[interI];
1126 Info<<
"For interface between region " << regionNames[e[0]]
1127 <<
" and " << regionNames[e[1]] <<
" added patches" << endl
1128 <<
" " << interfacePatches[interI]
1131 <<
" " << interfacePatches[interI]+1
1135 return interfacePatches;
1140 label findCorrespondingRegion
1144 const label nCellRegions,
1146 const label minOverlapSize
1152 forAll(cellRegion, celli)
1154 if (existingZoneID[celli] == zoneI)
1156 cellsInZone[cellRegion[celli]]++;
1167 if (cellsInZone[regionI] < minOverlapSize)
1175 forAll(cellRegion, celli)
1177 if (cellRegion[celli] == regionI && existingZoneID[celli] != zoneI)
1210 const cellZone& cz = cellZones[zoneI];
1214 label celli = cz[i];
1215 if (zoneID[celli] == -1)
1217 zoneID[celli] = zoneI;
1222 <<
"Cell " << celli <<
" with cell centre " 1224 <<
" is multiple zones. This is not allowed." << endl
1225 <<
"It is in zone " << cellZones[zoneID[celli]].
name()
1226 <<
" and in zone " << cellZones[zoneI].
name()
1245 const bool sloppyCellZones,
1248 const label nCellRegions,
1258 regionToZone.
setSize(nCellRegions, -1);
1259 regionNames.
setSize(nCellRegions);
1265 getZoneID(mesh, cellZones, zoneID, neiZoneID);
1277 if (zoneNames[proci] != zoneNames[0])
1280 <<
"cellZones not synchronised across processors." << endl
1281 <<
"Master has cellZones " << zoneNames[0] << endl
1282 <<
"Processor " << proci
1283 <<
" has cellZones " << zoneNames[proci]
1292 cellZones[zoneI].size(),
1299 if (sloppyCellZones)
1301 Info<<
"Trying to match regions to existing cell zones;" 1302 <<
" region can be subset of cell zone." <<
nl <<
endl;
1306 label regionI = findCorrespondingRegion
1312 label(0.5*zoneSizes[zoneI])
1317 Info<<
"Sloppily matched region " << regionI
1319 <<
" to zone " << zoneI <<
" size " << zoneSizes[zoneI]
1321 zoneToRegion[zoneI] = regionI;
1322 regionToZone[regionI] = zoneI;
1323 regionNames[regionI] = cellZones[zoneI].
name();
1329 Info<<
"Trying to match regions to existing cell zones." <<
nl <<
endl;
1333 label regionI = findCorrespondingRegion
1344 zoneToRegion[zoneI] = regionI;
1345 regionToZone[regionI] = zoneI;
1346 regionNames[regionI] = cellZones[zoneI].
name();
1351 forAll(regionToZone, regionI)
1353 if (regionToZone[regionI] == -1)
1355 regionNames[regionI] =
"domain" +
Foam::name(regionI);
1361 void writeCellToRegion(
const fvMesh& mesh,
const labelList& cellRegion)
1378 cellToRegion.write();
1380 Info<<
"Writing region per cell file (for manual decomposition) to " 1381 << cellToRegion.objectPath() <<
nl <<
endl;
1398 zeroGradientFvPatchScalarField::typeName
1400 forAll(cellRegion, celli)
1402 cellToRegion[celli] = cellRegion[celli];
1404 cellToRegion.write();
1406 Info<<
"Writing region per cell as volScalarField to " 1407 << cellToRegion.objectPath() <<
nl <<
endl;
1414 int main(
int argc,
char *argv[])
1418 "splits mesh into multiple regions (detected by walking across faces)" 1425 "additionally split cellZones off into separate regions" 1430 "use cellZones only to split mesh into regions; do not use walking" 1434 "cellZonesFileOnly",
1436 "like -cellZonesOnly, but use specified file" 1442 "specify additional region boundaries that walking does not cross" 1447 "place cells into cellZones instead of splitting mesh" 1452 "only write largest region" 1458 "only write region containing point" 1468 "try to match heuristically regions to existing cell zones" 1473 "use faceZones to patch inter-region faces instead of single patch" 1478 "prefix region name to all patches, not just coupling patches" 1483 runTime.functionObjects().off();
1487 word blockedFacesName;
1490 Info<<
"Reading blocked internal faces from faceSet " 1491 << blockedFacesName <<
nl <<
endl;
1509 (useCellZonesOnly || useCellZonesFile)
1510 && (useCellZones || blockedFacesName.size())
1514 <<
"You cannot specify both -cellZonesOnly or -cellZonesFileOnly" 1515 <<
" (which specify complete split)" 1516 <<
" in combination with -blockedFaces or -cellZones" 1517 <<
" (which imply a split based on topology)" 1524 Info<<
"Using current faceZones to divide inter-region interfaces" 1525 <<
" into multiple patches." 1530 Info<<
"Creating single patch per inter-region interface." 1536 if (insidePoint && largestOnly)
1539 <<
"You cannot specify both -largestOnly" 1540 <<
" (keep region with most cells)" 1541 <<
" and -insidePoint (keep region containing point)" 1552 getZoneID(mesh, cellZones, zoneID, neiZoneID);
1568 label nCellRegions = 0;
1569 if (useCellZonesOnly)
1571 Info<<
"Using current cellZones to split mesh into regions." 1572 <<
" This requires all" 1573 <<
" cells to be in one and only one cellZone." <<
nl <<
endl;
1576 if (unzonedCelli != -1)
1579 <<
"For the cellZonesOnly option all cells " 1580 <<
"have to be in a cellZone." << endl
1581 <<
"Cell " << unzonedCelli
1583 <<
" is not in a cellZone. There might be more unzoned cells." 1586 cellRegion = zoneID;
1587 nCellRegions =
gMax(cellRegion)+1;
1588 regionToZone.
setSize(nCellRegions);
1589 regionNames.
setSize(nCellRegions);
1591 for (
label regionI = 0; regionI < nCellRegions; regionI++)
1593 regionToZone[regionI] = regionI;
1594 zoneToRegion[regionI] = regionI;
1595 regionNames[regionI] = cellZones[regionI].
name();
1598 else if (useCellZonesFile)
1601 Info<<
"Reading split from cellZones file " << zoneFile << endl
1602 <<
"This requires all" 1603 <<
" cells to be in one and only one cellZone." <<
nl <<
endl;
1622 getZoneID(mesh, newCellZones, newZoneID, newNeiZoneID);
1625 if (unzonedCelli != -1)
1628 <<
"For the cellZonesFileOnly option all cells " 1629 <<
"have to be in a cellZone." << endl
1630 <<
"Cell " << unzonedCelli
1632 <<
" is not in a cellZone. There might be more unzoned cells." 1635 cellRegion = newZoneID;
1636 nCellRegions =
gMax(cellRegion)+1;
1637 zoneToRegion.
setSize(newCellZones.size(), -1);
1638 regionToZone.
setSize(nCellRegions);
1639 regionNames.
setSize(nCellRegions);
1640 for (
label regionI = 0; regionI < nCellRegions; regionI++)
1642 regionToZone[regionI] = regionI;
1643 zoneToRegion[regionI] = regionI;
1644 regionNames[regionI] = newCellZones[regionI].name();
1656 if (blockedFacesName.size())
1658 faceSet blockedFaceSet(mesh, blockedFacesName);
1661 <<
" blocked faces from set " << blockedFacesName <<
nl <<
endl;
1667 blockedFace[iter.key()] =
true;
1681 if (zoneID[own] != zoneID[nei])
1683 blockedFace[facei] =
true;
1692 if (zoneID[mesh.
faceOwner()[facei]] != neiZoneID[i])
1694 blockedFace[facei] =
true;
1701 nCellRegions = regions.nRegions();
1718 if (largestOnly || insidePoint)
1720 forAll(regionToZone, regionI)
1722 if (regionToZone[regionI] == -1)
1728 else if (insidePoint)
1730 regionNames[regionI] =
"insidePoint";
1732 else if (largestOnly)
1734 regionNames[regionI] =
"largestOnly";
1741 Info<< endl <<
"Number of regions:" << nCellRegions <<
nl <<
endl;
1745 writeCellToRegion(mesh, cellRegion);
1754 forAll(cellRegion, celli)
1756 regionSizes[cellRegion[celli]]++;
1758 forAll(regionSizes, regionI)
1763 Info<<
"Region\tCells" <<
nl 1764 <<
"------\t-----" <<
endl;
1766 forAll(regionSizes, regionI)
1768 Info<< regionI <<
'\t' << regionSizes[regionI] <<
nl;
1775 Info<<
"Region\tZone\tName" <<
nl 1776 <<
"------\t----\t----" <<
endl;
1777 forAll(regionToZone, regionI)
1779 Info<< regionI <<
'\t' << regionToZone[regionI] <<
'\t' 1780 << regionNames[regionI] <<
nl;
1817 Info<<
"Sizes of interfaces between regions:" <<
nl <<
nl 1818 <<
"Interface\tRegion\tRegion\tFaces" <<
nl 1819 <<
"---------\t------\t------\t-----" <<
endl;
1821 forAll(interfaces, interI)
1823 const edge& e = interfaces[interI];
1826 <<
"\t\t" << e[0] <<
'\t' << e[1]
1827 <<
'\t' << interfaceSizes[interI] <<
nl;
1884 if (nCellRegions == 1)
1886 Info<<
"Only one region. Doing nothing." <<
endl;
1888 else if (makeCellZones)
1890 Info<<
"Putting cells into cellZones instead of splitting mesh." 1895 for (
label regionI = 0; regionI < nCellRegions; regionI++)
1897 label zoneI = regionToZone[regionI];
1901 Info<<
" Region " << regionI <<
" : corresponds to existing" 1903 << zoneI <<
' ' << cellZones[zoneI].
name() <<
endl;
1916 zoneI = cellZones.
size();
1935 Info<<
" Region " << regionI <<
" : created new cellZone " 1936 << zoneI <<
' ' << cellZones[zoneI].
name() <<
endl;
1951 Info<<
"Writing cellZones as new mesh to time " << runTime.timeName()
1960 Info<<
"Writing cellSets corresponding to cellZones." <<
nl <<
endl;
1964 const cellZone& cz = cellZones[zoneI];
2008 Info<<
nl <<
"Found point " << insidePoint <<
" in cell " << celli
2013 regionI = cellRegion[celli];
2019 <<
"Subsetting region " << regionI
2020 <<
" containing point " << insidePoint <<
endl;
2025 <<
"Point " << insidePoint
2026 <<
" is not inside the mesh." <<
nl 2027 <<
"Bounding box of the mesh:" << mesh.
bounds()
2031 createAndWriteRegion
2040 (overwrite ? oldInstance : runTime.timeName())
2043 else if (largestOnly)
2048 <<
"Subsetting region " << regionI
2049 <<
" of size " << regionSizes[regionI]
2050 <<
" as named region " << regionNames[regionI] <<
endl;
2052 createAndWriteRegion
2061 (overwrite ? oldInstance : runTime.timeName())
2067 for (
label regionI = 0; regionI < nCellRegions; regionI++)
2070 <<
"Region " << regionI <<
nl 2071 <<
"-------- " <<
endl;
2073 createAndWriteRegion
2082 (overwrite ? oldInstance : runTime.timeName())
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.
wordList ReadFields(const Mesh &mesh, const IOobjectList &objects, PtrList< GeoField > &fields, const bool syncPar=true)
Read all fields of the specified type.
#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
const double e
Elementary charge.
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.
interfaceProperties interface(alpha1, U, mixture())
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.
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
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 occurences of given element. Linear search.
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.
const fileName & pointsInstance() const
Return the current instance directory for points.
T optionRead(const word &opt) const
Read a value from the named option.
label findZoneID(const word &zoneName) const
Find zone index given a name.
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 occurence 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)
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
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.
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.