Functions | Variables
redistributePar.C File Reference

Redistributes existing decomposed mesh and fields according to the current settings in the decomposeParDict file. More...

Include dependency graph for redistributePar.C:

Go to the source code of this file.

Functions

scalar getMergeDistance (const argList &args, const Time &runTime, const boundBox &bb)
 
void printMeshData (const polyMesh &mesh)
 
void writeDecomposition (const word &name, const fvMesh &mesh, const labelList &decomp)
 
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 writeProcAddressing (const bool decompose, const fileName &meshSubDir, const fvMesh &mesh, const mapDistributePolyMesh &map)
 
template<class GeoField >
void readField (const IOobject &io, const fvMesh &mesh, const label i, PtrList< GeoField > &fields)
 
template<class Type , template< class > class PatchField, class GeoMesh >
void readField (const IOobject &io, const fvMesh &mesh, const label i, PtrList< GeometricField< Type, PatchField, GeoMesh > > &fields)
 
template<class GeoField >
void readFields (const boolList &haveMesh, const fvMesh &mesh, const autoPtr< fvMeshSubset > &subsetterPtr, IOobjectList &allObjects, PtrList< GeoField > &fields)
 
template<class GeoField , class CoupledPatchType >
void correctCoupledBoundaryConditions (fvMesh &mesh)
 
autoPtr< mapDistributePolyMeshredistributeAndWrite (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)
 
autoPtr< mapDistributePolyMeshcreateReconstructMap (const autoPtr< fvMesh > &baseMeshPtr, const fvMesh &mesh, const labelList &cellProcAddressing, const labelList &faceProcAddressing, const labelList &pointProcAddressing, const labelList &boundaryProcAddressing)
 
void readProcAddressing (const fvMesh &mesh, const autoPtr< fvMesh > &baseMeshPtr, autoPtr< mapDistributePolyMesh > &distMap)
 
void reconstructMeshFields (const parFvFieldReconstructor &fvReconstructor, const IOobjectList &objects, const HashSet< word > &selectedFields)
 
void reconstructLagrangian (autoPtr< parLagrangianRedistributor > &lagrangianReconstructorPtr, const fvMesh &baseMesh, const fvMesh &mesh, const mapDistributePolyMesh &distMap, const HashSet< word > &selectedLagrangianFields)
 
void readLagrangian (const fvMesh &mesh, const wordList &cloudNames, const HashSet< word > &selectedLagrangianFields, PtrList< unmappedPassiveParticleCloud > &clouds)
 
void redistributeLagrangian (autoPtr< parLagrangianRedistributor > &lagrangianReconstructorPtr, const fvMesh &mesh, const label nOldCells, const mapDistributePolyMesh &distMap, PtrList< unmappedPassiveParticleCloud > &clouds)
 
int main (int argc, char *argv[])
 

Variables

static const scalar defaultMergeTol = 1e-6
 

Detailed Description

Redistributes existing decomposed mesh and fields according to the current settings in the decomposeParDict file.

Original source file redistributePar.C

Must be run on maximum number of source and destination processors. Balances mesh and writes new mesh to new time directory.

Usage
Parameters
-regionregionName
Distribute named region.
-decompose
Remove any existing processor subdirectories and decomposes the geometry. Equivalent to running without processor subdirectories.
-reconstruct
Reconstruct geometry (like reconstructParMesh). Equivalent to setting numberOfSubdomains 1 in the decomposeParDict.
-newTimes
(in combination with -reconstruct) reconstruct only new times.
-cellDist
Write the cell distribution as a labelList, for use with 'manual' decomposition method or as a volScalarField for post-processing.

Definition in file redistributePar.C.

Function Documentation

◆ getMergeDistance()

scalar getMergeDistance ( const argList args,
const Time runTime,
const boundBox bb 
)

Definition at line 89 of file redistributePar.C.

