SUNphi  1.0
SUNphi::ShadowGrid< NDims, Coord, Idx > Class Template Reference

#include <Partitioner.hpp>

Public Member Functions

void unSetVol () const
 Unset the volume.
 
void unSetSides () const
 Unset the sides.
 
bool setVol (const Vol &v) const
 Set the volume to v.
 
bool setSides (const Sides &s) const
 Set the sides to s.
 
const VolgetVol () const
 Get the volume.
 
const SidesgetSides () const
 Get the sides.
 
const SidegetSide (int mu) const
 Get a given side.
 
const Vol getVolFromSides () const
 Get the volume from sides. More...
 
bool volIsSet () const
 Check if the volume is set.
 
bool sidesAreSet () const
 Check if the sides are set.
 
template<typename G >
 ShadowGrid (G &&actualGrid, const char *name)
 Constructor taking the grid and type-erasing it. More...
 
bool operator< (const ShadowGrid &oth) const
 Comparison operator.
 

Public Attributes

const void * actualGrid
 Reference to the actual grid.
 
const char * name
 Name for debug purpose.
 
const std::function< void(const Sides &)> setSidesOfActualGrid
 Function to invocate setting the sides of the actual grid.
 

Private Types

typedef std::array< Coord, NDims > Coords
 
typedef std::array< Coord, 2 *NDims > Neigh
 
typedef Idx Vol
 
typedef Coord Side
 
typedef Coords Sides
 

Private Attributes

std::optional< Volvolume
 
std::optional< Coordssides
 Sdes of the grid.
 

Detailed Description

template<int NDims, typename Coord, typename Idx>
class SUNphi::ShadowGrid< NDims, Coord, Idx >

A generic grid to type-erase the actual grid

While looping on all possible realization of a grid, there is little point in keeping updated the hash-table and other features of the target grid. We make a dedicated, simplified version of the grid, and work with it. We could make the Grid a dynamic polymorhic class but this way we risk to introduce severe performances degradation when calling any method (e.g. neighbors search)

Definition at line 31 of file Partitioner.hpp.

Member Typedef Documentation

template<int NDims, typename Coord , typename Idx >
typedef std::array<Coord,NDims> SUNphi::ShadowGrid< NDims, Coord, Idx >::Coords
private

Type to hold sizes, coordinate, etc

Definition at line 33 of file Partitioner.hpp.

template<int NDims, typename Coord , typename Idx >
typedef std::array<Coord,2*NDims> SUNphi::ShadowGrid< NDims, Coord, Idx >::Neigh
private

Type to hold the neighbors

Definition at line 33 of file Partitioner.hpp.

template<int NDims, typename Coord , typename Idx >
typedef Coord SUNphi::ShadowGrid< NDims, Coord, Idx >::Side
private

Type to hold side

Definition at line 33 of file Partitioner.hpp.

template<int NDims, typename Coord , typename Idx >
typedef Coords SUNphi::ShadowGrid< NDims, Coord, Idx >::Sides
private

Type to hold sides

Definition at line 33 of file Partitioner.hpp.

template<int NDims, typename Coord , typename Idx >
typedef Idx SUNphi::ShadowGrid< NDims, Coord, Idx >::Vol
private

Type to hold volume

Definition at line 33 of file Partitioner.hpp.

Constructor & Destructor Documentation

template<int NDims, typename Coord , typename Idx >
template<typename G >
SUNphi::ShadowGrid< NDims, Coord, Idx >::ShadowGrid ( G &&  actualGrid,
const char *  name 
)
inline

Constructor taking the grid and type-erasing it.

Reads the sides

Reads the volume

Definition at line 163 of file Partitioner.hpp.

Member Function Documentation

template<int NDims, typename Coord , typename Idx >
const Vol SUNphi::ShadowGrid< NDims, Coord, Idx >::getVolFromSides ( ) const
inline

Get the volume from sides.

Returned value

Definition at line 124 of file Partitioner.hpp.

Member Data Documentation

template<int NDims, typename Coord , typename Idx >
std::optional<Vol> SUNphi::ShadowGrid< NDims, Coord, Idx >::volume
mutableprivate

Volume of the grid, stored as optional value

Storing as optional allows to check if the value is set or not in a coincise way

Definition at line 39 of file Partitioner.hpp.


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