Go to the documentation of this file.
104 Info<<
"Merge tolerance : " << mergeTol <<
nl
105 <<
"Write tolerance : " << writeTol <<
endl;
110 <<
"Your current settings specify ASCII writing with "
112 <<
"Your merging tolerance (" << mergeTol <<
") is finer than this."
114 <<
"Please change your writeFormat to binary"
115 <<
" or increase the writePrecision" <<
endl
116 <<
"or adjust the merge tolerance (-mergeTol)."
120 scalar mergeDist = mergeTol * bb.
mag();
122 Info<<
"Overall meshes bounding box : " << bb <<
nl
123 <<
"Relative tolerance : " << mergeTol <<
nl
124 <<
"Absolute matching distance : " << mergeDist <<
nl
158 label maxProcCells = 0;
159 label totProcFaces = 0;
160 label maxProcPatches = 0;
161 label totProcPatches = 0;
162 label maxProcFaces = 0;
167 <<
"Processor " << procI <<
nl
168 <<
" Number of cells = " << globalCells.
localSize(procI)
171 label nProcFaces = 0;
173 const labelList& nei = patchNeiProcNo[procI];
175 forAll(patchNeiProcNo[procI], i)
177 Info<<
" Number of faces shared with processor "
178 << patchNeiProcNo[procI][i] <<
" = " << patchSize[procI][i]
181 nProcFaces += patchSize[procI][i];
184 Info<<
" Number of processor patches = " << nei.
size() <<
nl
185 <<
" Number of processor faces = " << nProcFaces <<
nl
186 <<
" Number of boundary faces = "
187 << globalBoundaryFaces.localSize(procI)-nProcFaces <<
endl;
189 maxProcCells =
max(maxProcCells, globalCells.
localSize(procI));
190 totProcFaces += nProcFaces;
191 totProcPatches += nei.
size();
192 maxProcPatches =
max(maxProcPatches, nei.
size());
193 maxProcFaces =
max(maxProcFaces, nProcFaces);
203 if (totProcPatches == 0)
207 if (totProcFaces == 0)
213 <<
"Number of processor faces = " << totProcFaces/2 <<
nl
214 <<
"Max number of cells = " << maxProcCells
215 <<
" (" << 100.0*(maxProcCells-avgProcCells)/avgProcCells
216 <<
"% above average " << avgProcCells <<
")" <<
nl
217 <<
"Max number of processor patches = " << maxProcPatches
218 <<
" (" << 100.0*(maxProcPatches-avgProcPatches)/avgProcPatches
219 <<
"% above average " << avgProcPatches <<
")" <<
nl
220 <<
"Max number of faces between processors = " << maxProcFaces
221 <<
" (" << 100.0*(maxProcFaces-avgProcFaces)/avgProcFaces
222 <<
"% above average " << avgProcFaces <<
")" <<
nl
250 cellDecomposition.
write();
252 Info<<
"Writing wanted cell distribution to volScalarField " <<
name
253 <<
" for postprocessing purposes." <<
nl <<
endl;
268 zeroGradientFvPatchScalarField::typeName
273 procCells[cI] = decomp[cI];
281 const Time& baseRunTime,
283 const bool decompose,
286 const bool writeCellDist,
304 <<
"You have selected decomposition method "
305 << decomposer.typeName
306 <<
" which does" <<
endl
307 <<
"not synchronise the decomposition across"
308 <<
" processor patches." <<
endl
309 <<
" You might want to select a decomposition method"
310 <<
" which is aware of this. Continuing."
317 <<
" to read decomposeParDict" <<
endl;
323 if (method.
found(
"weightField"))
325 word weightName = method.
lookup(
"weightField");
347 Info<<
"Restoring caseName to " << proc0CaseName <<
endl;
361 <<
" to write undecomposed cellDist" <<
endl;
365 tm.TimePaths::caseName() = baseRunTime.
caseName();
367 Info<<
"Restoring caseName to " << proc0CaseName <<
endl;
368 tm.TimePaths::caseName() = proc0CaseName;
382 const bool decompose,
395 "cellProcAddressing",
408 "faceProcAddressing",
421 "pointProcAddressing",
434 "boundaryProcAddressing",
539 bool cellOk = cellMap.
write();
541 bool pointOk = pointMap.
write();
542 bool patchOk = patchMap.
write();
544 if (!cellOk || !faceOk || !pointOk || !patchOk)
548 <<
", " <<
faceMap.objectPath()
558 template<
class GeoField>
572 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
590 template<
class GeoField>
613 <<
"differing fields of type " << GeoField::typeName
614 <<
" on processors." <<
endl
615 <<
"Master has:" << masterNames <<
endl
634 if (subsetterPtr.
valid())
641 if (!haveMesh[procI])
702 template<
class GeoField,
class CoupledPatchType>
707 mesh.objectRegistry::lookupClass<GeoField>()
712 GeoField&
fld = *iter();
714 typename GeoField::GeometricBoundaryField& bfld =
726 typename GeoField::PatchFieldType& pfld = bfld[
patchi];
730 if (pfld.patch().coupled())
748 typename GeoField::PatchFieldType& pfld = bfld[
patchi];
752 if (pfld.patch().coupled())
761 fld.mesh().globalData().patchSchedule();
763 forAll(patchSchedule, patchEvali)
766 typename GeoField::PatchFieldType& pfld = bfld[
patchi];
770 if (pfld.patch().coupled())
772 if (patchSchedule[patchEvali].init)
786 <<
"Unsuported communications type "
797 const Time& baseRunTime,
801 const bool doReadFields,
802 const bool decompose,
803 const bool overwrite,
805 const label nDestProcs,
846 const bool allHaveMesh = (
findIndex(haveMesh,
false) == -1);
856 if (isA<processorPolyPatch>(
patches[patchI]))
866 <<
"Cannot find non-processor patch on processor "
868 <<
" Current patches:" <<
patches.names()
875 subsetterPtr().setLargeCellSubset(
labelHashSet(0), nonProcI,
false);
882 runTime.TimePaths::caseName() = baseRunTime.
caseName();
887 runTime.TimePaths::caseName() = proc0CaseName;
891 <<
" have objects:" << objects.
names() <<
endl;
896 if (iter != objects.end())
906 runTime.TimePaths::caseName() = baseRunTime.
caseName();
932 volSphereTensorFields
980 surfSphereTensorFields
1027 dimSphereTensorFields
1052 runTime.TimePaths::caseName() = proc0CaseName;
1064 Info<<
"After distribution:" <<
endl;
1126 if (nDestProcs == 1)
1130 Info<<
"Setting caseName to " << baseRunTime.
caseName()
1131 <<
" to write reconstructed mesh and fields." <<
endl;
1132 runTime.TimePaths::caseName() = baseRunTime.
caseName();
1137 Info<<
"Restoring caseName to " << proc0CaseName <<
endl;
1138 runTime.TimePaths::caseName() = proc0CaseName;
1149 if (decompose || nDestProcs == 1)
1161 runTime.TimePaths::caseName() = baseRunTime.
caseName();
1177 runTime.TimePaths::caseName() = proc0CaseName;
1187 if (nDestProcs == 1)
1191 Info<<
"Setting caseName to " << baseRunTime.
caseName()
1192 <<
" to write reconstructed refinement data." <<
endl;
1193 runTime.TimePaths::caseName() = baseRunTime.
caseName();
1198 Info<<
"Restoring caseName to " << proc0CaseName <<
endl;
1199 runTime.TimePaths::caseName() = proc0CaseName;
1249 forAll(boundaryProcAddressing, i)
1251 if (boundaryProcAddressing[i] != -1)
1253 patchProcAddressing.
append(boundaryProcAddressing[i]);
1263 if (baseMeshPtr.
valid() && baseMeshPtr().nCells())
1265 const fvMesh& baseMesh = baseMeshPtr();
1274 cellAddressing.
xfer()
1284 faceAddressing.
xfer(),
1296 pointAddressing.
xfer()
1308 boundaryAddressing.
xfer()
1320 oldPatchStarts[patchI] = pbm[patchI].start();
1321 oldPatchNMeshPoints[patchI] = pbm[patchI].nPoints();
1331 oldPatchStarts.
xfer(),
1332 oldPatchNMeshPoints.
xfer(),
1350 cellConstructMap.
xfer()
1361 faceConstructMap.
xfer(),
1374 pointConstructMap.
xfer()
1387 patchConstructMap.
xfer()
1399 oldPatchStarts[patchI] = pbm[patchI].start();
1400 oldPatchNMeshPoints[patchI] = pbm[patchI].nPoints();
1410 oldPatchStarts.
xfer(),
1411 oldPatchNMeshPoints.
xfer(),
1448 Info<<
"Reading addressing from procXXXAddressing at "
1454 "cellProcAddressing",
1466 "faceProcAddressing",
1478 "pointProcAddressing",
1490 "boundaryProcAddressing",
1509 <<
"Read addressing inconsistent with mesh sizes" <<
nl
1511 <<
" addressing:" << cellProcAddressing.
objectPath()
1512 <<
" size:" << cellProcAddressing.
size() <<
nl
1517 <<
" addressing:" << pointProcAddressing.
objectPath()
1518 <<
" size:" << pointProcAddressing.
size()
1520 <<
" addressing:" << boundaryProcAddressing.
objectPath()
1521 <<
" size:" << boundaryProcAddressing.
size()
1532 pointProcAddressing,
1533 boundaryProcAddressing
1650 if (cloudNames.
size())
1652 if (!lagrangianReconstructorPtr.
valid())
1654 lagrangianReconstructorPtr.
reset
1666 lagrangianReconstructorPtr();
1670 Info<<
"Reconstructing lagrangian fields for cloud "
1671 << cloudNames[i] <<
nl <<
endl;
1690 selectedLagrangianFields
1697 selectedLagrangianFields
1704 selectedLagrangianFields
1711 selectedLagrangianFields
1718 selectedLagrangianFields
1725 selectedLagrangianFields
1733 selectedLagrangianFields
1741 selectedLagrangianFields
1748 selectedLagrangianFields
1756 selectedLagrangianFields
1763 selectedLagrangianFields
1770 selectedLagrangianFields
1836 selectedLagrangianFields
1843 selectedLagrangianFields
1850 selectedLagrangianFields
1859 selectedLagrangianFields
1866 selectedLagrangianFields
1873 selectedLagrangianFields
1882 selectedLagrangianFields
1889 selectedLagrangianFields
1896 selectedLagrangianFields
1905 selectedLagrangianFields
1912 selectedLagrangianFields
1919 selectedLagrangianFields
1928 selectedLagrangianFields
1935 selectedLagrangianFields
1942 selectedLagrangianFields
1951 selectedLagrangianFields
1958 selectedLagrangianFields
1965 selectedLagrangianFields
1975 const label nOldCells,
1982 if (!lagrangianReconstructorPtr.
valid())
1984 lagrangianReconstructorPtr.
reset
1996 lagrangianReconstructorPtr();
2126 int main(
int argc,
char *argv[])
2139 "specify the merge distance relative to the bounding box size "
2145 "write cell distribution as a labelList - for use with 'manual' "
2146 "decomposition method or as a volScalarField for post-processing."
2151 "only reconstruct new times (i.e. that do not exist already)"
2168 if (
env(
"FOAM_SIGFPE"))
2171 <<
"Detected floating point exception trapping (FOAM_SIGFPE)."
2172 <<
" This might give" <<
nl
2173 <<
" problems when mapping fields. Switch it off in case"
2174 <<
" of problems." <<
endl;
2185 Info<<
"Decomposing case (like decomposePar)" <<
nl <<
endl;
2189 <<
"Cannot specify both -decompose and -reconstruct"
2195 Info<<
"Reconstructing case (like reconstructParMesh)" <<
nl <<
endl;
2204 <<
"Working in decompose or reconstruction mode automatically"
2205 <<
" implies -overwrite" <<
nl <<
endl;
2214 <<
": This utility can only be run parallel"
2231 nfs = (roots.size() == 1);
2236 Info<<
"Detected multiple roots i.e. non-nfs running"
2244 Info<<
"Removing existing processor directories" <<
endl;
2252 Info<<
"No processor directories; switching on decompose mode"
2269 Info<<
"Creating time directories on all processors" <<
nl <<
endl;
2301 Info<<
"Creating time directories for undecomposed Time"
2302 <<
" on all processors" <<
nl <<
endl;
2319 Info<<
"Create undecomposed database"<<
nl <<
endl;
2337 masterTimeDirSet.
insert(baseTimeDirs[i].
name());
2354 Info<<
"Using mesh subdirectory " << meshSubDir <<
nl <<
endl;
2373 <<
"No times selected"
2383 <<
"Pass1 : reconstructing mesh and addressing" <<
nl <<
endl;
2408 runTime.
path()/facesInstance/meshSubDir/
"faces";
2410 Info<<
"Checking for mesh in " << meshPath <<
nl <<
endl;
2416 Info<<
"Per processor mesh availability : " << haveMesh <<
endl;
2427 bool haveAddressing =
false;
2432 "faceProcAddressing",
2442 haveAddressing =
true;
2447 Info<<
"loading mesh from " << facesInstance <<
endl;
2472 Info<<
"Reconstructing mesh for time " << facesInstance <<
endl;
2474 label nDestProcs = 1;
2500 <<
"Pass2 : reconstructing fields" <<
nl <<
endl;
2507 Info<<
"Reading undecomposed mesh (on master)" <<
endl;
2520 Info<<
"Reading local, decomposed mesh" <<
endl;
2526 baseMeshPtr().facesInstance(),
2558 Info<<
" Dected initial mesh motion; reconstructing points" <<
nl
2560 fvReconstructorPtr().reconstructPoints();
2567 if (newTimes && masterTimeDirSet.
found(
timeDirs[timeI].name()))
2586 Info<<
" Dected mesh motion; reconstructing points" <<
nl
2588 fvReconstructorPtr().reconstructPoints();
2596 Info<<
" Detected topology change; reconstructing addressing"
2599 if (baseMeshPtr.
valid())
2604 baseMeshPtr.
clear();
2622 fvReconstructorPtr.reset
2632 lagrangianReconstructorPtr.
clear();
2643 fvReconstructorPtr(),
2651 lagrangianReconstructorPtr,
2655 selectedLagrangianFields
2663 if (
isDir(uniformDir0))
2665 Info<<
"Detected additional non-decomposed files in "
2666 << uniformDir0 <<
endl;
2695 Info<<
"Setting time to that of master or undecomposed case : "
2696 << masterTime <<
endl;
2697 runTime.
setTime(masterTime, 0);
2711 Info<<
"Setting caseName to " << baseRunTime.
caseName()
2712 <<
" to find undecomposed mesh" <<
endl;
2713 runTime.TimePaths::caseName() = baseRunTime.
caseName();
2725 Info<<
"Restoring caseName to " << proc0CaseName <<
endl;
2726 runTime.TimePaths::caseName() = proc0CaseName;
2733 runTime.
path()/masterInstDir/meshSubDir/
"faces";
2735 Info<<
"Checking for mesh in " << meshPath <<
nl <<
endl;
2742 Info<<
"Per processor mesh availability : " << haveMesh <<
endl;
2749 Info<<
"Setting caseName to " << baseRunTime.
caseName()
2750 <<
" to read undecomposed mesh" <<
endl;
2751 runTime.TimePaths::caseName() = baseRunTime.
caseName();
2767 Info<<
"Restoring caseName to " << proc0CaseName <<
endl;
2768 runTime.TimePaths::caseName() = proc0CaseName;
2791 if (
isDir(decompDictFile))
2793 decompDictFile = decompDictFile /
"decomposeParDict";
2823 runTime.TimePaths::caseName() = baseRunTime.
caseName();
2838 selectedLagrangianFields,
2843 runTime.TimePaths::caseName() = proc0CaseName;
2869 lagrangianReconstructorPtr,
2878 const fileName uniformDir(
"uniform");
2881 Info<<
"Detected additional non-decomposed files in "
autoPtr< mapDistributePolyMesh > createReconstructMap(const autoPtr< fvMesh > &baseMeshPtr, const fvMesh &mesh, const labelList &cellProcAddressing, const labelList &faceProcAddressing, const labelList &pointProcAddressing, const labelList &boundaryProcAddressing)
passiveParticleCloud but with autoMap and writing disabled. Only used for its objectRegistry to store...
const labelListList & subMap() const
From subsetted data back to original data.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
void reconstructMeshFields(const parFvFieldReconstructor &fvReconstructor, const IOobjectList &objects, const HashSet< word > &selectedFields)
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
bool constructHasFlip() const
Does constructMap include a sign.
void redistributeStoredLagrangianFields(const mapDistributeBase &map, passiveParticleCloud &cloud) const
Redistribute and write stored lagrangian fields.
GeometricField< tensor, fvPatchField, volMesh > volTensorField
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
bool env(const word &)
Return true if environment variable of given name is defined.
scalar mag() const
The magnitude of the bounding box span.
static void readLagrangianFields(const passiveParticleCloud &cloud, const IOobjectList &objects, const HashSet< word > &selectedFields)
Read and store all fields of a cloud.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
autoPtr< mapDistributeBase > redistributeLagrangianPositions(passiveParticleCloud &cloud) const
Redistribute and write lagrangian positions.
A class for handling words, derived from string.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
A class for handling file names.
A primitive field of type <T> with automated input and output.
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)
Load or create (0 size) a mesh. Used in distributing meshes to a larger number of processors.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
static word defaultRegion
Return the default region name.
#define forAll(list, i)
Loop across all elements in list.
This boundary condition enables processor communication across patches.
A class for managing temporary objects.
Post-processing mesh subset tool. Given the original mesh and the list of selected cells,...
const fileName & caseName() const
Return case name.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
void readField(const IOobject &io, const fvMesh &mesh, const label i, PtrList< GeoField > &fields)
const labelList & processorPatches() const
Return list of processor patch labels.
static void distribute(const Pstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &, const negateOp &negOp, const int tag=UPstream::msgType())
Distribute data. Note:schedule only used for Pstream::scheduled.
Xfer< List< T > > xfer()
Transfer contents to the Xfer container.
void writeDecomposition(const word &name, const fvMesh &mesh, const labelList &decomp)
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
instantList times() const
Search the case for valid time directories.
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.
IOstream::streamFormat writeFormat() const
Default write format.
void distributeCellData(List< T > &lst) const
Distribute list of cell data.
void correctCoupledBoundaryConditions(fvMesh &mesh)
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
static bool & parRun()
Is this a parallel run?
Class containing functor to negate primitives. Dummy for all other types.
void printMeshData(const polyMesh &mesh)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
static const NamedEnum< commsTypes, 3 > commsTypeNames
const functionObjectList & functionObjects() const
Return the list of function objects.
wordList sortedNames() const
Return the sorted list of names of the IOobjects.
const fileName & facesInstance() const
Return the current instance directory for faces.
virtual bool write() const
Write using setting from DB.
static void waitRequests(const label start=0)
Wait until all requests (from start onwards) have finished.
void combineReduce(const List< UPstream::commsStruct > &comms, T &Value, const CombineOp &cop, const int tag, const label comm)
int neighbProcNo() const
Return neigbour processor number.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
Extract command arguments and options from the supplied argc and argv parameters.
label localSize() const
My local size.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static commsTypes defaultCommsType
Default commsType.
A Field of objects of type <T> with automated input and output using a compact storage....
wordList names() const
Return the list of names of the IOobjects.
bool cp(const fileName &src, const fileName &dst)
Copy, recursively if necessary, the source to the destination.
writeOption writeOpt() const
A HashTable with keys but without contents.
MeshObject wrapper of decompositionMethod.
const fileName & rootPath() const
Return root path.
Mesh consisting of general polyhedral cells.
const mapDistribute & cellMap() const
Cell distribute map.
void redistributeLagrangianFields(const mapDistributeBase &map, const word &cloudName, const IOobjectList &objects, const HashSet< word > &selectedFields) const
Read, redistribute and write all/selected lagrangian fields.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
fileName objectPath() const
Return complete path + object name.
virtual bool write() const
Write mesh using IO settings from time.
bool headerOk()
Read and check header info.
scalar getMergeDistance(const argList &args, const Time &runTime, const boundBox &bb)
const fileName & pointsInstance() const
Return the current instance directory for points.
autoPtr< fvMesh > loadOrCreateMesh(const IOobject &io)
Load (if it exists) or create zero cell mesh given an IOobject:
virtual bool parallelAware() const =0
Is method parallel aware (i.e. does it synchronize domains across.
const fileName & rootPath() const
Return root path.
bool set(const label) const
Is element set.
void determineDecomposition(const Time &baseRunTime, const fileName &decompDictFile, const bool decompose, const fileName &proc0CaseName, const fvMesh &mesh, const bool writeCellDist, label &nDestProcs, labelList &decomp)
void redistributeLagrangian(autoPtr< parLagrangianRedistributor > &lagrangianReconstructorPtr, const fvMesh &mesh, const label nOldCells, const mapDistributePolyMesh &distMap, PtrList< unmappedPassiveParticleCloud > &clouds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Pre-declare SubField and related Field type.
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
const word & system() const
Return system name.
virtual void off()
Switch the function objects off.
void reconstructFvVolumeInternalFields(const IOobjectList &objects, const HashSet< word > &selectedFields) const
Read, reconstruct and write all/selected volume internal fields.
Lagrangian field redistributor.
fileName timePath() const
Return current time path.
const mapDistribute & faceMap() const
Face distribute map.
Class containing processor-to-processor mapping information.
decompositionMethod & decomposer() const
const mapDistribute & patchMap() const
Patch distribute map.
InternalField & internalField()
Return internal field.
Neighbour processor patch.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
GeometricField< scalar, fvPatchField, volMesh > volScalarField
static int masterNo()
Process index of the master.
void distribute(const mapDistributePolyMesh &)
In-place distribute.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
void readLagrangian(const fvMesh &mesh, const wordList &cloudNames, const HashSet< word > &selectedLagrangianFields, PtrList< unmappedPassiveParticleCloud > &clouds)
Various for reading/decomposing/reconstructing/distributing refinement data.
fileCheckTypes
Types of communications.
static instantList selectIfPresent(Time &runTime, const argList &args)
If any time option provided return the set of times (as select0)
const labelList & oldPatchSizes() const
List of the old patch sizes.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
fileName path() const
Return the path to the caseName.
static void findClouds(const fvMesh &, wordList &cloudNames, List< wordList > &objectNames)
Find all clouds (on all processors) and for each cloud all.
A list of keyword definitions, which are a keyword followed by any number of values (e....
const dictionary & controlDict() const
label nInternalFaces() const
void readProcAddressing(const fvMesh &mesh, const autoPtr< fvMesh > &baseMeshPtr, autoPtr< mapDistributePolyMesh > &distMap)
virtual void setTime(const Time &)
Reset the time and time-index to those of the given time.
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))
Xfer< mapDistributePolyMesh > xfer()
Transfer contents to the Xfer container.
Generic dimensioned Type class.
Abstract base class for decomposition.
bool subHasFlip() const
Does subMap include a sign.
static const scalar defaultMergeTol
bool found(const Key &) const
Return true if hashedEntry is found in table.
void transfer(mapDistributePolyMesh &)
Transfer the contents of the argument and annul the argument.
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Mesh data needed to do the Finite Volume discretisation.
errorManip< error > abort(error &err)
bool isFile(const fileName &, const bool checkGzip=true)
Does the name exist as a FILE in the file system?
bool isDir(const fileName &)
Does the name exist as a DIRECTORY in the file system?
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
IOobjectList lookupClass(const word &className) const
Return the list for all IOobjects of a given class.
const double e
Elementary charge.
void reconstructFvSurfaceFields(const IOobjectList &objects, const HashSet< word > &selectedFields) const
Read, reconstruct and write all/selected surface fields.
Templated 3D SphericalTensor derived from VectorSpace adding construction from 1 component,...
List of IOobjects with searching and retrieving facilities.
word findInstance(const fileName &dir, const word &name=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
Return the location of "dir" containing the file "name".
void sync(const IOobject &io)
Parallel synchronise. This enforces valid objects on all processors.
Helper class for list to append unique elelements of y onto the end of x.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
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.
readUpdateState
Enumeration defining the state of the mesh after a read update.
An STL-conforming hash table.
GeometricField< vector, fvPatchField, volMesh > volVectorField
void setInstance(const fileName &)
Set the instance for mesh files.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const boundBox & bounds() const
Return mesh bounding box.
static const word prefix
The prefix to local: lagrangian.
static fileCheckTypes fileModificationChecking
label constructSize() const
Constructed data size.
HashTable< T *, Key, Hash >::iterator iterator
static const decompositionModel & New(const polyMesh &mesh, const fileName &decompDictFile="")
Read (optionallly from absolute path) & register on mesh.
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...
static instantList timeDirs
virtual labelList decompose(const pointField &points, const scalarField &pointWeights)
Return for every coordinate the wanted processor number.
static int & msgType()
Message tag of standard messages.
#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.
static label nRequests()
Get number of outstanding requests.
fileName path() const
Return path.
static unsigned int defaultPrecision()
Return the default precision.
const fileName & caseName() const
Return case name.
label size() const
Global sum of localSizes.
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
void redistributeLagrangianFieldFields(const mapDistributeBase &map, const word &cloudName, const IOobjectList &objects, const HashSet< word > &selectedFields) const
Read, redistribute and write all/selected lagrangian fieldFields.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
wordList fieldNames(const IOobjectList &objects, const bool syncPar)
Get sorted names of fields of type. If syncPar and running in parallel.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
IOmapDistributePolyMesh is derived from mapDistributePolyMesh and IOobject to give the mapDistributeP...
static instantList findTimes(const fileName &, const word &constantName="constant")
Search a given directory for valid time directories.
int main(int argc, char *argv[])
const word & constant() const
Return constant name.
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set).
bool erase(iterator &)
Erase an hashedEntry specified by given iterator.
label size() const
Return the number of elements in the PtrList.
bool insert(const Key &key)
Insert a new entry.
autoPtr< mapDistributePolyMesh > distribute(const labelList &dist)
Send cells to neighbours according to distribution.
bool optionFound(const word &opt) const
Return true if the named option is found.
PtrList< labelIOList > & faceProcAddressing
A bounding box defined in terms of the points at its extremities.
void clear()
Delete object (if the pointer is valid) and set pointer to NULL.
void writeProcAddressing(const bool decompose, const fileName &meshSubDir, const fvMesh &mesh, const mapDistributePolyMesh &map)
void reverseDistribute(const label constructSize, List< T > &, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Reverse distribute data using default commsType.
void reset(T *=0)
If object pointer already set, delete object and set to given.
instantList select(const instantList &) const
Select a list of Time values that are within the ranges.
const Time & time() const
Return the top-level database.
Input inter-processor communications stream.
const mapDistribute & pointMap() const
Point distribute map.
void reconstructLagrangian(autoPtr< parLagrangianRedistributor > &lagrangianReconstructorPtr, const fvMesh &baseMesh, const fvMesh &mesh, const mapDistributePolyMesh &distMap, const HashSet< word > &selectedLagrangianFields)
label nOldFaces() const
Number of faces in mesh before distribution.
GeometricField< sphericalTensor, fvPatchField, volMesh > volSphericalTensorField
void reconstructFvVolumeFields(const IOobjectList &objects, const HashSet< word > &selectedFields) const
Read, reconstruct and write all/selected volume fields.
void size(const label)
Override size to be inconsistent with allocated storage.
const fileName & globalCaseName() const
Return global case name.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
const globalMeshData & globalData() const
Return parallel info.
label nOldPoints() const
Number of points in mesh before distribution.
label nOldCells() const
Number of cells in mesh before distribution.
autoPtr< mapDistributePolyMesh > redistributeAndWrite(const Time &baseRunTime, const scalar tolDim, const boolList &haveMesh, const fileName &meshSubDir, const bool doReadFields, const bool decompose, const bool overwrite, const fileName &proc0CaseName, const label nDestProcs, const labelList &decomp, const fileName &masterInstDir, fvMesh &mesh)
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
Generic GeometricField class.
const labelListList & constructMap() const
From subsetted data to new reconstructed data.
Xfer< mapDistribute > xfer()
Transfer contents to the Xfer container.
Foam::argList args(argc, argv)
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
void distributePointData(List< T > &lst) const
Distribute list of point data.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
#define WarningInFunction
Report a warning using Foam::Warning.
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
bool rmDir(const fileName &)
Remove a dirctory and its contents.
const fileName & globalCaseName() const
Return case name.
void readFields(const typename GeoMesh::Mesh &mesh, const IOobjectList &objects, PtrList< GeometricField< Type, PatchField, GeoMesh > > &fields, const bool readOldTime)
word name(const complex &)
Return a string representation of a complex.
Finite volume reconstructor for volume and surface fields.