ThunderEgg  1.0.0
ThunderEgg::GMG::InterLevelComm< D > Class Template Reference

Facilitates communication between a finer domain and a coarser domain. More...

#include <InterLevelComm.h>

Public Member Functions

 InterLevelComm (const Domain< D > &coarser_domain, const Domain< D > &finer_domain)
 Create a new InterLevelComm object. More...
 
 ~InterLevelComm ()
 Destroy the InterLevelComm object.
 
Vector< D > getNewGhostVector (int num_components) const
 Allocate a new vector for ghost patch values. More...
 
const std::vector< std::pair< int, std::reference_wrapper< const PatchInfo< D > > > > & getPatchesWithLocalParent () const
 Get the vector of finer patches that have a local parent. More...
 
const std::vector< std::pair< int, std::reference_wrapper< const PatchInfo< D > > > > & getPatchesWithGhostParent () const
 Get the vector of finer patches that have a ghost parent. More...
 
void sendGhostPatchesStart (Vector< D > &vector, const Vector< D > &ghost_vector)
 Start the communication for sending ghost values. More...
 
void sendGhostPatchesFinish (Vector< D > &vector, const Vector< D > &ghost_vector)
 Finish the communication for sending ghost values. More...
 
void getGhostPatchesStart (const Vector< D > &vector, Vector< D > &ghost_vector)
 Start the communication for getting ghost values. More...
 
void getGhostPatchesFinish (const Vector< D > &vector, Vector< D > &ghost_vector)
 Finish the communication for getting ghost values. More...
 
const Domain< D > & getCoarserDomain () const
 Get the coarser Domain. More...
 
const Domain< D > & getFinerDomain () const
 Get the finer Domain. More...
 

Detailed Description

template<int D>
class ThunderEgg::GMG::InterLevelComm< D >

Facilitates communication between a finer domain and a coarser domain.

This class will determine the following things:

Which patches in the finer domain have a parent patch in the coarser domain on the same rank?

Which patches in the finer domain have a parent patch in the coarser domain on a different rank?

Scatter functions are provided for scattering to and from the coarse vector to the coarse ghost vector.

Constructor & Destructor Documentation

◆ InterLevelComm()

template<int D>
ThunderEgg::GMG::InterLevelComm< D >::InterLevelComm ( const Domain< D > &  coarser_domain,
const Domain< D > &  finer_domain 
)
inline

Create a new InterLevelComm object.

Parameters
coarse_domainthe coarser DomainCollection.
fine_domainthe finer DomainCollection.

Member Function Documentation

◆ getCoarserDomain()

template<int D>
const Domain<D>& ThunderEgg::GMG::InterLevelComm< D >::getCoarserDomain ( ) const
inline

Get the coarser Domain.

Returns
const Domain<D>& the coarser Domain

◆ getFinerDomain()

template<int D>
const Domain<D>& ThunderEgg::GMG::InterLevelComm< D >::getFinerDomain ( ) const
inline

Get the finer Domain.

Returns
const Domain<D>& the finer Domain

◆ getGhostPatchesFinish()

template<int D>
void ThunderEgg::GMG::InterLevelComm< D >::getGhostPatchesFinish ( const Vector< D > &  vector,
Vector< D > &  ghost_vector 
)
inline

Finish the communication for getting ghost values.

This will send the values in the vector to the ghost vector, and will overwrite the values in the ghost vector. This is essentially a forward scatter.

This function is seperated into a Start and Finish function, this allows for other computations to happen while communicating.

Parameters
vectorthe vector
ghost_vectorthe associated ghost vector

◆ getGhostPatchesStart()

template<int D>
void ThunderEgg::GMG::InterLevelComm< D >::getGhostPatchesStart ( const Vector< D > &  vector,
Vector< D > &  ghost_vector 
)
inline

Start the communication for getting ghost values.

This will send the values in the vector to the ghost vector, and will overwrite the values in the ghost vector. This is essentially a forward scatter.

This function is seperated into a Start and Finish function, this allows for other computations to happen while the communicating.

Parameters
vectorthe vector
ghost_vectorthe associated ghost vector

◆ getNewGhostVector()

template<int D>
Vector<D> ThunderEgg::GMG::InterLevelComm< D >::getNewGhostVector ( int  num_components) const
inline

Allocate a new vector for ghost patch values.

Parameters
num_componentsthe number of components
Returns
the newly allocated vector.

◆ getPatchesWithGhostParent()

template<int D>
const std::vector<std::pair<int, std::reference_wrapper<const PatchInfo<D> > > >& ThunderEgg::GMG::InterLevelComm< D >::getPatchesWithGhostParent ( ) const
inline

Get the vector of finer patches that have a ghost parent.

The vector will consist of pair values:

  • First value: the local index in the ghost vector of the parent patch
  • Second value: a reference to the child patch
Returns
const std::vector<std::pair<int, std::reference_wrapper<const PatchInfo<D>>>>& the vector

◆ getPatchesWithLocalParent()

template<int D>
const std::vector<std::pair<int, std::reference_wrapper<const PatchInfo<D> > > >& ThunderEgg::GMG::InterLevelComm< D >::getPatchesWithLocalParent ( ) const
inline

Get the vector of finer patches that have a local parent.

The vector will consist of pair values:

  • First value: the local index of the parent patch
  • Second value: a reference to the child patch
Returns
const std::vector<std::pair<int, std::reference_wrapper<const PatchInfo<D>>>>& the vector

◆ sendGhostPatchesFinish()

template<int D>
void ThunderEgg::GMG::InterLevelComm< D >::sendGhostPatchesFinish ( Vector< D > &  vector,
const Vector< D > &  ghost_vector 
)
inline

Finish the communication for sending ghost values.

This will send the values in the ghost vector and will add them to the values in the vector. This is essentially a reverse scatter.

This function is seperated into a Start and Finish function, this allows for other computations to happen while the communicating.

Parameters
vectorthe vector
ghost_vectorthe associated ghost vector

◆ sendGhostPatchesStart()

template<int D>
void ThunderEgg::GMG::InterLevelComm< D >::sendGhostPatchesStart ( Vector< D > &  vector,
const Vector< D > &  ghost_vector 
)
inline

Start the communication for sending ghost values.

This will send the values in the ghost vector and will add them to the values in the vector. This is essentially a reverse scatter.

This function is seperated into a Start and Finish function, this allows for other computations to happen while the communicating.

Parameters
vectorthe vector
ghost_vectorthe associated ghost vector

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