Redistributes existing decomposed mesh and fields according to the current settings in the decomposeParDict file. More...
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< 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) |
autoPtr< mapDistributePolyMesh > | createReconstructMap (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 |
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.
-region | regionName 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.
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().
void printMeshData | ( | const polyMesh & | mesh | ) |
Definition at line 128 of file redistributePar.C.
References polyMesh::boundaryMesh(), Foam::endl(), forAll, Pstream::gatherList(), polyMesh::globalData(), Foam::Info, globalIndex::localSize(), Foam::max(), mesh, UPstream::myProcNo(), primitiveMesh::nCells(), processorPolyPatch::neighbProcNo(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), Foam::nl, UPstream::nProcs(), globalMeshData::processorPatches(), List::setSize(), List::size(), and globalIndex::size().
Referenced by redistributeAndWrite().
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().
void determineDecomposition | ( | const Time & | baseRunTime, |
const fileName & | decompDictFile, | ||
const bool | decompose, | ||
const fileName & | proc0CaseName, | ||
const fvMesh & | mesh, | ||
const bool | writeCellDist, | ||
label & | nDestProcs, | ||
labelList & | decomp | ||
) |
Definition at line 277 of file redistributePar.C.
References TimePaths::caseName(), Time::caseName(), decompositionMethod::decompose(), decompositionModel::decomposer(), Foam::endl(), dictionary::found(), Foam::Info, GeometricField::internalField(), dictionary::lookup(), UPstream::master(), mesh, IOobject::MUST_READ, decompositionMethod::nDomains(), decompositionModel::New(), IOobject::NO_WRITE, decompositionMethod::parallelAware(), fvMesh::time(), Time::timeName(), WarningInFunction, and writeDecomposition().
Referenced by main().
void writeProcAddressing | ( | const bool | decompose, |
const fileName & | meshSubDir, | ||
const fvMesh & | mesh, | ||
const mapDistributePolyMesh & | map | ||
) |
Definition at line 378 of file redistributePar.C.
References polyMesh::boundaryMesh(), mapDistributePolyMesh::cellMap(), mapDistributeBase::constructHasFlip(), mapDistributeBase::constructMap(), mapDistributeBase::constructSize(), mapDistributeBase::distribute(), mapDistributePolyMesh::distributeCellData(), mapDistributePolyMesh::distributePointData(), Foam::endl(), Foam::faceMap(), mapDistributePolyMesh::faceMap(), polyMesh::facesInstance(), Foam::identity(), Foam::Info, mesh, UPstream::msgType(), primitiveMesh::nCells(), primitiveMesh::nFaces(), IOobject::NO_READ, mapDistributePolyMesh::nOldCells(), mapDistributePolyMesh::nOldFaces(), mapDistributePolyMesh::nOldPoints(), UPstream::nonBlocking, primitiveMesh::nPoints(), IOobject::objectPath(), mapDistributePolyMesh::oldPatchSizes(), mapDistributePolyMesh::patchMap(), mapDistributePolyMesh::pointMap(), mapDistribute::reverseDistribute(), List::size(), PtrList::size(), mapDistributeBase::subHasFlip(), mapDistributeBase::subMap(), WarningInFunction, and regIOobject::write().
Referenced by redistributeAndWrite().
void readField | ( | const IOobject & | io, |
const fvMesh & | mesh, | ||
const label | i, | ||
PtrList< GeoField > & | fields | ||
) |
Definition at line 557 of file redistributePar.C.
Referenced by vtkUnstructuredReader::readFieldArray(), readFields(), and DimensionedField< Type, Foam::pointMesh >::readIfPresent().
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.
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().
void correctCoupledBoundaryConditions | ( | fvMesh & | mesh | ) |
Definition at line 700 of file redistributePar.C.
References UPstream::blocking, UPstream::commsTypeNames, UPstream::defaultCommsType, Foam::exit(), Foam::FatalError, FatalErrorInFunction, fld(), forAll, forAllIter, mesh, UPstream::nonBlocking, UPstream::nRequests(), UPstream::parRun(), patchi, UPstream::scheduled, and UPstream::waitRequests().
Referenced by 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 | ||
) |
Definition at line 793 of file redistributePar.C.
References Foam::abort(), IOobject::AUTO_WRITE, polyMesh::boundaryMesh(), Time::caseName(), correctCoupledBoundaryConditions(), IOstream::defaultPrecision(), hexRef8Data::distribute(), fvMeshDistribute::distribute(), Foam::endl(), HashPtrTable::erase(), polyMesh::facesInstance(), Foam::FatalError, FatalErrorInFunction, Foam::findIndex(), forAll, Foam::Info, UPstream::master(), Foam::max(), mesh, polyMesh::meshSubDir, UPstream::myProcNo(), IOobjectList::names(), Foam::nl, IOobject::NO_READ, IOobject::NO_WRITE, patches, printMeshData(), IOobject::READ_IF_PRESENT, Foam::readFields(), autoPtr::reset(), polyMesh::setInstance(), hexRef8Data::sync(), fvMesh::time(), Time::timeName(), mapDistributePolyMesh::transfer(), hexRef8Data::write(), fvMesh::write(), writeProcAddressing(), and mapDistributePolyMesh::xfer().
Referenced by main().
autoPtr<mapDistributePolyMesh> createReconstructMap | ( | const autoPtr< fvMesh > & | baseMeshPtr, |
const fvMesh & | mesh, | ||
const labelList & | cellProcAddressing, | ||
const labelList & | faceProcAddressing, | ||
const labelList & | pointProcAddressing, | ||
const labelList & | boundaryProcAddressing | ||
) |
Definition at line 1220 of file redistributePar.C.
References DynamicList::append(), polyMesh::boundaryMesh(), Foam::faceMap(), faceProcAddressing, forAll, Pstream::gatherList(), Foam::identity(), UPstream::masterNo(), mesh, UPstream::myProcNo(), primitiveMesh::nCells(), primitiveMesh::nFaces(), primitiveMesh::nPoints(), UPstream::nProcs(), autoPtr::reset(), List::size(), PtrList::size(), autoPtr::valid(), List::xfer(), and mapDistribute::xfer().
Referenced by readProcAddressing().
void readProcAddressing | ( | const fvMesh & | mesh, |
const autoPtr< fvMesh > & | baseMeshPtr, | ||
autoPtr< mapDistributePolyMesh > & | distMap | ||
) |
Definition at line 1422 of file redistributePar.C.
References polyMesh::boundaryMesh(), autoPtr::clear(), createReconstructMap(), Foam::endl(), Foam::exit(), faceProcAddressing, polyMesh::facesInstance(), Foam::FatalError, FatalErrorInFunction, Foam::Info, mesh, polyMesh::meshSubDir, primitiveMesh::nCells(), primitiveMesh::nFaces(), Foam::nl, primitiveMesh::nPoints(), IOobject::objectPath(), IOobject::READ_IF_PRESENT, List::size(), and PtrList::size().
Referenced by main().
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().
void reconstructLagrangian | ( | autoPtr< parLagrangianRedistributor > & | lagrangianReconstructorPtr, |
const fvMesh & | baseMesh, | ||
const fvMesh & | mesh, | ||
const mapDistributePolyMesh & | distMap, | ||
const HashSet< word > & | selectedLagrangianFields | ||
) |
Definition at line 1632 of file redistributePar.C.
References Foam::endl(), Foam::fieldNames(), parLagrangianRedistributor::findClouds(), forAll, Foam::Info, mesh, primitiveMesh::nCells(), Foam::nl, cloud::prefix, parLagrangianRedistributor::redistributeLagrangianFieldFields(), parLagrangianRedistributor::redistributeLagrangianFields(), parLagrangianRedistributor::redistributeLagrangianPositions(), autoPtr::reset(), List::size(), fvMesh::time(), Time::timeName(), and autoPtr::valid().
Referenced by main().
void readLagrangian | ( | const fvMesh & | mesh, |
const wordList & | cloudNames, | ||
const HashSet< word > & | selectedLagrangianFields, | ||
PtrList< unmappedPassiveParticleCloud > & | clouds | ||
) |
Definition at line 1775 of file redistributePar.C.
References regIOobject::fileModificationChecking, forAll, regIOobject::inotify, regIOobject::inotifyMaster, mesh, parLagrangianRedistributor::readLagrangianFields(), PtrList::set(), polyMesh::tetBasePtIs(), timeName, regIOobject::timeStamp, and regIOobject::timeStampMaster.
Referenced by main().
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().
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.
|
static |
Definition at line 84 of file redistributePar.C.
Referenced by getMergeDistance().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.