zoneDistribute Class Reference

Class for parallel communication in a narrow band. It either provides a Map with the neighbouring values of the selected region or returns a Map of the required values in global addressing. Also holds a reference to the stencil Before the data transfer the communication has to be set up: exchangeFields_.setUpCommforZone(interfaceCell_); Is used in the plicRDF. More...

Inheritance diagram for zoneDistribute:
[legend]
Collaboration diagram for zoneDistribute:
[legend]

Public Member Functions

 TypeName ("zoneDistribute")
 Runtime information. More...
 
 zoneDistribute (const fvMesh &)
 Construct from fvMesh. More...
 
virtual ~zoneDistribute ()=default
 Destructor. More...
 
void setUpCommforZone (const boolList &zone, bool updateStencil=true)
 Update stencil with boolList the size has to match mesh nCells. More...
 
void updateStencil (const boolList &zone)
 Updates stencil with boolList the size has to match mesh nCells. More...
 
const labelListListgetStencil () noexcept
 Stencil reference. More...
 
const globalIndexglobalNumbering () const noexcept
 Addressing reference. More...
 
template<typename Type >
Type getValue (const VolumeField< Type > &phi, const Map< Type > &valuesFromOtherProc, const label gblIdx) const
 
template<typename Type >
Map< Field< Type > > getFields (const boolList &zone, const VolumeField< Type > &phi)
 Returns stencil and provides a Map with globalNumbering. More...
 
template<typename Type >
Map< Type > getDatafromOtherProc (const boolList &zone, const VolumeField< Type > &phi)
 Returns stencil and provides a Map with globalNumbering. More...
 
template<typename Type >
Foam::Map< Foam::Field< Type > > getFields (const boolList &zone, const VolumeField< Type > &phi)
 
template<typename Type >
Foam::Map< Type > getDatafromOtherProc (const boolList &zone, const VolumeField< Type > &phi)
 
- Public Member Functions inherited from MeshObject< fvMesh, TopologicalMeshObject, zoneDistribute >
 MeshObject (const fvMesh &mesh)
 Construct on Mesh type. More...
 
virtual ~MeshObject ()=default
 Destructor. More...
 
const fvMeshmesh () const
 
virtual bool writeData (Ostream &os) const
 

Static Public Member Functions

static zoneDistributeNew (const fvMesh &)
 Selector. More...
 
- Static Public Member Functions inherited from MeshObject< fvMesh, TopologicalMeshObject, zoneDistribute >
static const zoneDistributeNew (const fvMesh &mesh, Args &&... args)
 Get existing or create a new MeshObject. More...
 
static bool Delete (const fvMesh &mesh)
 Static destructor. More...
 

Additional Inherited Members

- Protected Attributes inherited from MeshObject< fvMesh, TopologicalMeshObject, zoneDistribute >
const fvMeshmesh_
 

Detailed Description

Class for parallel communication in a narrow band. It either provides a Map with the neighbouring values of the selected region or returns a Map of the required values in global addressing. Also holds a reference to the stencil Before the data transfer the communication has to be set up: exchangeFields_.setUpCommforZone(interfaceCell_); Is used in the plicRDF.

Original code supplied by Henning Scheufler, DLR (2019)

Additional optimization of processor communication provided by Tetsuo AOYAGI, RIST (2022), to use a more compact exchange of sizes with an updated version of PstreamBuffers. This optimization uses additional sendTo/recvFrom member data to track the topological connectivity, acting like an on-the-fly sub-communicator, and respects corner connectivity.

  1. Initially topological connections are empty (or all false).
  2. Scan the stencil global cellIds (active zones only) and split into sub-lists according the originating processor (the sender).
  3. If an originating processor appears/disappears, need to update the connectivity information (requires an all-to-all).
  4. When possible, the topological send/recv is used in PstreamBuffers finishedSends (minimizes communication).
Source files

Definition at line 80 of file zoneDistribute.H.

Constructor & Destructor Documentation

◆ zoneDistribute()

zoneDistribute ( const fvMesh mesh)
explicit

Construct from fvMesh.

Definition at line 41 of file zoneDistribute.C.

References Foam::New().

Here is the call graph for this function:

◆ ~zoneDistribute()

virtual ~zoneDistribute ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "zoneDistribute"  )

Runtime information.

◆ New()

Foam::zoneDistribute & New ( const fvMesh mesh)
static

Selector.

Definition at line 52 of file zoneDistribute.C.

References objectRegistry::getObjectPtr(), mesh, regIOobject::store(), and fvMesh::thisDb().

Here is the call graph for this function:

◆ setUpCommforZone()

void setUpCommforZone ( const boolList zone,
bool  updateStencil = true 
)

Update stencil with boolList the size has to match mesh nCells.

Definition at line 74 of file zoneDistribute.C.

References PstreamBuffers::allProcs(), PstreamBuffers::finishedSends(), processorFaPatch::myProcNo(), Time::New(), UPstream::nonBlocking, PstreamBuffers::nProcs(), UPstream::parRun(), and PstreamBuffers::recvDataCount().

Referenced by reconstructedDistanceFunction::constructRDF().

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

◆ updateStencil()

void updateStencil ( const boolList zone)

Updates stencil with boolList the size has to match mesh nCells.

Definition at line 68 of file zoneDistribute.C.

References Time::New().

Here is the call graph for this function:

◆ getStencil()

const labelListList & getStencil ( )
inlinenoexcept

Stencil reference.

Definition at line 153 of file zoneDistribute.H.

Referenced by reconstructedDistanceFunction::constructRDF().

Here is the caller graph for this function:

◆ globalNumbering()

const globalIndex & globalNumbering ( ) const
inlinenoexcept

Addressing reference.

Definition at line 159 of file zoneDistribute.H.

◆ getValue()

Type getValue ( const VolumeField< Type > &  phi,
const Map< Type > &  valuesFromOtherProc,
const label  gblIdx 
) const

Gives patchNumber and patchFaceNumber for a given Geometric volume field

Definition at line 79 of file zoneDistributeI.H.

References phi.

Referenced by reconstructedDistanceFunction::constructRDF().

Here is the caller graph for this function:

◆ getFields() [1/2]

Map< Field< Type > > getFields ( const boolList zone,
const VolumeField< Type > &  phi 
)

Returns stencil and provides a Map with globalNumbering.

◆ getDatafromOtherProc() [1/2]

Map< Type > getDatafromOtherProc ( const boolList zone,
const VolumeField< Type > &  phi 
)

Returns stencil and provides a Map with globalNumbering.

Referenced by reconstructedDistanceFunction::constructRDF().

Here is the caller graph for this function:

◆ getFields() [2/2]

Foam::Map< Foam::Field< Type > > getFields ( const boolList zone,
const VolumeField< Type > &  phi 
)

Definition at line 100 of file zoneDistributeI.H.

References DynamicField< T, SizeMin >::append(), DynamicField< T, SizeMin >::clear(), HashTable< T, Key, Hash >::emplace(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, phi, and UList< T >::size().

Here is the call graph for this function:

◆ getDatafromOtherProc() [2/2]

Foam::Map< Type > getDatafromOtherProc ( const boolList zone,
const VolumeField< Type > &  phi 
)

Definition at line 143 of file zoneDistributeI.H.

References PstreamBuffers::allProcs(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, PstreamBuffers::finishedSends(), HashTable< T, Key, Hash >::insert(), processorFaPatch::myProcNo(), UPstream::nonBlocking, UPstream::parRun(), phi, PstreamBuffers::recvDataCount(), UList< T >::size(), and WarningInFunction.

Here is the call graph for this function:

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