ThunderEgg  1.0.0
ThunderEgg::Domain< D > Class Template Reference

Uses a collection of PatchInfo objects to represent the domain of the problem. More...

#include <Domain.h>

Public Member Functions

template<class InputIterator >
 Domain (Communicator comm, int id, std::array< int, D > ns, int num_ghost_cells, InputIterator first_pinfo, InputIterator last_pinfo)
 Construct a new Domain object. More...
 
const CommunicatorgetCommunicator () const
 Get the Communicator object associated with this domain. More...
 
const std::vector< PatchInfo< D > > & getPatchInfoVector () const
 Get a vector of PatchInfo pointers where index in the vector corresponds to the patch's local index.
 
const std::array< int, D > & getNs () const
 Get the number of cells in each direction. More...
 
int getNumGlobalPatches () const
 Get the number of global patches.
 
int getNumLocalPatches () const
 Get the number of local patches.
 
int getNumGlobalCells () const
 get the number of global cells
 
int getNumLocalCells () const
 Get get the number of local cells.
 
int getNumLocalCellsWithGhost () const
 Get get the number of local cells (including ghost cells)
 
int getNumCellsInPatch () const
 Get the number of cells in a patch.
 
int getNumGhostCells () const
 get the number of ghost cell on each side of a patch
 
double volume () const
 Get the volume of the domain. More...
 
void setTimer (std::shared_ptr< Timer > timer) const
 Set the Timer object. More...
 
std::shared_ptr< TimergetTimer () const
 Get the Timer object. More...
 
bool hasTimer () const
 Check if the Domain has a timer associated with it. More...
 
int getId () const
 Get the domain's id. More...
 

Detailed Description

template<int D>
class ThunderEgg::Domain< D >

Uses a collection of PatchInfo objects to represent the domain of the problem.

Each patch passed to the constructor needs to have the following complete information:

  • Each patch within a domain have to have a unique id set.

Each patch needs to have the neighboring patch information filled out, with the id of neighbor patches.

When passed to the constructor, the constructor will create an indexing for the This class mainly manages a set of patches that makes up the domain. It is responsible for setting up the indexing of the domains, which is used in the rest of the ThunderEgg library.

Template Parameters
Dthe number of Cartesian dimensions

Constructor & Destructor Documentation

◆ Domain()

template<int D>
template<class InputIterator >
ThunderEgg::Domain< D >::Domain ( Communicator  comm,
int  id,
std::array< int, D >  ns,
int  num_ghost_cells,
InputIterator  first_pinfo,
InputIterator  last_pinfo 
)
inline

Construct a new Domain object.

Template Parameters
InputIteratorthe iterator for PatchInfo objects
Parameters
idthe id of the domain should be unique within a multigrid cycle
nsthe number of cells in each direction
num_ghost_cellsthe number of ghost cells on each side of the patch
first_pinfostart iterator for PatchInfo objects
last_pinfoend iterator for PatchInfo objects

Member Function Documentation

◆ getCommunicator()

template<int D>
const Communicator& ThunderEgg::Domain< D >::getCommunicator ( ) const
inline

Get the Communicator object associated with this domain.

Returns
const Communicator& the Communicator

◆ getId()

template<int D>
int ThunderEgg::Domain< D >::getId ( ) const
inline

Get the domain's id.

Returns
int the id

◆ getNs()

template<int D>
const std::array<int, D>& ThunderEgg::Domain< D >::getNs ( ) const
inline

Get the number of cells in each direction.

◆ getTimer()

template<int D>
std::shared_ptr<Timer> ThunderEgg::Domain< D >::getTimer ( ) const
inline

Get the Timer object.

Returns
std::shared_ptr<Timer> the timer

◆ hasTimer()

template<int D>
bool ThunderEgg::Domain< D >::hasTimer ( ) const
inline

Check if the Domain has a timer associated with it.

Returns
true if the Domain has a timer associated with it

◆ setTimer()

template<int D>
void ThunderEgg::Domain< D >::setTimer ( std::shared_ptr< Timer timer) const
inline

Set the Timer object.

Parameters
timerthe timer

◆ volume()

template<int D>
double ThunderEgg::Domain< D >::volume ( ) const
inline

Get the volume of the domain.

For 2D, this will be the area.


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