Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MEDCoupling::BlockTopology Class Reference
Inheritance diagram for MEDCoupling::BlockTopology:
Collaboration diagram for MEDCoupling::BlockTopology:

Public Member Functions

 BlockTopology ()
 
 BlockTopology (const ProcessorGroup &group, MEDCouplingCMesh *grid)
 
 BlockTopology (const BlockTopology &geom_topo, const ComponentTopology &comp_topo)
 
 BlockTopology (const ProcessorGroup &group, int nb_elem)
 
int getDimension () const
 
std::vector< std::pair< int,
int > > 
getLocalArrayMinMax () const
 
int getNbElements () const
 
int getNbLocalElements () const
 
const ProcessorGroupgetProcGroup () const
 
std::pair< int, int > globalToLocal (const int) const
 
int localToGlobal (const std::pair< int, int >) const
 
void serialize (int *&serializer, int &size) const
 
void unserialize (const int *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

MEDCoupling::BlockTopology::BlockTopology ( )

Default ctor.

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().

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().

MEDCoupling::BlockTopology::BlockTopology ( const ProcessorGroup group,
int  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().

MEDCoupling::BlockTopology::~BlockTopology ( )
virtual

Member Function Documentation

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

Retrieves the number of elements for a given topology.

Implements MEDCoupling::Topology.

Referenced by BlockTopology().

int MEDCoupling::BlockTopology::getNbLocalElements ( ) const
virtual
std::pair< int, int > MEDCoupling::BlockTopology::globalToLocal ( const int  global) const
int MEDCoupling::BlockTopology::localToGlobal ( const std::pair< int, int >  ) const
std::vector< std::pair< int, int > > 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().

int MEDCoupling::BlockTopology::getDimension ( ) const

Referenced by BlockTopology().

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

Serializes the data contained in the Block Topology for communication purposes

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

void MEDCoupling::BlockTopology::unserialize ( const int *  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()