Go to the documentation of this file.
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();
182 if (addedPatches.
found(patchI))
184 tSubFld().boundaryField()[patchI] ==
190 GeoField* subFld = tSubFld.ptr();
191 subFld->rename(
fld.name());
198 template<
class GeoField>
212 mesh.objectRegistry::lookupClass<GeoField>()
216 const GeoField&
fld = *iter();
236 if (addedPatches.
found(patchI))
238 tSubFld().boundaryField()[patchI] ==
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];
600 Info<<
"Testing:" << io.objectPath() <<
endl;
608 dummyDict.
add(
"divSchemes", divDict);
610 dummyDict.
add(
"gradSchemes", gradDict);
612 dummyDict.
add(
"laplacianSchemes", laplDict);
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];
671 label neiRegion = -1;
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
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
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>
882 Info<<
"Deleting empty patches" <<
endl;
885 forAll(newPatches, patchI)
887 const polyPatch& pp = newPatches[patchI];
889 if (!isA<processorPolyPatch>(pp))
893 oldToNew[patchI] = newI;
894 if (!addedPatches.
found(patchI))
896 sharedPatches.
append(newI);
904 forAll(newPatches, patchI)
906 const polyPatch& pp = 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]]
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);
1256 zoneToRegion.
setSize(cellZones.size(), -1);
1261 getZoneID(
mesh, cellZones, zoneID, neiZoneID);
1264 labelList zoneSizes(cellZones.size(), 0);
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);
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);
1586 zoneToRegion.
setSize(cellZones.size(), -1);
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())
1657 <<
" blocked faces from set " << blockedFacesName <<
nl <<
endl;
1663 blockedFace[iter.key()] =
true;
1677 if (zoneID[own] != zoneID[nei])
1679 blockedFace[faceI] =
true;
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;
1882 if (nCellRegions == 1)
1884 Info<<
"Only one region. Doing nothing." <<
endl;
1886 else if (makeCellZones)
1888 Info<<
"Putting cells into cellZones instead of splitting mesh."
1893 for (
label regionI = 0; regionI < nCellRegions; regionI++)
1895 label zoneI = regionToZone[regionI];
1899 Info<<
" Region " << regionI <<
" : corresponds to existing"
1901 << zoneI <<
' ' << cellZones[zoneI].name() <<
endl;
1914 zoneI = cellZones.size();
1933 Info<<
" Region " << regionI <<
" : created new cellZone "
1934 << zoneI <<
' ' << cellZones[zoneI].name() <<
endl;
1949 Info<<
"Writing cellZones as new mesh to time " << runTime.timeName()
1958 Info<<
"Writing cellSets corresponding to cellZones." <<
nl <<
endl;
1962 const cellZone& cz = cellZones[zoneI];
2006 Info<<
nl <<
"Found point " << insidePoint <<
" in cell " << cellI
2011 regionI = cellRegion[cellI];
2017 <<
"Subsetting region " << regionI
2018 <<
" containing point " << insidePoint <<
endl;
2023 <<
"Point " << insidePoint
2024 <<
" is not inside the mesh." <<
nl
2025 <<
"Bounding box of the mesh:" <<
mesh.
bounds()
2029 createAndWriteRegion
2038 (overwrite ? oldInstance : runTime.timeName())
2041 else if (largestOnly)
2046 <<
"Subsetting region " << regionI
2047 <<
" of size " << regionSizes[regionI]
2048 <<
" as named region " << regionNames[regionI] <<
endl;
2050 createAndWriteRegion
2059 (overwrite ? oldInstance : runTime.timeName())
2065 for (
label regionI = 0; regionI < nCellRegions; regionI++)
2068 <<
"Region " << regionI <<
nl
2069 <<
"-------- " <<
endl;
2071 createAndWriteRegion
2080 (overwrite ? oldInstance : runTime.timeName())
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
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.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
label findMax(const ListType &, const label start=0)
Find index of max element (and larger than given element).
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling words, derived from string.
List< label > labelList
A List of labels.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
void append(T *)
Append an element at the end of the list.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
static void addNote(const string &)
Add extra notes for the usage information.
static word defaultRegion
Return the default region name.
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
Given list of cells to remove insert all the topology changes.
Output inter-processor communications stream.
Info<< "Creating field dpdt\n"<< endl;volScalarField dpdt(IOobject("dpdt", runTime.timeName(), mesh), mesh, dimensionedScalar("dpdt", p.dimensions()/dimTime, 0));Info<< "Creating field kinetic energy K\n"<< endl;volScalarField K("K", 0.5 *magSqr(U));volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);p_rgh=p - rho *gh;mesh.setFluxRequired(p_rgh.name());multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
const labelList & tetBasePtIs() const
Return the tetBasePtIs.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
wordList ReadFields(const typename GeoMesh::Mesh &mesh, const IOobjectList &objects, PtrList< GeometricField< Type, PatchField, GeoMesh > > &fields, const bool syncPar=true, const bool readOldTime=false)
Helper routine to read Geometric fields.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
void subsetVolFields(const fvMeshSubset &subsetter, const wordList &fieldNames, PtrList< GeometricField< Type, fvPatchField, volMesh > > &subFields)
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
static bool & parRun()
Is this a parallel run?
Direct mesh changes based on v1.3 polyTopoChange syntax.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
const fileName & facesInstance() const
Return the current instance directory for faces.
const cellZoneMesh & cellZones() const
Return cell zone mesh.
virtual bool write() const
Write using setting from DB.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Mesh consisting of general polyhedral cells.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
const faceZoneMesh & faceZones() const
Return face zone mesh.
virtual bool write() const
Write mesh using IO settings from time.
interfaceProperties interface(alpha1, U, mixture())
const fileName & pointsInstance() const
Return the current instance directory for points.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order. Return.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
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 & system() const
Return system name.
virtual Ostream & write(const token &)=0
Write next token to stream.
static int lastSlave(const label communicator=0)
Process index of last slave.
A patch is a list of labels that address the faces in the global face list.
virtual const labelList & faceOwner() const
Return face owner.
const word & name() const
Return name.
This class separates the mesh into distinct unconnected regions, each of which is then given a label ...
int main(int argc, char *argv[])
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
static int masterNo()
Process index of the master.
const string & option(const word &opt) const
Return the argument string associated with the named option.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
A list of keyword definitions, which are a keyword followed by any number of values (e....
label nInternalFaces() const
static int firstSlave()
Process index of first slave.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
cellIbMask *cellIbMaskExt *faceIbMask *cellIbMask boundaryField().evaluateCoupled()
Generic dimensioned Type class.
bool found(const Key &) const
Return true if hashedEntry is found in table.
Mesh data needed to do the Finite Volume discretisation.
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
const word & name() const
Return name.
A collection of cell labels.
label findZoneID(const word &zoneName) const
Find zone index given a name.
const double e
Elementary charge.
void subsetSurfaceFields(const fvMeshSubset &subsetter, const wordList &fieldNames, PtrList< GeometricField< Type, fvsPatchField, surfaceMesh > > &subFields)
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
List of IOobjects with searching and retrieving facilities.
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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static bool master(const label communicator=0)
Am I the master process.
An STL-conforming hash table.
void updateMesh()
Correct polyBoundaryMesh after topology update.
void setInstance(const fileName &)
Set the instance for mesh files.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const boundBox & bounds() const
Return mesh bounding box.
void setSize(const label)
Reset size of List.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Map from edge (expressed as its endpoints) to value.
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
const vectorField & cellCentres() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
Helper routine to read fields.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Traits class for primitives.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
const vectorField & faceCentres() const
label size() const
Return the number of elements in the PtrList.
T optionRead(const word &opt) const
Read a value from the named option.
bool insert(const Key &key)
Insert a new entry.
bool optionFound(const word &opt) const
Return true if the named option is found.
PtrList< labelIOList > & faceProcAddressing
const Time & time() const
Return the top-level database.
Input inter-processor communications stream.
void size(const label)
Override size to be inconsistent with allocated storage.
void clearAddressing()
Clear addressing.
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
Generic GeometricField class.
Foam::argList args(argc, argv)
labelList findIndices(const ListType &, typename ListType::const_reference, const label start=0)
Find all occurences of given element. Linear search.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order. Return.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const word & name() const
Return name.
#define WarningInFunction
Report a warning using Foam::Warning.
Type gMax(const FieldField< Field, Type > &f)
word name(const complex &)
Return a string representation of a complex.
virtual const labelList & faceNeighbour() const
Return face neighbour.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
void clearOut()
Clear all geometry and addressing.