Version: 9.14.0
MEDCoupling::BlockTopology Class Reference
Inheritance diagram for MEDCoupling::BlockTopology:
Collaboration diagram for MEDCoupling::BlockTopology:

Public Member Functions

 BlockTopology ()
 
 BlockTopology (const BlockTopology &geom_topo, const ComponentTopology &comp_topo)
 
 BlockTopology (const ProcessorGroup &group, mcIdType nb_elem)
 
 BlockTopology (const ProcessorGroup &group, MEDCouplingCMesh *grid)
 
int getDimension () const
 
std::vector< std::pair< int, mcIdType > > getLocalArrayMinMax () const
 
mcIdType getNbElements () const
 
mcIdType getNbLocalElements () const
 
const ProcessorGroupgetProcGroup () const
 
std::pair< int, mcIdType > globalToLocal (const mcIdType) const
 
mcIdType localToGlobal (const std::pair< int, mcIdType >) const
 
void release ()
 
void serialize (mcIdType *&serializer, mcIdType &size) const
 
void unserialize (const mcIdType *serializer, const CommInterface &comm_interface)
 
virtual ~BlockTopology ()
 
- Public Member Functions inherited from MEDCoupling::Topology
 Topology ()
 
virtual ~Topology ()
 

Detailed Description

A BlockTopology typically represents the split of a structured mesh among the processors of a common ProcessorGroup. Each processor gets a contiguous part of the cells in the mesh (a block).

A BlockTopology can also be used to split a structured domain among the various components of a field.

See also
ExplicitTopology

Constructor & Destructor Documentation

◆ BlockTopology() [1/4]

MEDCoupling::BlockTopology::BlockTopology ( )

Default ctor.

◆ BlockTopology() [2/4]

MEDCoupling::BlockTopology::BlockTopology ( const ProcessorGroup group,
MEDCouplingCMesh grid 
)

Constructor of a block topology from a grid. This preliminary version simply splits along the first axis instead of making the best choice with respect to the values of the different axes.

References MEDCoupling::Block, MEDCoupling::MEDCouplingCMesh::getCoordsAt(), MEDCoupling::DataArrayTemplate< T >::getNbOfElems(), and MEDCoupling::ProcessorGroup::size().

◆ BlockTopology() [3/4]

MEDCoupling::BlockTopology::BlockTopology ( const BlockTopology geom_topo,
const ComponentTopology comp_topo 
)

Creation of a block topology by composing a geometrical topology and a component topology. This constructor is intended for creating fields for which the parallel distribution is made on the components of the field rather than on the geometrical partitioning of the underlying mesh.

References MEDCoupling::Block, MEDCoupling::ComponentTopology::getBlockIndices(), getDimension(), getNbElements(), getProcGroup(), MEDCoupling::ComponentTopology::getProcGroup(), MEDCoupling::ComponentTopology::nbBlocks(), MEDCoupling::ComponentTopology::nbComponents(), and MEDCoupling::ProcessorGroup::size().

◆ BlockTopology() [4/4]

MEDCoupling::BlockTopology::BlockTopology ( const ProcessorGroup group,
mcIdType  nb_elem 
)

Constructor for creating a one-dimensional topology from a processor group and a local number of elements on each processor

The function must be called only by the processors belonging to group group. Calling it from a processor not belonging to group will cause an MPI error, while calling from a subset of group will result in a deadlock.

References MEDCoupling::CommInterface::allGather(), MEDCoupling::Block, MEDCoupling::MPIProcessorGroup::getComm(), MEDCoupling::ProcessorGroup::getCommInterface(), and MEDCoupling::ProcessorGroup::size().

◆ ~BlockTopology()

MEDCoupling::BlockTopology::~BlockTopology ( )
virtual

References release().

Member Function Documentation

◆ release()

void MEDCoupling::BlockTopology::release ( )

Destructor involves MPI operations: make sure this is accessible from a proper method for Python wrapping.

Referenced by ~BlockTopology().

◆ getNbElements()

mcIdType MEDCoupling::BlockTopology::getNbElements ( ) const
virtual

Retrieves the number of elements for a given topology.

Implements MEDCoupling::Topology.

Referenced by BlockTopology().

◆ getNbLocalElements()

◆ getProcGroup()

◆ globalToLocal()

std::pair< int, mcIdType > MEDCoupling::BlockTopology::globalToLocal ( const mcIdType  global) const

◆ localToGlobal()

mcIdType MEDCoupling::BlockTopology::localToGlobal ( const std::pair< int, mcIdType >  ) const

◆ getLocalArrayMinMax()

std::vector< std::pair< int, mcIdType > > MEDCoupling::BlockTopology::getLocalArrayMinMax ( ) const

Retrieves the min and max indices of the domain stored locally for each dimension. The output vector has the topology dimension as a size and each pair <int,int> contains min and max. Indices range from min to max-1.

References MEDCoupling::ProcessorGroup::myRank().

◆ getDimension()

int MEDCoupling::BlockTopology::getDimension ( ) const

Referenced by BlockTopology().

◆ serialize()

void MEDCoupling::BlockTopology::serialize ( mcIdType *&  serializer,
mcIdType &  size 
) const

Serializes the data contained in the Block Topology for communication purposes

References MEDCoupling::ProcessorGroup::getCommInterface(), MEDCoupling::ProcessorGroup::size(), and MEDCoupling::MPIProcessorGroup::translateRank().

◆ unserialize()

void MEDCoupling::BlockTopology::unserialize ( const mcIdType *  serializer,
const CommInterface comm_interface 
)

Unserializes the data contained in the Block Topology after communication. Uses the same structure as the one used for serialize()