faMeshDistributor Class Reference

Holds a reference to the original mesh (the baseMesh) and optionally to a subset of that mesh (the subMesh) with mapping lists for points, faces, and cells. More...

Public Member Functions

 faMeshDistributor (const faMesh &srcMesh, const faMesh &tgtMesh, const mapDistributePolyMesh &faDistMap, const bool isWriteProc=false)
 Construct from components. More...
 
bool isWriteProc () const noexcept
 Get status of write enabled (on this proc) More...
 
bool isWriteProc (const bool on) noexcept
 Change status of write enabled (on this proc) More...
 
label distributeAllFields (const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
 
template<class Type >
tmp< GeometricField< Type, faPatchField, areaMesh > > distributeField (const GeometricField< Type, faPatchField, areaMesh > &fld) const
 Distribute area field. More...
 
template<class Type >
tmp< GeometricField< Type, faePatchField, edgeMesh > > distributeField (const GeometricField< Type, faePatchField, edgeMesh > &fld) const
 Distribute edge field. More...
 
template<class Type >
tmp< GeometricField< Type, faPatchField, areaMesh > > distributeAreaField (const IOobject &fieldObject) const
 Read and distribute area field. More...
 
template<class Type >
tmp< GeometricField< Type, faePatchField, edgeMesh > > distributeEdgeField (const IOobject &fieldObject) const
 Read and distribute edge field. More...
 
template<class Type >
label distributeAreaFields (const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
 Read, distribute and write all/selected area fields. More...
 
template<class Type >
label distributeEdgeFields (const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
 Read, distribute and write all/selected area fields. More...
 
template<class Type >
Foam::tmp< Foam::GeometricField< Type, Foam::faPatchField, Foam::areaMesh > > distributeField (const GeometricField< Type, faPatchField, areaMesh > &fld) const
 
template<class Type >
Foam::tmp< Foam::GeometricField< Type, Foam::faePatchField, Foam::edgeMesh > > distributeField (const GeometricField< Type, faePatchField, edgeMesh > &fld) const
 
template<class Type >
Foam::tmp< Foam::GeometricField< Type, Foam::faPatchField, Foam::areaMesh > > distributeAreaField (const IOobject &fieldObject) const
 
template<class Type >
Foam::tmp< Foam::GeometricField< Type, Foam::faePatchField, Foam::edgeMesh > > distributeEdgeField (const IOobject &fieldObject) const
 
template<class Type >
Foam::label distributeAreaFields (const IOobjectList &objects, const wordRes &selectedFields) const
 
template<class Type >
Foam::label distributeEdgeFields (const IOobjectList &objects, const wordRes &selectedFields) const
 

Static Public Member Functions

static mapDistributePolyMesh distribute (const faMesh &oldMesh, const mapDistributePolyMesh &distMap, const polyMesh &tgtPolyMesh, autoPtr< faMesh > &newMeshPtr)
 Distribute mesh according to the given (volume) mesh distribution. More...
 
static mapDistributePolyMesh distribute (const faMesh &oldMesh, const mapDistributePolyMesh &distMap, autoPtr< faMesh > &newMeshPtr)
 Distribute mesh according to the given (volume) mesh distribution. More...
 

Static Public Attributes

static int verbose_ = 0
 Output verbosity when writing. More...
 

Detailed Description

Holds a reference to the original mesh (the baseMesh) and optionally to a subset of that mesh (the subMesh) with mapping lists for points, faces, and cells.

Source files

Definition at line 60 of file faMeshDistributor.H.

Constructor & Destructor Documentation

◆ faMeshDistributor()

faMeshDistributor ( const faMesh srcMesh,
const faMesh tgtMesh,
const mapDistributePolyMesh faDistMap,
const bool  isWriteProc = false 
)

Construct from components.

Definition at line 101 of file faMeshDistributor.C.

References faMesh::areaCentres(), Foam::diff(), mapDistributePolyMesh::distributeCellData(), mapDistributePolyMesh::distributeFaceData(), faMesh::edgeCentres(), Foam::endl(), faMesh::faceLabels(), faMeshTools::flattenEdgeField(), forAll, Foam::Info, faMesh::nEdges(), Foam::nl, Foam::Pout, and UList< T >::size().

Here is the call graph for this function:

Member Function Documentation

◆ distribute() [1/2]

Foam::mapDistributePolyMesh distribute ( const faMesh oldMesh,
const mapDistributePolyMesh distMap,
const polyMesh tgtPolyMesh,
autoPtr< faMesh > &  newMeshPtr 
)
static

Distribute mesh according to the given (volume) mesh distribution.

Uses 'tgtPolyMesh' for the new mesh

{ // Transcribe from patchMapInfo gathered earlier. // - transform Map of labelHashSet to labelListList

labelListList sendToRemote(Pstream::nProcs(faPatchMap.comm()));

forAllConstIters(patchMapInfo, iter) { const label proci = iter.key(); sendToRemote[proci] = iter.val().sortedToc(); }

auto& patchSubMap = faPatchMap.subMap(); auto& patchCnstrMap = faPatchMap.constructMap();

patchSubMap = sendToRemote; patchCnstrMap.resize(patchSubMap.size());

// Change sendToRemote into recv-from-remote by using // all-to-all exchange

Pstream::exchange<labelList, label> ( sendToRemote, patchCnstrMap, UPstream::msgType(), faPatchMap.comm() ); }

Parameters
tgtPolyMeshFrom polyMesh

Definition at line 39 of file faMeshDistributorNew.C.

References Foam::abort(), add(), faMesh::boundary(), Pstream::broadcast(), PtrList< T >::clone(), mapDistributeBase::comm(), mapDistributeBase::compactLocalData(), mapDistributeBase::constructHasFlip(), mapDistributeBase::constructMap(), mapDistributeBase::constructSize(), faMeshDistributor::distribute(), faPatch::edgeLabels(), Foam::endl(), Foam::exit(), PrimitivePatch< FaceList, PointField >::faceEdges(), faMesh::faceLabels(), mapDistributePolyMesh::faceMap(), Foam::FatalError, FatalErrorInFunction, Foam::ListOps::findIndices(), FixedList< T, N >::first(), forAll, faMesh::hasInternalEdgeLabels(), Foam::identity(), HashTable< T, Key, Hash >::insert(), io(), UList< T >::last(), HashTable< T, Key, Hash >::lookup(), Foam::mag(), PrimitivePatch< FaceList, PointField >::meshPoints(), UPstream::msgType(), processorFaPatch::myProcNo(), PrimitivePatch< FaceList, PointField >::nEdges(), nEdges(), PrimitivePatch< FaceList, PointField >::nFaces(), PrimitivePatch< FaceList, PointField >::nInternalEdges(), nNonProcessor, mapDistributePolyMesh::nOldFaces(), mapDistributePolyMesh::nOldPoints(), UPstream::nonBlocking, nPatches, PrimitivePatch< FaceList, PointField >::nPoints(), nProcEdges(), PstreamBuffers::nProcs(), UPstream::nRequests(), UPstream::parRun(), faMesh::patch(), faBoundaryMesh::patchStarts(), mapDistributePolyMesh::pointMap(), IOobject::READ_IF_PRESENT, IOobject::readOpt(), mapDistributeBase::renumberMap(), autoPtr< T >::reset(), List< T >::resize(), PtrList< T >::resize(), mapDistributeBase::reverseDistribute(), Pair< T >::second(), HashTable< T, Key, Hash >::set(), PtrList< T >::set(), UList< T >::size(), Foam::sortedOrder(), mapDistributeBase::subHasFlip(), mapDistributeBase::subMap(), globalIndex::toGlobal(), UPstream::waitRequests(), x, y, and Foam::Zero.

Referenced by faMeshDistributor::distribute().

Here is the caller graph for this function:

◆ distribute() [2/2]

Foam::mapDistributePolyMesh distribute ( const faMesh oldMesh,
const mapDistributePolyMesh distMap,
autoPtr< faMesh > &  newMeshPtr 
)
static

Distribute mesh according to the given (volume) mesh distribution.

Re-uses polyMesh from oldMesh for the new mesh

Parameters
newMeshPtrFrom polyMesh

Definition at line 899 of file faMeshDistributorNew.C.

References faMeshDistributor::distribute(), and faMesh::mesh().

Here is the call graph for this function:

◆ isWriteProc() [1/2]

bool isWriteProc ( ) const
inlinenoexcept

Get status of write enabled (on this proc)

Definition at line 151 of file faMeshDistributor.H.

◆ isWriteProc() [2/2]

bool isWriteProc ( const bool  on)
inlinenoexcept

Change status of write enabled (on this proc)

Definition at line 157 of file faMeshDistributor.H.

◆ distributeAllFields()

Foam::label distributeAllFields ( const IOobjectList objects,
const wordRes selectedFields = wordRes() 
) const

Read, distribute and write all/selected point field types (scalar, vector, ... types)

Definition at line 207 of file faMeshDistributor.C.

◆ distributeField() [1/4]

tmp< GeometricField< Type, faPatchField, areaMesh > > distributeField ( const GeometricField< Type, faPatchField, areaMesh > &  fld) const

Distribute area field.

◆ distributeField() [2/4]

tmp< GeometricField< Type, faePatchField, edgeMesh > > distributeField ( const GeometricField< Type, faePatchField, edgeMesh > &  fld) const

Distribute edge field.

◆ distributeAreaField() [1/2]

tmp< GeometricField< Type, faPatchField, areaMesh > > distributeAreaField ( const IOobject fieldObject) const

Read and distribute area field.

◆ distributeEdgeField() [1/2]

tmp< GeometricField< Type, faePatchField, edgeMesh > > distributeEdgeField ( const IOobject fieldObject) const

Read and distribute edge field.

◆ distributeAreaFields() [1/2]

label distributeAreaFields ( const IOobjectList objects,
const wordRes selectedFields = wordRes() 
) const

Read, distribute and write all/selected area fields.

◆ distributeEdgeFields() [1/2]

label distributeEdgeFields ( const IOobjectList objects,
const wordRes selectedFields = wordRes() 
) const

Read, distribute and write all/selected area fields.

◆ distributeField() [3/4]

Foam::tmp< Foam::GeometricField< Type, Foam::faPatchField, Foam::areaMesh > > distributeField ( const GeometricField< Type, faPatchField, areaMesh > &  fld) const

Definition at line 47 of file faMeshDistributorTemplates.C.

References faMesh::boundary(), mapDistributePolyMesh::cellMap(), fld(), forAll, Foam::New(), IOobject::NO_READ, IOobject::NO_WRITE, DimensionedField< Type, GeoMesh >::oriented(), PtrList< T >::set(), UPtrList< T >::size(), faMesh::thisDb(), faMesh::time(), and Time::timeName().

Here is the call graph for this function:

◆ distributeField() [4/4]

Foam::tmp< Foam::GeometricField< Type, Foam::faePatchField, Foam::edgeMesh > > distributeField ( const GeometricField< Type, faePatchField, edgeMesh > &  fld) const

Definition at line 156 of file faMeshDistributorTemplates.C.

References fld(), forAll, Foam::New(), IOobject::NO_READ, IOobject::NO_WRITE, DimensionedField< Type, GeoMesh >::oriented(), and PtrList< T >::set().

Here is the call graph for this function:

◆ distributeAreaField() [2/2]

Foam::tmp< Foam::GeometricField< Type, Foam::faPatchField, Foam::areaMesh > > distributeAreaField ( const IOobject fieldObject) const

Definition at line 261 of file faMeshDistributorTemplates.C.

References fld().

Here is the call graph for this function:

◆ distributeEdgeField() [2/2]

Foam::tmp< Foam::GeometricField< Type, Foam::faePatchField, Foam::edgeMesh > > distributeEdgeField ( const IOobject fieldObject) const

Definition at line 280 of file faMeshDistributorTemplates.C.

References fld().

Here is the call graph for this function:

◆ distributeAreaFields() [2/2]

Foam::label distributeAreaFields ( const IOobjectList objects,
const wordRes selectedFields 
) const

Definition at line 298 of file faMeshDistributorTemplates.C.

References UList< T >::empty(), Foam::endl(), Foam::Info, io(), IOobject::name(), Foam::nl, and IOobjectList::sorted().

Here is the call graph for this function:

◆ distributeEdgeFields() [2/2]

Foam::label distributeEdgeFields ( const IOobjectList objects,
const wordRes selectedFields 
) const

Definition at line 342 of file faMeshDistributorTemplates.C.

References UList< T >::empty(), Foam::endl(), Foam::Info, io(), IOobject::name(), Foam::nl, and IOobjectList::sorted().

Here is the call graph for this function:

Member Data Documentation

◆ verbose_

int verbose_ = 0
static

Output verbosity when writing.

Definition at line 111 of file faMeshDistributor.H.


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