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

Array for acessing data of a patch. It supports variable striding. More...

#include <ComponentArray.h>

Public Member Functions

 ComponentArray (const std::array< int, D > &lengths, int num_ghost_cells)
 Construct a new View object. More...
 
 ComponentArray (const ComponentArray< D > &other)
 Copy constructor. More...
 
ComponentArray< D > & operator= (const ComponentArray< D > &other)
 Copy assignment. More...
 
template<int M>
View< double, M > getSliceOn (Face< D, M > f, const std::array< int, D - M > &offset)
 Get the slice on a given face. More...
 
template<int M>
View< const double, M > getSliceOn (Face< D, M > f, const std::array< int, D - M > &offset) const
 Get the slice on a given face. More...
 
template<int M>
View< double, M > getGhostSliceOn (Face< D, M > f, const std::array< size_t, D - M > &offset) const
 Get the gosts slice on a given face. More...
 
const double & operator[] (const std::array< int, D > &coord) const
 
template<class... Types>
const double & operator() (Types... args) const
 
void set (const std::array< int, D > &coord, double value) const
 
double & operator[] (const std::array< int, D > &coord)
 
template<class... Types>
double & operator() (Types... args)
 
void set (const std::array< int, D > &coord, double value)
 
const std::array< int, D > & getStrides () const
 Get the strides of the patch in each direction.
 
const std::array< int, D > & getStart () const
 Get the coordinate of the first element.
 
const std::array< int, D > & getEnd () const
 Get the coordinate of the last element.
 
const std::array< int, D > & getGhostStart () const
 Get the coordinate of the first ghost cell element.
 
const std::array< int, D > & getGhostEnd () const
 Get the coordinate of the last ghost cell element.
 

Detailed Description

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

Array for acessing data of a patch. It supports variable striding.

Template Parameters
Dnumber of cartesian dimensions

Constructor & Destructor Documentation

◆ ComponentArray() [1/2]

template<int D>
ThunderEgg::ComponentArray< D >::ComponentArray ( const std::array< int, D > &  lengths,
int  num_ghost_cells 
)
inline

Construct a new View object.

Parameters
lengthsthe lengths in each direction
num_ghost_cellsthe number of ghost cells on each side of the patch

◆ ComponentArray() [2/2]

template<int D>
ThunderEgg::ComponentArray< D >::ComponentArray ( const ComponentArray< D > &  other)
inline

Copy constructor.

Parameters
otherthe array to copy

Member Function Documentation

◆ getGhostSliceOn()

template<int D>
template<int M>
View<double, M> ThunderEgg::ComponentArray< D >::getGhostSliceOn ( Face< D, M >  f,
const std::array< size_t, D - M > &  offset 
) const
inline

Get the gosts slice on a given face.

Template Parameters
Mthe dimension of the face
Parameters
fthe face
offsetoffset the offset of the value {0,..,0} first ghost cell slice touching that face face
Returns
View<M> a view to the slice on the face

◆ getSliceOn() [1/2]

template<int D>
template<int M>
View<double, M> ThunderEgg::ComponentArray< D >::getSliceOn ( Face< D, M >  f,
const std::array< int, D - M > &  offset 
)
inline

Get the slice on a given face.

Template Parameters
Mthe dimension of the face
Parameters
fthe face
offsetoffset the offset of the value {0,..,0} is the non ghost cell touching the face. {-1,..,-1} is the first ghost cell touching that face
Returns
View<M> a view to the slice on the face

◆ getSliceOn() [2/2]

template<int D>
template<int M>
View<const double, M> ThunderEgg::ComponentArray< D >::getSliceOn ( Face< D, M >  f,
const std::array< int, D - M > &  offset 
) const
inline

Get the slice on a given face.

Template Parameters
Mthe dimension of the face
Parameters
fthe face
offsetoffset the offset of the value {0,..,0} is the non ghost cell touching the face. {-1,..,-1} is the first ghost cell touching that face
Returns
ConstView<M> a view to the slice on the face

◆ operator=()

template<int D>
ComponentArray<D>& ThunderEgg::ComponentArray< D >::operator= ( const ComponentArray< D > &  other)
inline

Copy assignment.

Parameters
otherthe array to copy
Returns
PatchArray<D>& this

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