MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::GroupTopology Class Reference

#include <communication.hpp>

Public Member Functions

 GroupTopology ()
 Constructor with the MPI communicator = 0.
 
 GroupTopology (MPI_Comm comm)
 Constructor given the MPI communicator 'comm'.
 
 GroupTopology (const GroupTopology &gt)
 Copy constructor.
 
void SetComm (MPI_Comm comm)
 Set the MPI communicator to 'comm'.
 
MPI_Comm GetComm () const
 Return the MPI communicator.
 
int MyRank () const
 Return the MPI rank within this object's communicator.
 
int NRanks () const
 Return the number of MPI ranks within this object's communicator.
 
void Create (ListOfIntegerSets &groups, int mpitag)
 Set up the group topology given the list of sets of shared entities.
 
int NGroups () const
 Return the number of groups.
 
int GetNumNeighbors () const
 Return the number of neighbors including the local processor.
 
int GetNeighborRank (int i) const
 Return the MPI rank of neighbor 'i'.
 
bool IAmMaster (int g) const
 Return true if I am master for group 'g'.
 
int GetGroupMaster (int g) const
 Return the neighbor index of the group master for a given group. Neighbor 0 is the local processor.
 
int GetGroupMasterRank (int g) const
 Return the rank of the group master for group 'g'.
 
int GetGroupMasterGroup (int g) const
 Return the group number in the master for group 'g'.
 
int GetGroupSize (int g) const
 Get the number of processors in a group.
 
const int * GetGroup (int g) const
 Return a pointer to a list of neighbors for a given group. Neighbor 0 is the local processor.
 
void Save (std::ostream &out) const
 Save the data in a stream.
 
void Load (std::istream &in)
 Load the data from a stream.
 
void Copy (GroupTopology &copy) const
 Copy the internal data to the external 'copy'.
 
void Swap (GroupTopology &other)
 Swap the internal data with another GroupTopology object.
 
virtual ~GroupTopology ()
 

Detailed Description

The shared entities (e.g. vertices, faces and edges) are split into groups, each group determined by the set of participating processors. They are numbered locally in lproc. Assumptions:

  • group 0 is the 'local' group
  • groupmaster_lproc[0] = 0
  • lproc_proc[0] = MyRank

Definition at line 135 of file communication.hpp.

Constructor & Destructor Documentation

◆ GroupTopology() [1/3]

mfem::GroupTopology::GroupTopology ( )
inline

Constructor with the MPI communicator = 0.

Definition at line 153 of file communication.hpp.

◆ GroupTopology() [2/3]

mfem::GroupTopology::GroupTopology ( MPI_Comm comm)
inline

Constructor given the MPI communicator 'comm'.

Definition at line 156 of file communication.hpp.

◆ GroupTopology() [3/3]

mfem::GroupTopology::GroupTopology ( const GroupTopology & gt)

Copy constructor.

Definition at line 49 of file communication.cpp.

◆ ~GroupTopology()

virtual mfem::GroupTopology::~GroupTopology ( )
inlinevirtual

Definition at line 218 of file communication.hpp.

Member Function Documentation

◆ Copy()

void mfem::GroupTopology::Copy ( GroupTopology & copy) const

Copy the internal data to the external 'copy'.

Definition at line 332 of file communication.cpp.

◆ Create()

void mfem::GroupTopology::Create ( ListOfIntegerSets & groups,
int mpitag )

Set up the group topology given the list of sets of shared entities.

Definition at line 97 of file communication.cpp.

◆ GetComm()

MPI_Comm mfem::GroupTopology::GetComm ( ) const
inline

Return the MPI communicator.

Definition at line 165 of file communication.hpp.

◆ GetGroup()

const int * mfem::GroupTopology::GetGroup ( int g) const
inline

Return a pointer to a list of neighbors for a given group. Neighbor 0 is the local processor.

Definition at line 204 of file communication.hpp.

◆ GetGroupMaster()

int mfem::GroupTopology::GetGroupMaster ( int g) const
inline

Return the neighbor index of the group master for a given group. Neighbor 0 is the local processor.

Definition at line 190 of file communication.hpp.

◆ GetGroupMasterGroup()

int mfem::GroupTopology::GetGroupMasterGroup ( int g) const
inline

Return the group number in the master for group 'g'.

Definition at line 197 of file communication.hpp.

◆ GetGroupMasterRank()

int mfem::GroupTopology::GetGroupMasterRank ( int g) const
inline

Return the rank of the group master for group 'g'.

Definition at line 193 of file communication.hpp.

◆ GetGroupSize()

int mfem::GroupTopology::GetGroupSize ( int g) const
inline

Get the number of processors in a group.

Definition at line 200 of file communication.hpp.

◆ GetNeighborRank()

int mfem::GroupTopology::GetNeighborRank ( int i) const
inline

Return the MPI rank of neighbor 'i'.

Definition at line 183 of file communication.hpp.

◆ GetNumNeighbors()

int mfem::GroupTopology::GetNumNeighbors ( ) const
inline

Return the number of neighbors including the local processor.

Definition at line 180 of file communication.hpp.

◆ IAmMaster()

bool mfem::GroupTopology::IAmMaster ( int g) const
inline

Return true if I am master for group 'g'.

Definition at line 186 of file communication.hpp.

◆ Load()

void mfem::GroupTopology::Load ( std::istream & in)

Load the data from a stream.

Definition at line 296 of file communication.cpp.

◆ MyRank()

int mfem::GroupTopology::MyRank ( ) const
inline

Return the MPI rank within this object's communicator.

Definition at line 168 of file communication.hpp.

◆ NGroups()

int mfem::GroupTopology::NGroups ( ) const
inline

Return the number of groups.

Definition at line 177 of file communication.hpp.

◆ NRanks()

int mfem::GroupTopology::NRanks ( ) const
inline

Return the number of MPI ranks within this object's communicator.

Definition at line 171 of file communication.hpp.

◆ Save()

void mfem::GroupTopology::Save ( std::ostream & out) const

Save the data in a stream.

Definition at line 273 of file communication.cpp.

◆ SetComm()

void mfem::GroupTopology::SetComm ( MPI_Comm comm)
inline

Set the MPI communicator to 'comm'.

Definition at line 162 of file communication.hpp.

◆ Swap()

void mfem::GroupTopology::Swap ( GroupTopology & other)

Swap the internal data with another GroupTopology object.

Definition at line 341 of file communication.cpp.


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