NetDEM v1.0
Loading...
Searching...
No Matches
netdem::MPIManager Class Reference

Manages the data exchange in a DEM simulation. More...

#include <mpi_manager.hpp>

Public Member Functions

 MPIManager ()
 Default constructor for MPIManager class.
 
void Init (Simulation *sim)
 Initialize the MPIManager with a Simulation object.
 
void CommitMPIDataType ()
 Commit the MPI data type for particle exchange.
 
int GetSelfRank () const
 Get the rank id of the domain.
 
int GetTotalRank () const
 Get the total ranks of the simulation.
 
void BuildContactRefTable ()
 Build a look-up table for contacts between particles.
 
void RecycleParticleProxy ()
 Recycle a particle proxy.
 
void ExchangeDataTransfer ()
 Exchange data between processors using ghost particles as proxies.
 
void ExchangeDataProxy ()
 Exchange data between processors using particle proxies.
 
void ExchangeDataBack ()
 Send exchanged data to original processors using ghost particles as proxies.
 
void RecycleParticleGhost ()
 Recycle ghost particles.
 
void ClearContactRefTable ()
 Clear the contact look-up table.
 
void SyncShapeToAllProcessors ()
 Synchronize shape information between all processors.
 
void SyncParticleToGhostSubDomains ()
 Synchronize particle information with ghost sub-domains.
 
void SyncContactToGhostSubDomains ()
 Synchronize contact information with ghost sub-domains.
 
void SyncWallToGhostSubDomains ()
 Synchronize wall information with ghost sub-domains.
 
 ~MPIManager ()
 

Static Public Member Functions

static int GetSelfRankStatic ()
 
static int GetTotalRankStatic ()
 
static void SyncDataAmongProcessors (VecXT< int > *const data)
 
static void SyncDataAmongProcessors (VecXT< double > *const data)
 

Detailed Description

Manages the data exchange in a DEM simulation.

Basicly, a DEM cycle would involve three rounds of data exchange:

  • Round one: exchange particles as proxies and their corresponding contacts. A particle will be sent as a proxy as its surface exceeds the domain boundary (such that it could potentially contact with particles in other domains). If a particle needs to be sent to other domains as a proxy, its contacts need also to be sent.
  • Round two: exchange the contacts of particle proxies back to its original domain, so that the contact forces could be applied onto the original particles.
  • Round three: excange particles and their corresponding contacts if particle get out of the domain (i.e., the particle turn to belong to another domain after updating its positions at the end of a DEM cycle).

Terminologies:

  • Particle proxy or contact proxy: Particle belongs to one domain, whereas if it overlaps with other domain, it needs to seed out as a proxy for contact detection and resolution. Thus, proxy means a real object but not belongs to one domain.
  • Particle ghost: If a particle is gone (e.g., removed or migrated to another domain), it will leave a ghost copy of itself (to prevent the nullptr particle in the contacts). Thus, ghost means a virtual object.
  • Note: proxy and ghost may exchange, which has facilitated the programming and computational efficiency.

Constructor & Destructor Documentation

◆ MPIManager()

netdem::MPIManager::MPIManager ( )

Default constructor for MPIManager class.

◆ ~MPIManager()

netdem::MPIManager::~MPIManager ( )

Destructor for MPIManager object

Member Function Documentation

◆ BuildContactRefTable()

void netdem::MPIManager::BuildContactRefTable ( )

Build a look-up table for contacts between particles.

◆ ClearContactRefTable()

void netdem::MPIManager::ClearContactRefTable ( )

Clear the contact look-up table.

◆ CommitMPIDataType()

void netdem::MPIManager::CommitMPIDataType ( )

Commit the MPI data type for particle exchange.

◆ ExchangeDataBack()

void netdem::MPIManager::ExchangeDataBack ( )

Send exchanged data to original processors using ghost particles as proxies.

◆ ExchangeDataProxy()

void netdem::MPIManager::ExchangeDataProxy ( )

Exchange data between processors using particle proxies.

◆ ExchangeDataTransfer()

void netdem::MPIManager::ExchangeDataTransfer ( )

Exchange data between processors using ghost particles as proxies.

◆ GetSelfRank()

int netdem::MPIManager::GetSelfRank ( ) const

Get the rank id of the domain.

◆ GetSelfRankStatic()

int netdem::MPIManager::GetSelfRankStatic ( )
static

Gets the rank of the current process

Returns
The rank of the current process

◆ GetTotalRank()

int netdem::MPIManager::GetTotalRank ( ) const

Get the total ranks of the simulation.

◆ GetTotalRankStatic()

int netdem::MPIManager::GetTotalRankStatic ( )
static

Gets the total number of ranks

Returns
The total number of ranks

◆ Init()

void netdem::MPIManager::Init ( Simulation * sim)

Initialize the MPIManager with a Simulation object.

Parameters
simPointer to a Simulation object

◆ RecycleParticleGhost()

void netdem::MPIManager::RecycleParticleGhost ( )

Recycle ghost particles.

◆ RecycleParticleProxy()

void netdem::MPIManager::RecycleParticleProxy ( )

Recycle a particle proxy.

◆ SyncContactToGhostSubDomains()

void netdem::MPIManager::SyncContactToGhostSubDomains ( )

Synchronize contact information with ghost sub-domains.

◆ SyncDataAmongProcessors() [1/2]

void netdem::MPIManager::SyncDataAmongProcessors ( VecXT< double > *const data)
static

Synchronizes data among all processes for a double vector

Parameters
dataPointer to the double vector to synchronize

◆ SyncDataAmongProcessors() [2/2]

void netdem::MPIManager::SyncDataAmongProcessors ( VecXT< int > *const data)
static

Synchronizes data among all processes for an integer vector

Parameters
dataPointer to the integer vector to synchronize

◆ SyncParticleToGhostSubDomains()

void netdem::MPIManager::SyncParticleToGhostSubDomains ( )

Synchronize particle information with ghost sub-domains.

◆ SyncShapeToAllProcessors()

void netdem::MPIManager::SyncShapeToAllProcessors ( )

Synchronize shape information between all processors.

◆ SyncWallToGhostSubDomains()

void netdem::MPIManager::SyncWallToGhostSubDomains ( )

Synchronize wall information with ghost sub-domains.


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