108 using namespace Foam;
113 const word standardRegionName(
"region");
129 forAll(patchesToRename, i)
140 template<
class GeoField>
154 mesh.objectRegistry::lookupClass<GeoField>()
158 const GeoField& fld = *iter();
160 Info<<
"Mapping field " << fld.name() <<
endl;
180 tSubFld.ref().boundaryFieldRef()[
patchi] ==
181 typename GeoField::value_type(
Zero);
186 GeoField* subFld = tSubFld.ptr();
187 subFld->rename(fld.name());
194 template<
class GeoField>
195 void subsetSurfaceFields
208 mesh.objectRegistry::lookupClass<GeoField>()
212 const GeoField& fld = *iter();
214 Info<<
"Mapping field " << fld.name() <<
endl;
229 GeoField* subFld = tSubFld.ptr();
230 subFld->rename(fld.name());
242 if (cellRegion[celli] != regioni)
244 nonRegionCells.append(celli);
247 return nonRegionCells.shrink();
255 const label ownRegion,
256 const label neiRegion,
262 min(ownRegion, neiRegion),
263 max(ownRegion, neiRegion)
271 if (iter != regionsToSize.
end())
275 if (zoneFnd != iter().end())
290 zoneToSize.
insert(zoneID, 1);
291 regionsToSize.
insert(interface, zoneToSize);
298 void getInterfaceSizes
301 const bool useFaceZones,
324 if (ownRegion != neiRegion)
346 coupledRegion[i] = cellRegion[celli];
354 label neiRegion = coupledRegion[i];
356 if (ownRegion != neiRegion)
389 regionsToSize.
find(slaveIter.key());
391 if (masterIter != regionsToSize.
end())
399 label zoneID = iter.key();
400 label slaveSize = iter();
406 if (zoneFnd != masterInfo.
end())
408 zoneFnd() += slaveSize;
412 masterInfo.
insert(zoneID, slaveSize);
418 regionsToSize.
insert(slaveIter.key(), slaveIter());
432 toMaster << regionsToSize;
445 label nInterfaces = 0;
449 nInterfaces += info.
size();
452 interfaces.
setSize(nInterfaces);
453 interfaceNames.
setSize(nInterfaces);
454 interfaceSizes.
setSize(nInterfaces);
460 const edge& e = iter.key();
461 const word& name0 = regionNames[e[0]];
462 const word& name1 = regionNames[e[1]];
467 interfaces[nInterfaces] = iter.key();
468 label zoneID = infoIter.key();
473 name0 +
"_to_" + name1,
474 name1 +
"_to_" + name0
482 zoneName +
"_" + name0 +
"_to_" + name1,
483 zoneName +
"_" + name1 +
"_to_" + name0
486 interfaceSizes[nInterfaces] = infoIter();
488 if (regionsToInterface.found(e))
490 regionsToInterface[
e].insert(zoneID, nInterfaces);
495 zoneAndInterface.
insert(zoneID, nInterfaces);
496 regionsToInterface.insert(e, zoneAndInterface);
518 if (ownRegion != neiRegion)
528 min(ownRegion, neiRegion),
529 max(ownRegion, neiRegion)
532 faceToInterface[facei] = regionsToInterface[interface][zoneID];
539 label neiRegion = coupledRegion[i];
541 if (ownRegion != neiRegion)
551 min(ownRegion, neiRegion),
552 max(ownRegion, neiRegion)
555 faceToInterface[facei] = regionsToInterface[interface][zoneID];
568 const word& regionName,
589 Info<<
"Testing:" << io.objectPath() <<
endl;
593 Info<<
"Writing dummy " << regionName/io.name() <<
endl;
596 dummyDict.
add(
"divSchemes", divDict);
598 dummyDict.
add(
"gradSchemes", gradDict);
600 dummyDict.
add(
"laplacianSchemes", laplDict);
609 mesh.time().system(),
619 Info<<
"Writing dummy " << regionName/io.name() <<
endl;
627 labelList coupledRegion(mesh.nFaces()-mesh.nInternalFaces());
631 label celli = mesh.faceOwner()[i+mesh.nInternalFaces()];
632 coupledRegion[i] = cellRegion[celli];
644 labelList cellsToRemove(getNonRegionCells(cellRegion, regioni));
649 labelList exposedFaces = cellRemover.getExposedFaces(cellsToRemove);
654 label facei = exposedFaces[i];
655 label interfacei = faceToInterface[facei];
657 label ownRegion = cellRegion[mesh.faceOwner()[facei]];
658 label neiRegion = -1;
660 if (mesh.isInternalFace(facei))
662 neiRegion = cellRegion[mesh.faceNeighbour()[facei]];
666 neiRegion = coupledRegion[facei-mesh.nInternalFaces()];
673 label otherRegion = -1;
675 if (ownRegion == regioni && neiRegion != regioni)
677 otherRegion = neiRegion;
679 else if (ownRegion != regioni && neiRegion == regioni)
681 otherRegion = ownRegion;
686 <<
"Exposed face:" << facei
687 <<
" fc:" << mesh.faceCentres()[facei]
688 <<
" has owner region " << ownRegion
689 <<
" and neighbour region " << neiRegion
690 <<
" when handling region:" << regioni
695 if (regioni < otherRegion)
697 exposedPatchIDs[i] = interfacePatches[interfacei];
701 exposedPatchIDs[i] = interfacePatches[interfacei]+1;
706 cellRemover.setRefinement
720 mesh.time().timeName(),
732 void createAndWriteRegion
737 const bool prefixRegion,
741 const word& newMeshInstance
744 Info<<
"Creating mesh for region " << regioni
745 <<
' ' << regionNames[regioni] <<
endl;
753 regionNames[regioni],
762 forAll(interfacePatches, interfacei)
764 addedPatches.
insert(interfacePatches[interfacei]);
765 addedPatches.
insert(interfacePatches[interfacei]+1);
772 newMesh().topoChange(map());
775 subsetVolFields<volScalarField>
783 subsetVolFields<volVectorField>
791 subsetVolFields<volSphericalTensorField>
799 subsetVolFields<volSymmTensorField>
807 subsetVolFields<volTensorField>
816 subsetSurfaceFields<surfaceScalarField>
824 subsetSurfaceFields<surfaceVectorField>
832 subsetSurfaceFields<surfaceSphericalTensorField>
840 subsetSurfaceFields<surfaceSymmTensorField>
848 subsetSurfaceFields<surfaceTensorField>
859 newPatches.checkParallelSync(
true);
865 labelList oldToNew(newPatches.size(), -1);
869 Info<<
"Deleting empty patches" <<
endl;
876 if (!isA<processorPolyPatch>(pp))
883 sharedPatches.append(newI);
895 if (isA<processorPolyPatch>(pp) && pp.size())
897 oldToNew[
patchi] = newI++;
901 const label nNewPatches = newI;
906 if (oldToNew[
patchi] == -1)
908 oldToNew[
patchi] = newI++;
918 Info<<
"Prefixing patches with region name" <<
endl;
920 renamePatches(newMesh(), regionNames[regioni], sharedPatches);
926 newMesh().setInstance(newMeshInstance);
930 Info<<
"Writing addressing to base mesh" <<
endl;
936 "pointRegionAddressing",
937 newMesh().facesInstance(),
938 newMesh().meshSubDir,
946 Info<<
"Writing map " << pointProcAddressing.name()
947 <<
" from region" << regioni
948 <<
" points back to base mesh." <<
endl;
949 pointProcAddressing.
write();
955 "faceRegionAddressing",
956 newMesh().facesInstance(),
957 newMesh().meshSubDir,
965 forAll(faceProcAddressing, facei)
969 label oldFacei = map().faceMap()[facei];
973 map().cellMap()[newMesh().faceOwner()[facei]]
974 == mesh.faceOwner()[oldFacei]
977 faceProcAddressing[facei] = oldFacei+1;
981 faceProcAddressing[facei] = -(oldFacei+1);
984 Info<<
"Writing map " << faceProcAddressing.name()
985 <<
" from region" << regioni
986 <<
" faces back to base mesh." <<
endl;
987 faceProcAddressing.
write();
993 "cellRegionAddressing",
994 newMesh().facesInstance(),
995 newMesh().meshSubDir,
1003 Info<<
"Writing map " <<cellProcAddressing.name()
1004 <<
" from region" << regioni
1005 <<
" cells back to base mesh." <<
endl;
1006 cellProcAddressing.
write();
1026 forAll(interfaces, interI)
1028 const edge& e = interfaces[interI];
1029 const Pair<word>& names = interfaceNames[interI];
1079 Info<<
"For interface between region " << regionNames[e[0]]
1080 <<
" and " << regionNames[e[1]] <<
" added patches" << endl
1081 <<
" " << interfacePatches[interI]
1084 <<
" " << interfacePatches[interI]+1
1088 return interfacePatches;
1093 label findCorrespondingRegion
1097 const label nCellRegions,
1099 const label minOverlapSize
1105 forAll(cellRegion, celli)
1107 if (existingZoneID[celli] == zoneI)
1109 cellsInZone[cellRegion[celli]]++;
1120 if (cellsInZone[regioni] < minOverlapSize)
1128 forAll(cellRegion, celli)
1130 if (cellRegion[celli] == regioni && existingZoneID[celli] != zoneI)
1163 const cellZone& cz = cellZones[zoneI];
1167 label celli = cz[i];
1168 if (zoneID[celli] == -1)
1170 zoneID[celli] = zoneI;
1175 <<
"Cell " << celli <<
" with cell centre " 1177 <<
" is multiple zones. This is not allowed." << endl
1178 <<
"It is in zone " << cellZones[zoneID[celli]].
name()
1179 <<
" and in zone " << cellZones[zoneI].
name()
1198 const bool sloppyCellZones,
1201 const label nCellRegions,
1204 const word& defaultRegionName,
1213 regionToZone.
setSize(nCellRegions, -1);
1214 regionNames.
setSize(nCellRegions);
1220 getZoneID(mesh, cellZones, zoneID, neiZoneID);
1232 if (zoneNames[proci] != zoneNames[0])
1235 <<
"cellZones not synchronised across processors." << endl
1236 <<
"Master has cellZones " << zoneNames[0] << endl
1237 <<
"Processor " << proci
1238 <<
" has cellZones " << zoneNames[proci]
1247 cellZones[zoneI].size(),
1254 if (sloppyCellZones)
1256 Info<<
"Trying to match regions to existing cell zones;" 1257 <<
" region can be subset of cell zone." <<
nl <<
endl;
1261 label regioni = findCorrespondingRegion
1267 label(0.5*zoneSizes[zoneI])
1272 Info<<
"Sloppily matched region " << regioni
1274 <<
" to zone " << zoneI <<
" size " << zoneSizes[zoneI]
1276 zoneToRegion[zoneI] = regioni;
1277 regionToZone[regioni] = zoneI;
1278 regionNames[regioni] = cellZones[zoneI].
name();
1284 Info<<
"Trying to match regions to existing cell zones." <<
nl <<
endl;
1288 label regioni = findCorrespondingRegion
1299 zoneToRegion[zoneI] = regioni;
1300 regionToZone[regioni] = zoneI;
1301 regionNames[regioni] = cellZones[zoneI].
name();
1306 label nUnmatchedRegions = 0;
1308 forAll(regionToZone, regioni)
1310 if (regionToZone[regioni] == -1)
1312 nUnmatchedRegions++;
1316 if (nUnmatchedRegions)
1318 label nUnmatchedi = 1;
1321 forAll(regionToZone, regioni)
1323 if (regionToZone[regioni] == -1)
1327 nUnmatchedRegions == 1
1328 && defaultRegionName != standardRegionName
1331 regionNames[regioni] = defaultRegionName;
1335 regionNames[regioni] =
1336 defaultRegionName +
Foam::name(nUnmatchedi++);
1344 void writeCellToRegion(
const fvMesh& mesh,
const labelList& cellRegion)
1361 cellToRegion.write();
1363 Info<<
"Writing region per cell file (for manual decomposition) to " 1364 << cellToRegion.relativeObjectPath() <<
nl <<
endl;
1381 zeroGradientFvPatchScalarField::typeName
1383 forAll(cellRegion, celli)
1385 cellToRegion[celli] = cellRegion[celli];
1387 cellToRegion.write();
1389 Info<<
"Writing region per cell as volScalarField to " 1390 << cellToRegion.relativeObjectPath() <<
nl <<
endl;
1397 int main(
int argc,
char *argv[])
1401 "splits mesh into multiple regions (detected by walking across faces)" 1408 "additionally split cellZones off into separate regions" 1413 "use cellZones only to split mesh into regions; do not use walking" 1417 "cellZonesFileOnly",
1419 "like -cellZonesOnly, but use specified file" 1425 "specify additional region boundaries that walking does not cross" 1430 "place cells into cellZones instead of splitting mesh" 1435 "only write largest region" 1441 "only write region containing point" 1451 "try to match heuristically regions to existing cell zones" 1456 "use faceZones to patch inter-region faces instead of single patch" 1461 "prefix region name to all patches, not just coupling patches" 1465 "defaultRegionName",
1467 "base name of the unspecified regions, defaults to \"region\"" 1472 "do not update fields" 1478 runTime.functionObjects().off();
1484 word blockedFacesName;
1487 Info<<
"Reading blocked internal faces from faceSet " 1488 << blockedFacesName <<
nl <<
endl;
1506 (useCellZonesOnly || useCellZonesFile)
1507 && (useCellZones || blockedFacesName.size())
1511 <<
"You cannot specify both -cellZonesOnly or -cellZonesFileOnly" 1512 <<
" (which specify complete split)" 1513 <<
" in combination with -blockedFaces or -cellZones" 1514 <<
" (which imply a split based on topology)" 1521 Info<<
"Using current faceZones to divide inter-region interfaces" 1522 <<
" into multiple patches." 1527 Info<<
"Creating single patch per inter-region interface." 1532 if (insidePoint && largestOnly)
1535 <<
"You cannot specify both -largestOnly" 1536 <<
" (keep region with most cells)" 1537 <<
" and -insidePoint (keep region containing point)" 1541 const word defaultRegionName
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);
1590 zoneToRegion.
setSize(cellZones.size(), -1);
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();
1719 if (largestOnly || insidePoint)
1721 forAll(regionToZone, regioni)
1723 if (regionToZone[regioni] == -1)
1729 else if (insidePoint)
1731 regionNames[regioni] =
"insidePoint";
1733 else if (largestOnly)
1735 regionNames[regioni] =
"largestOnly";
1742 Info<< endl <<
"Number of regions:" << nCellRegions <<
nl <<
endl;
1746 writeCellToRegion(mesh, cellRegion);
1755 forAll(cellRegion, celli)
1757 regionSizes[cellRegion[celli]]++;
1759 forAll(regionSizes, regioni)
1764 Info<<
"Region\tCells" <<
nl 1765 <<
"------\t-----" <<
endl;
1767 forAll(regionSizes, regioni)
1769 Info<< regioni <<
'\t' << regionSizes[regioni] <<
nl;
1776 Info<<
"Region\tZone\tName" <<
nl 1777 <<
"------\t----\t----" <<
endl;
1778 forAll(regionToZone, regioni)
1780 Info<< regioni <<
'\t' << regionToZone[regioni] <<
'\t' 1781 << regionNames[regioni] <<
nl;
1818 Info<<
"Sizes of interfaces between regions:" <<
nl <<
nl 1819 <<
"Interface\tRegion\tRegion\tFaces" <<
nl 1820 <<
"---------\t------\t------\t-----" <<
endl;
1822 forAll(interfaces, interI)
1824 const edge& e = interfaces[interI];
1827 <<
"\t\t" << e[0] <<
'\t' << e[1]
1828 <<
'\t' << interfaceSizes[interI] <<
nl;
1844 if (fields)
Info<<
"Reading geometric fields" <<
nl <<
endl;
1857 if (nCellRegions == 1)
1859 Info<<
"Only one region. Doing nothing." <<
endl;
1861 else if (makeCellZones)
1863 Info<<
"Putting cells into cellZones instead of splitting mesh." 1868 for (
label regioni = 0; regioni < nCellRegions; regioni++)
1870 label zoneI = regionToZone[regioni];
1874 Info<<
" Region " << regioni <<
" : corresponds to existing" 1876 << zoneI <<
' ' << cellZones[zoneI].name() <<
endl;
1885 zoneI = cellZones.findZoneID(zoneName);
1889 zoneI = cellZones.size();
1908 Info<<
" Region " << regioni <<
" : created new cellZone " 1909 << zoneI <<
' ' << cellZones[zoneI].name() <<
endl;
1924 Info<<
"Writing cellZones as new mesh to time " << runTime.timeName()
1933 Info<<
"Writing cellSets corresponding to cellZones." <<
nl <<
endl;
1937 const cellZone& cz = cellZones[zoneI];
1981 Info<<
nl <<
"Found point " << insidePoint <<
" in cell " << celli
1986 regioni = cellRegion[celli];
1992 <<
"Subsetting region " << regioni
1993 <<
" containing point " << insidePoint <<
endl;
1998 <<
"Point " << insidePoint
1999 <<
" is not inside the mesh." <<
nl 2000 <<
"Bounding box of the mesh:" << mesh.
bounds()
2004 createAndWriteRegion
2013 (overwrite ? oldInstance : runTime.timeName())
2016 else if (largestOnly)
2021 <<
"Subsetting region " << regioni
2022 <<
" of size " << regionSizes[regioni]
2023 <<
" as named region " << regionNames[regioni] <<
endl;
2025 createAndWriteRegion
2034 (overwrite ? oldInstance : runTime.timeName())
2040 for (
label regioni = 0; regioni < nCellRegions; regioni++)
2043 <<
"Region " << regioni <<
nl 2044 <<
"-------- " <<
endl;
2046 createAndWriteRegion
2055 (overwrite ? oldInstance : runTime.timeName())
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
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.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
virtual Ostream & write(const char)=0
Write character.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
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.
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 meshCellZones & cellZones() const
Return cell zones.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
label nInternalFaces() const
virtual const labelList & faceNeighbour() const
Return face neighbour.
void renamePatches(const wordUList &newNames, const bool validBoundary)
Rename the patches. If validBoundary is set this calls topoChange()
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
static int firstSlave()
Process index of first slave.
Templated form of IOobject providing type information for file reading and header type checking...
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 checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order. Return.
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.
const dimensionSet dimless
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.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Input inter-processor communications stream.
wordList names() const
Return a list of zone names.
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.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
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.
static word timeName(const scalar, const int precision=curPrecision_)
Return time name of given scalar time.
A class for handling words, derived from string.
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
wordList names() const
Return a list of patch names.
This boundary condition is not designed to be evaluated; it is assumed 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.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const word & name() const
Return name.
An STL-conforming hash table.
const vectorField & cellCentres() const
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.
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,.
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 size() const
Return the number of elements in the UPtrList.
void setSize(const label)
Reset size of List.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
const boundBox & bounds() const
Return mesh bounding box.
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.
writeOption writeOpt() const
static bool & parRun()
Is this a parallel run?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
Info<< "Reading field p_rgh\"<< endl;volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);pressureReference pressureReference(p, p_rgh, pimple.dict(), thermo.incompressible());mesh.schemes().setFluxRequired(p_rgh.name());hydrostaticInitialisation(p_rgh, p, rho, U, gh, ghf, pRef, thermo, pimple.dict());Info<< "Creating field dpdt\"<< endl;volScalarField dpdt(IOobject("dpdt", runTime.timeName(), mesh), mesh, dimensionedScalar(p.dimensions()/dimTime, 0));Info<< "Creating field kinetic energy K\"<< endl;volScalarField K("K", 0.5 *magSqr(U));dimensionedScalar initialMass=fvc::domainIntegrate(rho);multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A collection of cell labels.
const meshFaceZones & faceZones() const
Return face zones.
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.
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...
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...
void clearAddressing()
Clear addressing.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
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.