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());
443 toMaster << regionsToSize;
456 label nInterfaces = 0;
460 nInterfaces += info.
size();
463 interfaces.
setSize(nInterfaces);
464 interfaceNames.
setSize(nInterfaces);
465 interfaceSizes.
setSize(nInterfaces);
471 const edge& e = iter.key();
472 const word& name0 = regionNames[e[0]];
473 const word& name1 = regionNames[e[1]];
478 interfaces[nInterfaces] = iter.key();
479 label zoneID = infoIter.key();
484 name0 +
"_to_" + name1,
485 name1 +
"_to_" + name0
493 zoneName +
"_" + name0 +
"_to_" + name1,
494 zoneName +
"_" + name1 +
"_to_" + name0
497 interfaceSizes[nInterfaces] = infoIter();
499 if (regionsToInterface.found(e))
501 regionsToInterface[
e].insert(zoneID, nInterfaces);
506 zoneAndInterface.
insert(zoneID, nInterfaces);
507 regionsToInterface.insert(e, zoneAndInterface);
529 if (ownRegion != neiRegion)
539 min(ownRegion, neiRegion),
540 max(ownRegion, neiRegion)
543 faceToInterface[facei] = regionsToInterface[
interface][zoneID];
550 label neiRegion = coupledRegion[i];
552 if (ownRegion != neiRegion)
562 min(ownRegion, neiRegion),
563 max(ownRegion, neiRegion)
566 faceToInterface[facei] = regionsToInterface[
interface][zoneID];
579 const word& regionName,
600 Info<<
"Testing:" << io.objectPath() <<
endl;
605 Info<<
"Writing dummy " << regionName/io.name() <<
endl;
608 dummyDict.
add(
"divSchemes", divDict);
610 dummyDict.
add(
"gradSchemes", gradDict);
612 dummyDict.
add(
"laplacianSchemes", laplDict);
621 mesh.time().system(),
632 Info<<
"Writing dummy " << regionName/io.name() <<
endl;
640 labelList coupledRegion(mesh.nFaces()-mesh.nInternalFaces());
644 label celli = mesh.faceOwner()[i+mesh.nInternalFaces()];
645 coupledRegion[i] = cellRegion[celli];
657 labelList cellsToRemove(getNonRegionCells(cellRegion, regionI));
662 labelList exposedFaces = cellRemover.getExposedFaces(cellsToRemove);
667 label facei = exposedFaces[i];
668 label interfacei = faceToInterface[facei];
670 label ownRegion = cellRegion[mesh.faceOwner()[facei]];
671 label neiRegion = -1;
673 if (mesh.isInternalFace(facei))
675 neiRegion = cellRegion[mesh.faceNeighbour()[facei]];
679 neiRegion = coupledRegion[facei-mesh.nInternalFaces()];
686 label otherRegion = -1;
688 if (ownRegion == regionI && neiRegion != regionI)
690 otherRegion = neiRegion;
692 else if (ownRegion != regionI && neiRegion == regionI)
694 otherRegion = ownRegion;
699 <<
"Exposed face:" << facei
700 <<
" fc:" << mesh.faceCentres()[facei]
701 <<
" has owner region " << ownRegion
702 <<
" and neighbour region " << neiRegion
703 <<
" when handling region:" << regionI
708 if (regionI < otherRegion)
710 exposedPatchIDs[i] = interfacePatches[interfacei];
714 exposedPatchIDs[i] = interfacePatches[interfacei]+1;
719 cellRemover.setRefinement
733 mesh.time().timeName(),
745 void createAndWriteRegion
750 const bool prefixRegion,
754 const word& newMeshInstance
757 Info<<
"Creating mesh for region " << regionI
758 <<
' ' << regionNames[regionI] <<
endl;
766 regionNames[regionI],
775 forAll(interfacePatches, interfacei)
777 addedPatches.
insert(interfacePatches[interfacei]);
778 addedPatches.
insert(interfacePatches[interfacei]+1);
785 newMesh().updateMesh(map());
788 subsetVolFields<volScalarField>
796 subsetVolFields<volVectorField>
804 subsetVolFields<volSphericalTensorField>
812 subsetVolFields<volSymmTensorField>
820 subsetVolFields<volTensorField>
829 subsetSurfaceFields<surfaceScalarField>
837 subsetSurfaceFields<surfaceVectorField>
845 subsetSurfaceFields<surfaceSphericalTensorField>
853 subsetSurfaceFields<surfaceSymmTensorField>
861 subsetSurfaceFields<surfaceTensorField>
872 newPatches.checkParallelSync(
true);
878 labelList oldToNew(newPatches.size(), -1);
882 Info<<
"Deleting empty patches" <<
endl;
885 forAll(newPatches, patchi)
889 if (!isA<processorPolyPatch>(pp))
894 if (!addedPatches.
found(patchi))
896 sharedPatches.append(newI);
904 forAll(newPatches, patchi)
908 if (isA<processorPolyPatch>(pp) && pp.size())
910 oldToNew[
patchi] = newI++;
914 const label nNewPatches = newI;
919 if (oldToNew[patchi] == -1)
921 oldToNew[
patchi] = newI++;
931 Info<<
"Prefixing patches with region name" <<
endl;
933 renamePatches(newMesh(), regionNames[regionI], sharedPatches);
939 newMesh().setInstance(newMeshInstance);
943 Info<<
"Writing addressing to base mesh" <<
endl;
949 "pointRegionAddressing",
950 newMesh().facesInstance(),
951 newMesh().meshSubDir,
959 Info<<
"Writing map " << pointProcAddressing.name()
960 <<
" from region" << regionI
961 <<
" points back to base mesh." <<
endl;
962 pointProcAddressing.
write();
968 "faceRegionAddressing",
969 newMesh().facesInstance(),
970 newMesh().meshSubDir,
982 label oldFacei = map().faceMap()[facei];
986 map().cellMap()[newMesh().faceOwner()[facei]]
987 == mesh.faceOwner()[oldFacei]
998 <<
" from region" << regionI
999 <<
" faces back to base mesh." <<
endl;
1006 "cellRegionAddressing",
1007 newMesh().facesInstance(),
1008 newMesh().meshSubDir,
1016 Info<<
"Writing map " <<cellProcAddressing.name()
1017 <<
" from region" << regionI
1018 <<
" cells back to base mesh." <<
endl;
1019 cellProcAddressing.
write();
1025 "boundaryRegionAddressing",
1026 newMesh().facesInstance(),
1027 newMesh().meshSubDir,
1037 if (!addedPatches.
found(i))
1039 label newI = oldToNew[i];
1040 if (newI >= 0 && newI < nNewPatches)
1042 boundaryProcAddressing[oldToNew[i]] = i;
1046 Info<<
"Writing map " << boundaryProcAddressing.name()
1047 <<
" from region" << regionI
1048 <<
" boundary back to base mesh." <<
endl;
1049 boundaryProcAddressing.
write();
1069 forAll(interfaces, interI)
1071 const edge& e = interfaces[interI];
1072 const Pair<word>& names = interfaceNames[interI];
1122 Info<<
"For interface between region " << regionNames[e[0]]
1123 <<
" and " << regionNames[e[1]] <<
" added patches" << endl
1124 <<
" " << interfacePatches[interI]
1127 <<
" " << interfacePatches[interI]+1
1131 return interfacePatches;
1136 label findCorrespondingRegion
1140 const label nCellRegions,
1142 const label minOverlapSize
1148 forAll(cellRegion, celli)
1150 if (existingZoneID[celli] == zoneI)
1152 cellsInZone[cellRegion[celli]]++;
1163 if (cellsInZone[regionI] < minOverlapSize)
1171 forAll(cellRegion, celli)
1173 if (cellRegion[celli] == regionI && existingZoneID[celli] != zoneI)
1206 const cellZone& cz = cellZones[zoneI];
1210 label celli = cz[i];
1211 if (zoneID[celli] == -1)
1213 zoneID[celli] = zoneI;
1218 <<
"Cell " << celli <<
" with cell centre " 1220 <<
" is multiple zones. This is not allowed." << endl
1221 <<
"It is in zone " << cellZones[zoneID[celli]].
name()
1222 <<
" and in zone " << cellZones[zoneI].
name()
1241 const bool sloppyCellZones,
1244 const label nCellRegions,
1254 regionToZone.
setSize(nCellRegions, -1);
1255 regionNames.
setSize(nCellRegions);
1261 getZoneID(mesh, cellZones, zoneID, neiZoneID);
1273 if (zoneNames[proci] != zoneNames[0])
1276 <<
"cellZones not synchronised across processors." << endl
1277 <<
"Master has cellZones " << zoneNames[0] << endl
1278 <<
"Processor " << proci
1279 <<
" has cellZones " << zoneNames[proci]
1288 cellZones[zoneI].size(),
1295 if (sloppyCellZones)
1297 Info<<
"Trying to match regions to existing cell zones;" 1298 <<
" region can be subset of cell zone." <<
nl <<
endl;
1302 label regionI = findCorrespondingRegion
1308 label(0.5*zoneSizes[zoneI])
1313 Info<<
"Sloppily matched region " << regionI
1315 <<
" to zone " << zoneI <<
" size " << zoneSizes[zoneI]
1317 zoneToRegion[zoneI] = regionI;
1318 regionToZone[regionI] = zoneI;
1319 regionNames[regionI] = cellZones[zoneI].
name();
1325 Info<<
"Trying to match regions to existing cell zones." <<
nl <<
endl;
1329 label regionI = findCorrespondingRegion
1340 zoneToRegion[zoneI] = regionI;
1341 regionToZone[regionI] = zoneI;
1342 regionNames[regionI] = cellZones[zoneI].
name();
1347 forAll(regionToZone, regionI)
1349 if (regionToZone[regionI] == -1)
1351 regionNames[regionI] =
"domain" +
Foam::name(regionI);
1357 void writeCellToRegion(
const fvMesh& mesh,
const labelList& cellRegion)
1374 cellToRegion.write();
1376 Info<<
"Writing region per cell file (for manual decomposition) to " 1377 << cellToRegion.objectPath() <<
nl <<
endl;
1394 zeroGradientFvPatchScalarField::typeName
1396 forAll(cellRegion, celli)
1398 cellToRegion[celli] = cellRegion[celli];
1400 cellToRegion.write();
1402 Info<<
"Writing region per cell as volScalarField to " 1403 << cellToRegion.objectPath() <<
nl <<
endl;
1410 int main(
int argc,
char *argv[])
1414 "splits mesh into multiple regions (detected by walking across faces)" 1421 "additionally split cellZones off into separate regions" 1426 "use cellZones only to split mesh into regions; do not use walking" 1430 "cellZonesFileOnly",
1432 "like -cellZonesOnly, but use specified file" 1438 "specify additional region boundaries that walking does not cross" 1443 "place cells into cellZones instead of splitting mesh" 1448 "only write largest region" 1454 "only write region containing point" 1464 "try to match heuristically regions to existing cell zones" 1469 "use faceZones to patch inter-region faces instead of single patch" 1474 "prefix region name to all patches, not just coupling patches" 1479 runTime.functionObjects().off();
1483 word blockedFacesName;
1486 Info<<
"Reading blocked internal faces from faceSet " 1487 << blockedFacesName <<
nl <<
endl;
1505 (useCellZonesOnly || useCellZonesFile)
1506 && (useCellZones || blockedFacesName.size())
1510 <<
"You cannot specify both -cellZonesOnly or -cellZonesFileOnly" 1511 <<
" (which specify complete split)" 1512 <<
" in combination with -blockedFaces or -cellZones" 1513 <<
" (which imply a split based on topology)" 1520 Info<<
"Using current faceZones to divide inter-region interfaces" 1521 <<
" into multiple patches." 1526 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)" 1548 getZoneID(mesh, cellZones, zoneID, neiZoneID);
1564 label nCellRegions = 0;
1565 if (useCellZonesOnly)
1567 Info<<
"Using current cellZones to split mesh into regions." 1568 <<
" This requires all" 1569 <<
" cells to be in one and only one cellZone." <<
nl <<
endl;
1572 if (unzonedCelli != -1)
1575 <<
"For the cellZonesOnly option all cells " 1576 <<
"have to be in a cellZone." << endl
1577 <<
"Cell " << unzonedCelli
1579 <<
" is not in a cellZone. There might be more unzoned cells." 1582 cellRegion = zoneID;
1583 nCellRegions =
gMax(cellRegion)+1;
1584 regionToZone.
setSize(nCellRegions);
1585 regionNames.
setSize(nCellRegions);
1587 for (
label regionI = 0; regionI < nCellRegions; regionI++)
1589 regionToZone[regionI] = regionI;
1590 zoneToRegion[regionI] = regionI;
1591 regionNames[regionI] = cellZones[regionI].
name();
1594 else if (useCellZonesFile)
1597 Info<<
"Reading split from cellZones file " << zoneFile << endl
1598 <<
"This requires all" 1599 <<
" cells to be in one and only one cellZone." <<
nl <<
endl;
1618 getZoneID(mesh, newCellZones, newZoneID, newNeiZoneID);
1621 if (unzonedCelli != -1)
1624 <<
"For the cellZonesFileOnly option all cells " 1625 <<
"have to be in a cellZone." << endl
1626 <<
"Cell " << unzonedCelli
1628 <<
" is not in a cellZone. There might be more unzoned cells." 1631 cellRegion = newZoneID;
1632 nCellRegions =
gMax(cellRegion)+1;
1633 zoneToRegion.
setSize(newCellZones.size(), -1);
1634 regionToZone.
setSize(nCellRegions);
1635 regionNames.
setSize(nCellRegions);
1636 for (
label regionI = 0; regionI < nCellRegions; regionI++)
1638 regionToZone[regionI] = regionI;
1639 zoneToRegion[regionI] = regionI;
1640 regionNames[regionI] = newCellZones[regionI].name();
1652 if (blockedFacesName.size())
1654 faceSet blockedFaceSet(mesh, blockedFacesName);
1657 <<
" blocked faces from set " << blockedFacesName <<
nl <<
endl;
1663 blockedFace[iter.key()] =
true;
1677 if (zoneID[own] != zoneID[nei])
1679 blockedFace[facei] =
true;
1688 if (zoneID[mesh.
faceOwner()[facei]] != neiZoneID[i])
1690 blockedFace[facei] =
true;
1697 nCellRegions = regions.nRegions();
1714 if (largestOnly || insidePoint)
1716 forAll(regionToZone, regionI)
1718 if (regionToZone[regionI] == -1)
1724 else if (insidePoint)
1726 regionNames[regionI] =
"insidePoint";
1728 else if (largestOnly)
1730 regionNames[regionI] =
"largestOnly";
1737 Info<< endl <<
"Number of regions:" << nCellRegions <<
nl <<
endl;
1741 writeCellToRegion(mesh, cellRegion);
1750 forAll(cellRegion, celli)
1752 regionSizes[cellRegion[celli]]++;
1754 forAll(regionSizes, regionI)
1759 Info<<
"Region\tCells" <<
nl 1760 <<
"------\t-----" <<
endl;
1762 forAll(regionSizes, regionI)
1764 Info<< regionI <<
'\t' << regionSizes[regionI] <<
nl;
1771 Info<<
"Region\tZone\tName" <<
nl 1772 <<
"------\t----\t----" <<
endl;
1773 forAll(regionToZone, regionI)
1775 Info<< regionI <<
'\t' << regionToZone[regionI] <<
'\t' 1776 << regionNames[regionI] <<
nl;
1813 Info<<
"Sizes of interfaces between regions:" <<
nl <<
nl 1814 <<
"Interface\tRegion\tRegion\tFaces" <<
nl 1815 <<
"---------\t------\t------\t-----" <<
endl;
1817 forAll(interfaces, interI)
1819 const edge& e = interfaces[interI];
1822 <<
"\t\t" << e[0] <<
'\t' << e[1]
1823 <<
'\t' << interfaceSizes[interI] <<
nl;
1880 if (nCellRegions == 1)
1882 Info<<
"Only one region. Doing nothing." <<
endl;
1884 else if (makeCellZones)
1886 Info<<
"Putting cells into cellZones instead of splitting mesh." 1891 for (
label regionI = 0; regionI < nCellRegions; regionI++)
1893 label zoneI = regionToZone[regionI];
1897 Info<<
" Region " << regionI <<
" : corresponds to existing" 1899 << zoneI <<
' ' << cellZones[zoneI].
name() <<
endl;
1912 zoneI = cellZones.
size();
1931 Info<<
" Region " << regionI <<
" : created new cellZone " 1932 << zoneI <<
' ' << cellZones[zoneI].
name() <<
endl;
1947 Info<<
"Writing cellZones as new mesh to time " << runTime.timeName()
1956 Info<<
"Writing cellSets corresponding to cellZones." <<
nl <<
endl;
1960 const cellZone& cz = cellZones[zoneI];
2004 Info<<
nl <<
"Found point " << insidePoint <<
" in cell " << celli
2009 regionI = cellRegion[celli];
2015 <<
"Subsetting region " << regionI
2016 <<
" containing point " << insidePoint <<
endl;
2021 <<
"Point " << insidePoint
2022 <<
" is not inside the mesh." <<
nl 2023 <<
"Bounding box of the mesh:" << mesh.
bounds()
2027 createAndWriteRegion
2036 (overwrite ? oldInstance : runTime.timeName())
2039 else if (largestOnly)
2044 <<
"Subsetting region " << regionI
2045 <<
" of size " << regionSizes[regionI]
2046 <<
" as named region " << regionNames[regionI] <<
endl;
2048 createAndWriteRegion
2057 (overwrite ? oldInstance : runTime.timeName())
2063 for (
label regionI = 0; regionI < nCellRegions; regionI++)
2066 <<
"Region " << regionI <<
nl 2067 <<
"-------- " <<
endl;
2069 createAndWriteRegion
2078 (overwrite ? oldInstance : runTime.timeName())
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.
static int masterNo()
Process index of the master.
T optionRead(const word &opt) const
Read a value from the named option.
List of IOobjects with searching and retrieving facilities.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order. Return.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const boundBox & bounds() const
Return mesh bounding box.
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...
const fileName & facesInstance() const
Return the current instance directory for faces.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
interfaceProperties interface(alpha1, U, mixture())
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.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
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.
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.
label size() const
Return number of elements in table.
Field reading functions for post-processing utilities.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
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.
writeOption writeOpt() const
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order. Return.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
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 word & name() const
Return name.
label findZoneID(const word &zoneName) const
Find zone index given a name.
bool optionFound(const word &opt) const
Return true if the named option is found.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
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 zone names.
bool set(const label) const
Is element set.
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.
const vectorField & cellCentres() const
List< label > labelList
A List of labels.
const word & name() const
Return name.
An STL-conforming hash table.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
bool found(const Key &) const
Return true if hashedEntry is found in table.
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).
Map from edge (expressed as its endpoints) to value.
void updateMesh()
Correct polyBoundaryMesh after topology update.
Type gMax(const FieldField< Field, Type > &f)
const labelList & tetBasePtIs() const
Return the tetBasePtIs.
const string & option(const word &opt) const
Return the argument string associated with the named option.
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.
void setSize(const label)
Reset size of List.
static bool & parRun()
Is this a parallel run?
const cellZoneMesh & cellZones() const
Return cell zone mesh.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
virtual const labelList & faceNeighbour() const
Return face neighbour.
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...
const fileName & pointsInstance() const
Return the current instance directory for points.
A collection of cell labels.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
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.
const faceZoneMesh & faceZones() const
Return face zone mesh.
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 const Vector< scalar > zero
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
const word & system() const
Return system name.
static void addNote(const string &)
Add extra notes for the usage information.
A class for managing temporary objects.
virtual const labelList & faceOwner() const
Return face owner.
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.
label nInternalFaces() const
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
virtual bool write() const
Write mesh using IO settings from time.
const word & name() const
Return name.
const Time & time() const
Return the top-level database.
label size() const
Return the number of elements in the UPtrList.
static int lastSlave(const label communicator=0)
Process index of last slave.