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 faMeshDistributor &)=delete
 No copy construct. More...
 
void operator= (const faMeshDistributor &)=delete
 No copy assignment. More...
 
 faMeshDistributor (const faMesh &srcMesh, const faMesh &tgtMesh, const mapDistributePolyMesh &faDistMap, const bool isWriteProc)
 Construct from components, using bool to control writing. More...
 
 faMeshDistributor (const faMesh &srcMesh, const faMesh &tgtMesh, const mapDistributePolyMesh &faDistMap, refPtr< fileOperation > &writeHandler)
 Construct from components, using file handler to control writing. More...
 
label distributeAllFields (const IOobjectList &objects, const wordRes &selectedFields=wordRes()) const
 Read, distribute and write all/selected point field types (scalar, vector, ... types) More...
 
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 57 of file faMeshDistributor.H.

Constructor & Destructor Documentation

◆ faMeshDistributor() [1/3]

faMeshDistributor ( const faMeshDistributor )
delete

No copy construct.

◆ faMeshDistributor() [2/3]

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

Construct from components, using bool to control writing.

Definition at line 186 of file faMeshDistributor.C.

◆ faMeshDistributor() [3/3]

faMeshDistributor ( const faMesh srcMesh,
const faMesh tgtMesh,
const mapDistributePolyMesh faDistMap,
refPtr< fileOperation > &  writeHandler 
)

Construct from components, using file handler to control writing.

Definition at line 207 of file faMeshDistributor.C.

Member Function Documentation

◆ operator=()

void operator= ( const faMeshDistributor )
delete

No copy assignment.

◆ 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 33 of file faMeshDistributorNew.C.

References Foam::abort(), Foam::add(), faMesh::boundary(), PtrList< T >::clone(), Foam::ListListOps::combine(), faPatch::edgeLabels(), FixedList< T, N >::empty(), Foam::endl(), Foam::exit(), PrimitivePatch< FaceList, PointField >::faceEdges(), faMesh::faceLabels(), mapDistributePolyMesh::faceMap(), Foam::FatalError, FatalErrorInFunction, Foam::findIndices(), Pair< T >::first(), forAll, Foam::getEdge(), faMesh::hasInternalEdgeLabels(), Foam::identity(), HashTable< T, label, Hash< label > >::insert(), io(), UList< T >::last(), HashTable< T, Key, Hash >::lookup(), Foam::mag(), PrimitivePatch< FaceList, PointField >::meshPoints(), PrimitivePatch< FaceList, PointField >::nEdges(), PrimitivePatch< FaceList, PointField >::nFaces(), PrimitivePatch< FaceList, PointField >::nInternalEdges(), mapDistributePolyMesh::nOldFaces(), mapDistributePolyMesh::nOldPoints(), nPatches, PrimitivePatch< FaceList, PointField >::nPoints(), faMesh::patch(), faBoundaryMesh::patchStarts(), mapDistributePolyMesh::pointMap(), autoPtr< T >::reset(), PtrList< T >::resize(), List< T >::resize(), Pair< T >::second(), PtrList< T >::set(), UList< T >::size(), HashTable< T, Key, Hash >::size(), Foam::sortedOrder(), HashTable< T, Key, Hash >::sortedToc(), mapDistributeBase::subMap(), x, y, and Foam::Zero.

Here is the call 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 894 of file faMeshDistributorNew.C.

References faMesh::mesh().

Here is the call graph for this function:

◆ 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 230 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 41 of file faMeshDistributorTemplates.C.

References fld, forAll, and Foam::New().

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 150 of file faMeshDistributorTemplates.C.

References fld, forAll, Foam::New(), and DimensionedField< Type, GeoMesh >::oriented().

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 255 of file faMeshDistributorTemplates.C.

References fld.

◆ distributeEdgeField() [2/2]

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

Definition at line 274 of file faMeshDistributorTemplates.C.

References fld.

◆ distributeAreaFields() [2/2]

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

Definition at line 292 of file faMeshDistributorTemplates.C.

References IOobjectList::csorted(), UList< T >::empty(), Foam::endl(), Foam::fileHandler, Foam::Info, io(), and Foam::nl.

Here is the call graph for this function:

◆ distributeEdgeFields() [2/2]

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

Definition at line 350 of file faMeshDistributorTemplates.C.

References IOobjectList::csorted(), UList< T >::empty(), Foam::endl(), Foam::fileHandler, Foam::Info, io(), and Foam::nl.

Here is the call graph for this function:

Member Data Documentation

◆ verbose_

int verbose_ = 0
static

Output verbosity when writing.

Definition at line 135 of file faMeshDistributor.H.


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