fvMeshTools Class Reference

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< fvMeshnewMesh (const IOobject &io, const bool masterOnlyReading, const bool verbose=false)
 Read mesh or create dummy mesh (0 cells, >0 patches). More...
 
static autoPtr< fvMeshloadOrCreateMesh (const IOobject &io, const bool decompose, const bool verbose=false)
 
static void createDummyFvMeshFiles (const objectRegistry &parent, const word &regionName, const bool verbose=false)
 Create additional fvSchemes/fvSolution files. More...
 
static autoPtr< mapDistributePolyMeshreadProcAddressing (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)
 

Detailed Description

A collection of tools for operating on an fvMesh.

Source files

Definition at line 57 of file fvMeshTools.H.

Member Function Documentation

◆ addPatch()

Foam::label addPatch ( fvMesh mesh,
const polyPatch patch,
const dictionary patchFieldDict,
const word defaultPatchFieldType,
const bool  validBoundary 
)
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 42 of file fvMeshTools.C.

References fvMesh::boundary(), polyMesh::boundaryMesh(), fvMesh::clearOut(), doLocalCode, polyBoundaryMesh::findPatchID(), forAll, Foam::identity(), mesh, Time::New(), primitiveMesh::nFaces(), PtrList< T >::resize(), and polyPatch::start().

Here is the call graph for this function:

◆ setPatchFields()

void setPatchFields ( fvMesh mesh,
const label  patchi,
const dictionary patchFieldDict 
)
static

Change patchField on registered fields according to dictionary.

Definition at line 193 of file fvMeshTools.C.

References doLocalCode.

◆ zeroPatchFields()

void zeroPatchFields ( fvMesh mesh,
const label  patchi 
)
static

Change patchField to zero on registered fields.

Definition at line 228 of file fvMeshTools.C.

References doLocalCode.

◆ reorderPatches()

void reorderPatches ( fvMesh mesh,
const labelList oldToNew,
const label  nPatches,
const bool  validBoundary 
)
static

Reorder and remove trailing patches.

Is parallel synced when validBoundary is true

Definition at line 321 of file fvMeshTools.C.

References fvMesh::boundary(), polyMesh::boundaryMesh(), doLocalCode, mesh, and UPtrList< T >::reorder().

Here is the call graph for this function:

◆ removeEmptyPatches()

Foam::labelList removeEmptyPatches ( fvMesh mesh,
const bool  validBoundary 
)
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 367 of file fvMeshTools.C.

References polyMesh::boundaryMesh(), forAll, mesh, nFaces(), Foam::reduce(), List< T >::resize(), UPtrList< T >::size(), and UList< T >::size().

Here is the call graph for this function:

◆ setBasicGeometry()

void setBasicGeometry ( fvMesh mesh)
static

Set the fvGeometryScheme to basic (to avoid parallel communication)

Definition at line 430 of file fvMeshTools.C.

References surfaceInterpolation::geometry(), and mesh.

Referenced by fvMeshTools::loadOrCreateMesh().

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

◆ newMesh()

Foam::autoPtr< Foam::fvMesh > newMesh ( const IOobject io,
const bool  masterOnlyReading,
const bool  verbose = false 
)
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 450 of file fvMeshTools.C.

References fvMesh::addFvPatches(), polyMesh::addZones(), DynamicList< T, SizeMin >::append(), fvMesh::boundary(), polyMesh::boundaryMesh(), Pstream::broadcasts(), polyMesh::cellZones(), ZoneMesh< ZoneType, MeshType >::clear(), PtrList< T >::clone(), IOobject::db(), e, UPtrList< T >::empty(), polyMesh::faceZones(), IOobject::fileModificationChecking, Time::findInstance(), forAll, UList< T >::get(), IOobject::instance(), io(), Foam::isDir(), splitCell::master(), mesh, meshPtr, polyMesh::meshSubDir, IOobject::MUST_READ, IOobject::name(), Foam::name(), ZoneMesh< ZoneType, MeshType >::names(), Time::New(), primitiveMesh::nInternalFaces(), IOobject::NO_READ, IOobject::NO_WRITE, nPatches, UPstream::parRun(), Time::path(), points, polyMesh::pointZones(), IOobject::READ_IF_PRESENT, IOobject::readOpt(), polyMesh::regionName(), IOobject::registerObject(), fvMesh::removeFvBoundary(), IOobject::rename(), Foam::returnReduce(), dictionary::set(), UPtrList< T >::size(), UList< T >::size(), IOobject::time(), IOobject::timeStamp, Foam::type(), ensightPTraits< Type >::typeName, UPstream::worldComm, and IOobject::writeOpt().

Here is the call graph for this function:

◆ loadOrCreateMesh()

Foam::autoPtr< Foam::fvMesh > loadOrCreateMesh ( const IOobject io,
const bool  decompose,
const bool  verbose = false 
)
static

Read mesh if available, or create empty mesh with non-proc as per proc0 mesh.

Requires:

  • all processors to have all patches (and in same order).
  • io.instance() set to facesInstance

Definition at line 733 of file fvMeshTools.C.

References polyMesh::addZones(), IOobject::AUTO_WRITE, polyMesh::boundaryMesh(), Pstream::broadcast(), Pstream::broadcasts(), polyMesh::cellZones(), polyBoundaryMesh::checkDefinition(), ZoneMesh< ZoneType, MeshType >::checkDefinition(), polyBoundaryMesh::checkParallelSync(), ZoneMesh< ZoneType, MeshType >::checkParallelSync(), ZoneMesh< ZoneType, MeshType >::clear(), IOobject::db(), e, Foam::endl(), Foam::exit(), polyMesh::facesInstance(), polyMesh::faceZones(), Foam::FatalError, FatalErrorInFunction, Foam::fileHandler(), forAll, UList< T >::get(), polyMesh::globalData(), IOobject::instance(), io(), fileOperation::isFile(), splitCell::master(), mesh, meshPtr, polyMesh::meshSubDir, IOobject::MUST_READ, processorFaPatch::myProcNo(), IOobject::name(), Foam::name(), ZoneMesh< ZoneType, MeshType >::names(), Time::New(), IOobject::NO_READ, IOobject::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(), UList< T >::size(), IOobjectList::sortedNames(), IOobject::time(), Foam::type(), ensightPTraits< Type >::typeName, UPstream::worldComm, and regIOobject::write().

Here is the call graph for this function:

◆ createDummyFvMeshFiles()

void createDummyFvMeshFiles ( const objectRegistry parent,
const word regionName,
const bool  verbose = false 
)
static

Create additional fvSchemes/fvSolution files.

Definition at line 1063 of file fvMeshTools.C.

References dictionary::add(), dict, Foam::endl(), Foam::Info, io(), mesh, IOobject::name(), IOobject::NO_READ, IOobject::NO_WRITE, regionName, TimePaths::system(), fvMesh::thisDb(), fvMesh::time(), and IOobject::typeHeaderOk().

Referenced by voxelMeshSearch::makeMesh().

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

◆ readProcAddressing()

Foam::autoPtr< Foam::mapDistributePolyMesh > readProcAddressing ( const fvMesh procMesh,
const autoPtr< fvMesh > &  baseMeshPtr 
)
static

◆ writeProcAddressing()


The documentation for this class was generated from the following files: