Schnek
schnek::DomainSubdivision< GridType > Class Template Referenceabstract

Interface for wrapping and exchanging boundaries . More...

#include <domainsubdivision.hpp>

Inheritance diagram for schnek::DomainSubdivision< GridType >:

Public Types

enum  { Rank = GridType::Rank }
 
typedef GridType::IndexType LimitType
 
typedef GridType::value_type value_type
 
typedef GridType::CheckingPolicyType CheckingPolicyType
 
typedef GridType::StoragePolicyType StoragePolicyType
 
typedef Grid< unsigned char, 1, GridAssertCheckBufferType
 
typedef Range< int, Rank > DomainType
 
typedef Boundary< Rank > BoundaryType
 
typedef std::shared_ptr< BoundaryTypepBoundaryType
 

Public Member Functions

 DomainSubdivision ()
 Default constructor.
 
virtual ~DomainSubdivision ()
 Virtual destructor. More...
 
int getDelta ()
 
virtual void init (const LimitType &low, const LimitType &high, int delta)=0
 
void init (const DomainType &domain, int delta)
 
void init (const GridType &grid, int delta)
 
void init (const LimitType &size, int delta)
 
virtual const DomainTypegetGlobalDomain () const =0
 Return the global domain size excluding ghost cells.
 
const DomainTypegetDomain () const
 Return the local domain size.
 
const LimitType & getLo () const
 Return the minimum of the local domain.
 
const LimitType & getHi () const
 Return the maximum of the local domain.
 
DomainType getInnerDomain () const
 Return the local inner domain size.
 
LimitType getInnerLo () const
 Return the minimum of the local inner domain.
 
LimitType getInnerHi () const
 Return the maximum of the local inner domain.
 
template<typename T , template< size_t > class CheckingPolicy>
Range< T, Rank, CheckingPolicy > getInnerExtent (const Range< T, Rank, CheckingPolicy > &globalExtent) const
 Return the local inner physical extent.
 
template<typename T , template< size_t > class CheckingPolicy>
Range< T, Rank, CheckingPolicy > getInnerExtent (const Array< T, Rank, CheckingPolicy > &globalExtent) const
 
virtual void exchange (GridType &grid, size_t dim)=0
 Exchange the boundaries of a field function in the direction given by dim.
 
virtual void accumulate (GridType &grid, size_t dim)=0
 Exchange the boundaries of a field function summing the data from ghost cells and inner cells.
 
virtual void exchangeData (size_t dim, int orientation, BufferType &in, BufferType &out)=0
 
virtual double avgReduce (double) const =0
 Return the average of a single value over all the processes.
 
virtual int avgReduce (int) const =0
 Return the average of a single value over all the processes.
 
virtual double sumReduce (double) const =0
 Return the average of a single value over all the processes.
 
virtual int sumReduce (int) const =0
 Return the average of a single value over all the processes.
 
virtual double maxReduce (double) const =0
 Return the maximum of a single value over all the processes.
 
virtual int maxReduce (int) const =0
 Return the maximum of a single value over all the processes.
 
virtual double minReduce (double) const =0
 Return the minimum of a single value over all the processes.
 
virtual int minReduce (int) const =0
 Return the minimum of a single value over all the processes.
 
virtual bool master () const =0
 Return true if this is the master process and false otherwise.
 
virtual int procnum () const =0
 Return the process number.
 
virtual int procCount () const =0
 Return the total number of processes.
 
virtual int getUniqueId () const =0
 get a unique Id
 
virtual bool isBoundLo (size_t dim)=0
 
virtual bool isBoundHi (size_t dim)=0
 
void exchange (GridType &grid)
 
void accumulate (GridType &grid)
 

Protected Attributes

pBoundaryType bounds
 

Detailed Description

template<class GridType>
class schnek::DomainSubdivision< GridType >

Interface for wrapping and exchanging boundaries .

This interface is used to exchange the boundaries of grids between processes. Any implementation should treat the fields as periodic. The boundary conditions can be appplied afterwards.

Constructor & Destructor Documentation

◆ ~DomainSubdivision()

template<class GridType >
virtual schnek::DomainSubdivision< GridType >::~DomainSubdivision ( )
inlinevirtual

Virtual destructor.

Needed for virtual methods.

Member Function Documentation

◆ getInnerExtent()

template<class GridType >
template<typename T , template< size_t > class CheckingPolicy>
Range<T, Rank, CheckingPolicy> schnek::DomainSubdivision< GridType >::getInnerExtent ( const Array< T, Rank, CheckingPolicy > &  globalExtent) const
inline

Return the local inner physical extent

Convenience method. This assumes the lower bound of the global extent is 0.0

◆ init() [1/4]

template<class GridType >
virtual void schnek::DomainSubdivision< GridType >::init ( const LimitType &  low,
const LimitType &  high,
int  delta 
)
pure virtual

Initialize the domain subdivision.

The DomainSubdivision class is responsible for subdividing the domain for the different processes. The size of the local domain will be returned by the getDomain, getHi, and getLo methods.

Implemented in schnek::SerialSubdivision< GridType >.

◆ init() [2/4]

template<class GridType >
void schnek::DomainSubdivision< GridType >::init ( const DomainType domain,
int  delta 
)
inline

Convenience method. Initialise the boundary with the extent of a grid.

◆ init() [3/4]

template<class GridType >
void schnek::DomainSubdivision< GridType >::init ( const GridType &  grid,
int  delta 
)
inline

Convenience method. Initialise the boundary with the extent of the grid.

◆ init() [4/4]

template<class GridType >
void schnek::DomainSubdivision< GridType >::init ( const LimitType &  size,
int  delta 
)
inline

Convenience method. Initialise the boundary with the extent of the grid.

◆ isBoundHi()

template<class GridType >
virtual bool schnek::DomainSubdivision< GridType >::isBoundHi ( size_t  dim)
pure virtual

Returns true if this process is on the upper bound of the global domain

Parameters
dimThe dimension in which to inspect
Returns
A boolean indicating if this process is on the upper boud of the global domain

Implemented in schnek::SerialSubdivision< GridType >.

◆ isBoundLo()

template<class GridType >
virtual bool schnek::DomainSubdivision< GridType >::isBoundLo ( size_t  dim)
pure virtual

Returns true if this process is on the lower bound of the global domain

Parameters
dimThe dimension in which to inspect
Returns
A boolean indicating if this process is on the lower boud of the global domain

Implemented in schnek::SerialSubdivision< GridType >.


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