92 label maxProcCells = 0;
93 label totProcFaces = 0;
94 label maxProcPatches = 0;
95 label totProcPatches = 0;
96 label maxProcFaces = 0;
101 <<
"Processor " << proci <<
nl
102 <<
" Number of cells = " << globalCells.localSize(proci)
105 label nProcFaces = 0;
107 const labelList& nei = patchNeiProcNo[proci];
109 forAll(patchNeiProcNo[proci], i)
111 Info<<
" Number of faces shared with processor "
112 << patchNeiProcNo[proci][i] <<
" = " << patchSize[proci][i]
115 nProcFaces += patchSize[proci][i];
118 Info<<
" Number of processor patches = " << nei.
size() <<
nl
119 <<
" Number of processor faces = " << nProcFaces <<
nl
120 <<
" Number of boundary faces = "
121 << globalBoundaryFaces.localSize(proci) <<
endl;
123 maxProcCells =
max(maxProcCells, globalCells.localSize(proci));
124 totProcFaces += nProcFaces;
125 totProcPatches += nei.
size();
126 maxProcPatches =
max(maxProcPatches, nei.
size());
127 maxProcFaces =
max(maxProcFaces, nProcFaces);
137 if (totProcPatches == 0)
141 if (totProcFaces == 0)
147 <<
"Number of processor faces = " << totProcFaces/2 <<
nl
148 <<
"Max number of cells = " << maxProcCells
149 <<
" (" << 100.0*(maxProcCells-avgProcCells)/avgProcCells
150 <<
"% above average " << avgProcCells <<
")" <<
nl
151 <<
"Max number of processor patches = " << maxProcPatches
152 <<
" (" << 100.0*(maxProcPatches-avgProcPatches)/avgProcPatches
153 <<
"% above average " << avgProcPatches <<
")" <<
nl
154 <<
"Max number of faces between processors = " << maxProcFaces
155 <<
" (" << 100.0*(maxProcFaces-avgProcFaces)/avgProcFaces
156 <<
"% above average " << avgProcFaces <<
")" <<
nl
162 void writeDecomposition
169 Info<<
"Writing wanted cell distribution to volScalarField " <<
name
170 <<
" for postprocessing purposes." <<
nl <<
endl;
185 extrapolatedCalculatedFvPatchScalarField::typeName
190 procCells[cI] = decomp[cI];
192 procCells.correctBoundaryConditions();
198 template<
class GeoField>
202 const typename GeoField::Mesh&
mesh,
221 <<
"differing fields of type " << GeoField::typeName
222 <<
" on processors." <<
endl
223 <<
"Master has:" << masterNames <<
endl
228 fields.setSize(masterNames.size());
243 if (subsetterPtr.
valid())
250 if (!haveMesh[proci])
313 int main(
int argc,
char *argv[])
325 if (
env(
"FOAM_SIGFPE"))
328 <<
"Detected floating point exception trapping (FOAM_SIGFPE)."
329 <<
" This might give" <<
nl
330 <<
" problems when mapping fields. Switch it off in case"
331 <<
" of problems." <<
endl;
348 runTime.setTime(times[0], 0);
361 Info<<
"Using mesh subdirectory " << meshSubDir <<
nl <<
endl;
372 masterInstDir = runTime.findInstance(meshSubDir,
"points");
377 const fileName meshAbsolutePath = runTime.
path()/masterInstDir/meshSubDir;
379 Info<<
"Found points in " << meshAbsolutePath <<
nl <<
endl;
386 Info<<
"Per processor mesh availability : " << haveMesh <<
endl;
387 const bool allHaveMesh = (
findIndex(haveMesh,
false) == -1);
404 Info<<
"Before distribution:" <<
endl;
426 writeDecomposition(
"decomposition",
mesh, finalDecomp);
456 <<
"Cannot find non-processor patch on processor "
464 subsetterPtr().setLargeCellSubset(
labelHashSet(0), nonProci,
false);
508 volSphereTensorFields
561 surfSphereTensorFields
616 pointSphereTensorFields
626 pointSymmTensorFields
657 Info<<
"After distribution:" <<
endl;
669 Info<<
"Writing redistributed mesh to " << runTime.name() <<
nl <<
endl;
683 <<
"You can pick up the redecomposed mesh from the polyMesh directory"
684 <<
" in " << runTime.name() <<
"." <<
nl
685 <<
"If you redecomposed the mesh to less processors you can delete"
687 <<
"the processor directories with 0 sized meshes in them." <<
nl
688 <<
"Below is a sample set of commands to do this."
689 <<
" Take care when issuing these" <<
nl
690 <<
"commands." <<
nl <<
endl;
696 if (nFaces[proci] == 0)
698 Info<<
" rm -r " << procDir.c_str() <<
nl;
703 fileName constDir = procDir/runTime.constant()/meshSubDir;
705 Info<<
" rm -r " << constDir.c_str() <<
nl
706 <<
" mv " << timeDir.c_str()
707 <<
' ' << constDir.c_str() <<
nl;
Inter-processor communication reduction functions.
#define forAll(list, i)
Loop across all elements in list.
static pointMesh & New(const word &name, const polyMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
Generic GeometricField class.
HashTable< IOobject *, word, string::hash >::iterator iterator
List of IOobjects with searching and retrieving facilities.
IOobjectList lookupClass(const word &className) const
Return the list for all IOobjects of a given class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
writeOption writeOpt() const
static fileCheckTypes fileModificationChecking
Type of file modification checking.
Input inter-processor communications stream.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
Output inter-processor communications stream.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
label size() const
Return the number of elements in the UList.
static int masterNo()
Process index of the master.
static bool master(const label communicator=0)
Am I the master process.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
fileName path() const
Return the path to the caseName.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set)
void reset(T *=nullptr)
If object pointer already set, delete object and set to given.
static IOdictionary decomposeParDict(const Time &time)
Read and return the decomposeParDict.
static autoPtr< decompositionMethod > NewDistributor(const dictionary &decompositionDict)
Return a reference to the selected decomposition method.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
const word & name() const
Return const reference to name.
A class for handling file names.
word name() const
Return file name (part beyond last /)
fileName path() const
Return directory path name (part before last /)
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
Post-processing mesh subset tool. Given the original mesh and the list of selected cells,...
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
virtual const objectRegistry & thisDb() const
Return the object registry - resolve conflict polyMesh/lduMesh.
virtual bool write(const bool write=true) const
Write mesh using IO settings from time.
const word & name() const
Return reference to name.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
const labelList & processorPatches() const
Return list of processor patch labels.
const Time & time() const
Return time.
Mesh representing a set of points created from polyMesh.
Mesh consisting of general polyhedral cells.
static word defaultRegion
Return the default region name.
const globalMeshData & globalData() const
Return parallel info.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
void setInstance(const fileName &)
Set the instance for mesh files.
label nInternalFaces() const
const vectorField & cellCentres() const
Neighbour processor patch.
int neighbProcNo() const
Return neighbour processor number.
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
static instantList selectIfPresent(Time &runTime, const argList &args)
If any time option provided return the set of times (as select0)
A class for managing temporary objects.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
int main(int argc, char *argv[])
const fvPatchList & patches
Info<< "Calculating turbulent flame speed field St\n"<< endl;volScalarField St(IOobject("St", runTime.name(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), flameWrinkling->Xi() *Su);multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Load or create (0 size) a mesh. Used in distributing meshes to a larger number of processors.
#define WarningInFunction
Report a warning using Foam::Warning.
bool env(const word &)
Return true if environment variable of given name is defined.
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 mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const HashSet< word > &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the specified type.
errorManip< error > abort(error &err)
const dimensionSet dimless
const word & regionName(const solver ®ion)
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a directory in the file system?
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
prefixOSstream Pout(cout, "Pout")
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
autoPtr< fvMesh > loadOrCreateMesh(const IOobject &io)
Load (if it exists) or create zero cell mesh given an IOobject:
Foam::argList args(argc, argv)