Loading...
Searching...
No Matches
fvMeshTools Class Reference

A collection of tools for operating on an fvMesh. More...

#include <fvMeshTools.H>

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.
static void setPatchFields (fvMesh &mesh, const label patchi, const dictionary &patchFieldDict)
 Change patchField on registered fields according to dictionary.
static void zeroPatchFields (fvMesh &mesh, const label patchi)
 Change patchField to zero on registered fields.
static void reorderPatches (fvMesh &, const labelList &oldToNew, const label nPatches, const bool validBoundary)
 Reorder and remove trailing patches.
static labelList removeEmptyPatches (fvMesh &, const bool validBoundary)
 Remove zero sized patches. All but processor patches are.
static labelList removeEmptyPatches (fvMesh &, const wordList &keepPatches, const bool validBoundary)
 Remove zero sized patches unless explicitly forced to preserve.
static void setBasicGeometry (fvMesh &mesh)
 Set the fvGeometryScheme to basic (to avoid parallel communication).
static autoPtr< fvMeshnewMesh (const IOobject &io, const bool masterOnlyReading, const bool verbose=false)
 Read mesh or create dummy mesh (0 cells, >0 patches).
static autoPtr< fvMeshloadOrCreateMesh (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.
static autoPtr< fvMeshloadOrCreateMesh (const IOobject &io, refPtr< fileOperation > &readHandler, const bool verbose=true)
 Read mesh if available, or create empty mesh with non-proc as per proc0 mesh.
static void createDummyFvMeshFiles (const objectRegistry &parent, const word &regionName, const bool verbose=false)
 Create additional fvSchemes/fvSolution files.
static autoPtr< mapDistributePolyMeshreadProcAddressing (const fvMesh &procMesh, const fvMesh *baseMeshPtr)
 Read procAddressing components (reconstructing).
static void writeProcAddressing (const fvMesh &procMesh, const mapDistributePolyMesh &map, const bool decompose, const fileName &writeInstance, refPtr< fileOperation > &writeHandler)
 Write addressing if decomposing (1 to many) or reconstructing (many to 1).
static autoPtr< mapDistributePolyMeshreadProcAddressing (const fvMesh &procMesh, const autoPtr< fvMesh > &baseMeshPtr)
 Read procAddressing components (reconstructing).

Detailed Description

A collection of tools for operating on an fvMesh.

Source files

Definition at line 53 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 37 of file fvMeshTools.C.

References doLocalCode, polyBoundaryMesh::findPatchID(), forAll, Foam::identity(), Foam::isA(), mesh, fvPatch::New(), pp(), and PtrList< T >::resize().

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 188 of file fvMeshTools.C.

References doLocalCode, and mesh.

◆ zeroPatchFields()

void zeroPatchFields ( fvMesh & mesh,
const label patchi )
static

Change patchField to zero on registered fields.

Definition at line 223 of file fvMeshTools.C.

References doLocalCode, and mesh.

◆ 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 316 of file fvMeshTools.C.

References doLocalCode, mesh, and UPtrList< T >::reorder().

Referenced by removeEmptyPatches().

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

◆ removeEmptyPatches() [1/2]

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 441 of file fvMeshTools.C.

References mesh, List< word >::null(), and removeEmptyPatches().

Referenced by removeEmptyPatches().

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

◆ removeEmptyPatches() [2/2]

Foam::labelList removeEmptyPatches ( fvMesh & mesh,
const wordList & keepPatches,
const bool validBoundary )
static

Remove zero sized patches unless explicitly forced to preserve.

See above.

Definition at line 362 of file fvMeshTools.C.

References forAll, UList< T >::found(), Foam::isA(), mesh, pbm, pp(), Foam::reduce(), reorderPatches(), List< T >::resize(), 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 451 of file fvMeshTools.C.

References dictionary, and mesh.

◆ newMesh()

Foam::autoPtr< Foam::fvMesh > newMesh ( const IOobject & io,
const bool masterOnlyReading,
const bool verbose = false )
static

◆ loadOrCreateMesh() [1/2]

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 1187 of file fvMeshTools.C.

References io.

◆ loadOrCreateMesh() [2/2]

Foam::autoPtr< Foam::fvMesh > loadOrCreateMesh ( const IOobject & io,
refPtr< fileOperation > & readHandler,
const bool verbose = true )
static

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

The fileHandler is specified on processors that have a processor mesh. Generates empty mesh on other processors.

Parameters
readHandlerNon-null reference if a mesh exists on given processor

Definition at line 1205 of file fvMeshTools.C.

References io.

◆ createDummyFvMeshFiles()

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

Create additional fvSchemes/fvSolution files.

Definition at line 1222 of file fvMeshTools.C.

References dict, dictionary, Foam::endl(), Foam::Info, io, mesh, IOobjectOption::NO_READ, IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, and regionName.

Referenced by voxelMeshSearch::makeMesh().

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

◆ readProcAddressing() [1/2]

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

Read procAddressing components (reconstructing).

Definition at line 212 of file fvMeshToolsProcAddr.C.

References Foam::createReconstructMap(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::Info, mesh, polyMesh::meshSubDir, Foam::nl, IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, IOobject::objectRelPath(), IOobjectOption::READ_IF_PRESENT, IOobject::rename(), UList< T >::size(), and Foam::Zero.

Referenced by readProcAddressing().

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

◆ writeProcAddressing()

◆ readProcAddressing() [2/2]

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

Read procAddressing components (reconstructing).

Definition at line 463 of file fvMeshToolsProcAddr.C.

References autoPtr< T >::get(), and readProcAddressing().

Here is the call graph for this function:

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