References args, IOstream::ASCII, defaultMergeTol, IOstream::defaultPrecision(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::Info, boundBox::mag(), Foam::nl, argList::optionReadIfPresent(), Foam::pow(), and Time::writeFormat().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printMeshData()

void printMeshData ( const polyMesh mesh)

◆ writeDecomposition()

void writeDecomposition ( const word name,
const fvMesh mesh,
const labelList decomp 
)

Definition at line 226 of file redistributePar.C.

References IOobject::AUTO_WRITE, Foam::dimless, Foam::endl(), polyMesh::facesInstance(), forAll, Foam::Info, mesh, Foam::name(), Foam::nl, IOobject::NO_READ, IOobject::NO_WRITE, fvMesh::time(), Time::timeName(), and regIOobject::write().

Referenced by determineDecomposition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ determineDecomposition()

void determineDecomposition ( const Time baseRunTime,
const fileName decompDictFile,
const bool  decompose,
const fileName proc0CaseName,
const fvMesh mesh,
const bool  writeCellDist,
label nDestProcs,
labelList decomp 
)

◆ writeProcAddressing()

void writeProcAddressing ( const bool  decompose,
const fileName meshSubDir,
const fvMesh mesh,
const mapDistributePolyMesh map 
)

◆ readField() [1/2]

void readField ( const IOobject io,
const fvMesh mesh,
const label  i,
PtrList< GeoField > &  fields 
)

Definition at line 557 of file redistributePar.C.

References fields, and mesh.

Referenced by vtkUnstructuredReader::readFieldArray(), readFields(), and DimensionedField< Type, Foam::pointMesh >::readIfPresent().

Here is the caller graph for this function:

◆ readField() [2/2]

void readField ( const IOobject io,
const fvMesh mesh,
const label  i,
PtrList< GeometricField< Type, PatchField, GeoMesh > > &  fields 
)

Definition at line 571 of file redistributePar.C.

References fields, and mesh.

◆ readFields()

void readFields ( const boolList haveMesh,
const fvMesh mesh,
const autoPtr< fvMeshSubset > &  subsetterPtr,
IOobjectList allObjects,
PtrList< GeoField > &  fields 
)

Definition at line 589 of file redistributePar.C.

References Foam::abort(), IOobject::AUTO_WRITE, UPstream::blocking, Foam::endl(), Foam::FatalError, FatalErrorInFunction, fields, forAll, IOobjectList::lookupClass(), UPstream::master(), UPstream::masterNo(), mesh, UPstream::myProcNo(), Foam::name(), IOobject::NO_READ, UPstream::nProcs(), readField(), Pstream::scatter(), List::size(), IOobjectList::sortedNames(), fvMesh::time(), Time::timeName(), autoPtr::valid(), and IOobject::writeOpt().

Referenced by CollidingCloud< CloudType >::CollidingCloud(), DSMCCloud< DSMCParcel< ParcelType > >::DSMCCloud(), indexedParticleCloud::indexedParticleCloud(), Cloud< streamLineParticle >::initCloud(), KinematicCloud< CloudType >::KinematicCloud(), main(), MPPICCloud< CloudType >::MPPICCloud(), passiveParticleCloud::passiveParticleCloud(), ReactingCloud< CloudType >::ReactingCloud(), ReactingMultiphaseCloud< CloudType >::ReactingMultiphaseCloud(), wallBoundedStreamLineParticle::readFields(), GeometricField< vector, pointPatchField, pointMesh >::readFields(), MPPICParcel::readFields(), CollidingParcel::readFields(), DSMCParcel::readFields(), ReactingParcel::readFields(), ReactingMultiphaseParcel::readFields(), ThermoParcel::readFields(), SprayParcel::readFields(), KinematicParcel::readFields(), GeometricField< vector, pointPatchField, pointMesh >::readIfPresent(), solidParticleCloud::solidParticleCloud(), SprayCloud< CloudType >::SprayCloud(), streamLineParticleCloud::streamLineParticleCloud(), ThermoCloud< CloudType >::ThermoCloud(), and wallBoundedStreamLineParticleCloud::wallBoundedStreamLineParticleCloud().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctCoupledBoundaryConditions()

void correctCoupledBoundaryConditions ( fvMesh mesh)

◆ redistributeAndWrite()

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 
)

◆ createReconstructMap()

autoPtr<mapDistributePolyMesh> createReconstructMap ( const autoPtr< fvMesh > &  baseMeshPtr,
const fvMesh mesh,
const labelList cellProcAddressing,
const labelList faceProcAddressing,
const labelList pointProcAddressing,
const labelList boundaryProcAddressing 
)

◆ readProcAddressing()

void readProcAddressing ( const fvMesh mesh,
const autoPtr< fvMesh > &  baseMeshPtr,
autoPtr< mapDistributePolyMesh > &  distMap 
)

◆ reconstructMeshFields()

void reconstructMeshFields ( const parFvFieldReconstructor fvReconstructor,
const IOobjectList objects,
const HashSet< word > &  selectedFields 
)

Definition at line 1537 of file redistributePar.C.

References parFvFieldReconstructor::reconstructFvSurfaceFields(), parFvFieldReconstructor::reconstructFvVolumeFields(), and parFvFieldReconstructor::reconstructFvVolumeInternalFields().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reconstructLagrangian()

void reconstructLagrangian ( autoPtr< parLagrangianRedistributor > &  lagrangianReconstructorPtr,
const fvMesh baseMesh,
const fvMesh mesh,
const mapDistributePolyMesh distMap,
const HashSet< word > &  selectedLagrangianFields 
)

◆ readLagrangian()

void readLagrangian ( const fvMesh mesh,
const wordList cloudNames,
const HashSet< word > &  selectedLagrangianFields,
PtrList< unmappedPassiveParticleCloud > &  clouds 
)

◆ redistributeLagrangian()

void redistributeLagrangian ( autoPtr< parLagrangianRedistributor > &  lagrangianReconstructorPtr,
const fvMesh mesh,
const label  nOldCells,
const mapDistributePolyMesh distMap,
PtrList< unmappedPassiveParticleCloud > &  clouds 
)

Definition at line 1969 of file redistributePar.C.

References forAll, mesh, parLagrangianRedistributor::redistributeLagrangianPositions(), parLagrangianRedistributor::redistributeStoredLagrangianFields(), autoPtr::reset(), PtrList::size(), and autoPtr::valid().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 2123 of file redistributePar.C.

References argList::addBoolOption(), argList::addOption(), timeSelector::addOptions(), args, polyMesh::bounds(), Time::caseName(), autoPtr::clear(), Foam::combineReduce(), TimePaths::constant(), Time::controlDict(), Foam::cp(), polyMesh::defaultRegion, determineDecomposition(), Foam::endl(), Foam::env(), Foam::exit(), polyMesh::facesInstance(), Foam::FatalError, FatalErrorInFunction, Foam::fieldNames(), parLagrangianRedistributor::findClouds(), Time::findInstance(), Time::findTimes(), forAll, HashTable< nil, word, string::hash >::found(), Time::functionObjects(), Pstream::gatherList(), getMergeDistance(), TimePaths::globalCaseName(), argList::globalCaseName(), IOobject::headerOk(), Foam::Info, HashSet< Key, Hash >::insert(), Foam::isDir(), Foam::isFile(), Foam::loadOrCreateMesh(), UPstream::master(), mesh, meshPtr, polyMesh::meshSubDir, Foam::mkDir(), IOobject::MUST_READ, UPstream::myProcNo(), Foam::name(), primitiveMesh::nCells(), fvMeshTools::newMesh(), Foam::nl, UPstream::nProcs(), functionObjectList::off(), argList::optionFound(), argList::optionReadIfPresent(), UPstream::parRun(), argList::path(), Time::path(), polyMesh::POINTS_MOVED, polyMesh::pointsInstance(), IOobject::READ_IF_PRESENT, readLagrangian(), readProcAddressing(), fvMesh::readUpdate(), Foam::fvc::reconstruct(), reconstructLagrangian(), reconstructMeshFields(), redistributeAndWrite(), redistributeLagrangian(), regionName, autoPtr::reset(), Foam::returnReduce(), Foam::rmDir(), argList::rootPath(), Time::rootPath(), Pstream::scatter(), Pstream::scatterList(), timeSelector::select(), timeSelector::selectIfPresent(), Time::setTime(), List::size(), TimePaths::system(), timeDirs, Time::timeName(), Time::timePath(), Time::times(), polyMesh::TOPO_CHANGE, polyMesh::TOPO_PATCH_CHANGE, autoPtr::valid(), and WarningInFunction.

Variable Documentation

◆ defaultMergeTol

const scalar defaultMergeTol = 1e-6
static

Definition at line 84 of file redistributePar.C.

Referenced by getMergeDistance().