A collection of tools for operating on an fvMesh. More...
Static Public Member Functions | |
static label | addPatch (fvMesh &mesh, const polyPatch &patch, const dictionary &patchFieldDict, const word &defaultPatchFieldType, const bool validBoundary) |
Add patch. Inserts patch before all processor patches. More... | |
static void | setPatchFields (fvMesh &mesh, const label patchi, const dictionary &patchFieldDict) |
Change patchField on registered fields according to dictionary. More... | |
static void | zeroPatchFields (fvMesh &mesh, const label patchi) |
Change patchField to zero on registered fields. More... | |
static void | reorderPatches (fvMesh &, const labelList &oldToNew, const label nPatches, const bool validBoundary) |
Reorder and remove trailing patches. More... | |
static labelList | removeEmptyPatches (fvMesh &, const bool validBoundary) |
Remove zero sized patches. All but processor patches are. More... | |
static void | setBasicGeometry (fvMesh &mesh) |
Set the fvGeometryScheme to basic (to avoid parallel communication) More... | |
static autoPtr< fvMesh > | newMesh (const IOobject &io, const bool masterOnlyReading, const bool verbose=false) |
Read mesh or create dummy mesh (0 cells, >0 patches). More... | |
static autoPtr< fvMesh > | loadOrCreateMesh (const IOobject &io, const bool decompose, const bool verbose=false) |
Read mesh if available, or create empty mesh with non-proc as per proc0 mesh. More... | |
static void | createDummyFvMeshFiles (const objectRegistry &parent, const word ®ionName, const bool verbose=false) |
Create additional fvSchemes/fvSolution files. More... | |
static autoPtr< mapDistributePolyMesh > | readProcAddressing (const fvMesh &procMesh, const autoPtr< fvMesh > &baseMeshPtr) |
Read procAddressing components (reconstructing) More... | |
static void | writeProcAddressing (const fvMesh &procMesh, const mapDistributePolyMesh &map, const bool decompose, autoPtr< fileOperation > &&writeHandler) |
Write addressing if decomposing (1 to many) or reconstructing (many to 1) More... | |
A collection of tools for operating on an fvMesh.
Definition at line 52 of file fvMeshTools.H.
|
static |
Add patch. Inserts patch before all processor patches.
Supply per field the new patchField per field as a subdictionary or a default type. If validBoundary call is parallel synced and all add the same patch with same settings.
Definition at line 36 of file fvMeshTools.C.
References doLocalCode, polyBoundaryMesh::findPatchID(), forAll, Foam::identity(), mesh, Foam::New(), Foam::foamVersion::patch, PtrList< T >::resize(), and polyPatch::start().
|
static |
Change patchField on registered fields according to dictionary.
Definition at line 187 of file fvMeshTools.C.
References doLocalCode.
|
static |
Change patchField to zero on registered fields.
Definition at line 221 of file fvMeshTools.C.
References doLocalCode.
|
static |
Reorder and remove trailing patches.
Is parallel synced when validBoundary is true
Definition at line 315 of file fvMeshTools.C.
References fvMesh::boundary(), polyMesh::boundaryMesh(), doLocalCode, mesh, and UPtrList< T >::reorder().
|
static |
Remove zero sized patches. All but processor patches are.
assumed to be present on all processors (so size will be reduced if validBoundary). Return map from new to old patches
Definition at line 361 of file fvMeshTools.C.
References polyMesh::boundaryMesh(), forAll, mesh, Foam::reduce(), List< T >::resize(), UList< T >::size(), and UPtrList< T >::size().
|
static |
Set the fvGeometryScheme to basic (to avoid parallel communication)
Definition at line 423 of file fvMeshTools.C.
References surfaceInterpolation::geometry(), and mesh.
Referenced by fvMeshTools::loadOrCreateMesh().
|
static |
Read mesh or create dummy mesh (0 cells, >0 patches).
Works in two modes according to masterOnlyReading: true : create dummy mesh on all procs false: checks locally for mesh directories and only creates dummy mesh if not present
Definition at line 444 of file fvMeshTools.C.
References fvMesh::addFvPatches(), polyMesh::addZones(), fvMesh::boundary(), polyMesh::boundaryMesh(), Pstream::broadcasts(), polyMesh::cellZones(), ZoneMesh< ZoneType, MeshType >::clear(), PtrList< T >::clone(), IOobject::db(), Foam::constant::electromagnetic::e, UPtrList< T >::empty(), polyMesh::faceZones(), IOobject::fileModificationChecking, Time::findInstance(), forAll, IOobject::instance(), io(), Foam::isDir(), UPstream::master(), mesh, meshPtr, polyMesh::meshSubDir, IOobjectOption::MUST_READ, Foam::name(), IOobject::name(), ZoneMesh< ZoneType, MeshType >::names(), autoPtr< T >::New(), polyPatch::New(), primitiveMesh::nInternalFaces(), IOobjectOption::NO_READ, IOobjectOption::NO_WRITE, nPatches, UPstream::parRun(), Time::path(), points, polyMesh::pointZones(), IOobjectOption::READ_IF_PRESENT, IOobjectOption::readOpt(), polyMesh::regionName(), IOobjectOption::registerObject(), fvMesh::removeFvBoundary(), IOobject::rename(), Foam::returnReduceOr(), dictionary::set(), UPtrList< T >::size(), IOobject::time(), IOobject::timeStamp, Foam::type(), UPstream::worldComm, and IOobjectOption::writeOpt().
|
static |
Read mesh if available, or create empty mesh with non-proc as per proc0 mesh.
Requires:
Definition at line 727 of file fvMeshTools.C.
References polyMesh::addZones(), IOobjectOption::AUTO_WRITE, polyMesh::boundaryMesh(), Pstream::broadcast(), Pstream::broadcasts(), polyMesh::cellZones(), ZoneMesh< ZoneType, MeshType >::checkDefinition(), polyBoundaryMesh::checkDefinition(), ZoneMesh< ZoneType, MeshType >::checkParallelSync(), polyBoundaryMesh::checkParallelSync(), ZoneMesh< ZoneType, MeshType >::clear(), IOobject::db(), Foam::constant::electromagnetic::e, Foam::endl(), Foam::exit(), polyMesh::facesInstance(), polyMesh::faceZones(), Foam::FatalError, FatalErrorInFunction, Foam::fileHandler, forAll, polyMesh::globalData(), IOobject::instance(), io(), UPstream::master(), mesh, meshPtr, polyMesh::meshSubDir, IOobjectOption::MUST_READ, UPstream::myProcNo(), Foam::name(), IOobject::name(), ZoneMesh< ZoneType, MeshType >::names(), autoPtr< T >::New(), polyPatch::New(), IOobjectOption::NO_READ, IOobjectOption::NO_WRITE, nPatches, UPstream::parRun(), patches, Time::path(), polyMesh::pointZones(), polyMesh::regionName(), PtrList< T >::resize(), PtrList< T >::set(), dictionary::set(), fvMeshTools::setBasicGeometry(), UPtrList< T >::size(), IOobject::time(), Foam::type(), UPstream::worldComm, and regIOobject::write().
|
static |
Create additional fvSchemes/fvSolution files.
Definition at line 1057 of file fvMeshTools.C.
References dictionary::add(), dict, Foam::endl(), Foam::Info, io(), mesh, IOobject::name(), IOobjectOption::NO_READ, IOobjectOption::NO_WRITE, regionName, TimePaths::system(), fvMesh::thisDb(), fvMesh::time(), and IOobject::typeHeaderOk().
Referenced by voxelMeshSearch::makeMesh().
|
static |
Read procAddressing components (reconstructing)
Definition at line 213 of file fvMeshToolsProcAddr.C.
References Foam::createReconstructMap(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::Info, mesh, Foam::nl, IOobject::objectRelPath(), UList< T >::size(), and Foam::Zero.
|
static |
Write addressing if decomposing (1 to many) or reconstructing (many to 1)
Definition at line 295 of file fvMeshToolsProcAddr.C.
References mapDistributePolyMesh::cellMap(), mapDistributeBase::constructHasFlip(), mapDistributePolyMesh::distributeCellData(), mapDistributePolyMesh::distributePointData(), Foam::endl(), Foam::faceMap(), mapDistributePolyMesh::faceMap(), Foam::fileHandler, Foam::identity(), Foam::Info, mesh, mapDistributePolyMesh::nOldCells(), mapDistributePolyMesh::nOldFaces(), mapDistributePolyMesh::nOldPoints(), IOobject::objectRelPath(), mapDistributePolyMesh::oldPatchSizes(), mapDistributePolyMesh::patchMap(), mapDistributePolyMesh::pointMap(), IOobject::rename(), mapDistribute::reverseDistribute(), UList< T >::size(), mapDistributeBase::subHasFlip(), WarningInFunction, regIOobject::write(), and Foam::Zero.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.