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

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

#include <PatchArray.h>

Public Member Functions

 PatchArray ()=default
 Construct a new PatchArray object of size zero. More...
 
 PatchArray (const std::array< int, D > &lengths, int num_components, int num_ghost_cells)
 Construct a new PatchArray object. More...
 
 PatchArray (const PatchArray< D > &other)
 Copy constructor. More...
 
PatchArray< D > & operator= (const PatchArray< D > &other)
 Copy assignment. More...
 
template<int M>
View< double, M+1 > 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+1 > 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+1 > 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+1 > &coord) const
 
template<class... Types>
const double & operator() (Types... args) const
 
void set (const std::array< int, D+1 > &coord, double value) const
 
double & operator[] (const std::array< int, D+1 > &coord)
 
template<class... Types>
double & operator() (Types... args)
 
void set (const std::array< int, D+1 > &coord, double value)
 
const std::array< int, D+1 > & getStrides () const
 Get the strides of the patch in each direction.
 
const std::array< int, D+1 > & getStart () const
 Get the coordinate of the first element.
 
const std::array< int, D+1 > & getEnd () const
 Get the coordinate of the last element.
 
const std::array< int, D+1 > & getGhostStart () const
 Get the coordinate of the first ghost cell element.
 
const std::array< int, D+1 > & getGhostEnd () const
 Get the coordinate of the last ghost cell element.
 
const PatchView< double, D > & getView ()
 Get the View for the array. More...
 

Detailed Description

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

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

Template Parameters
Dnumber of cartesian dimensions

Constructor & Destructor Documentation

◆ PatchArray() [1/3]

template<int D>
ThunderEgg::PatchArray< D >::PatchArray ( )
default

Construct a new PatchArray object of size zero.

◆ PatchArray() [2/3]

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

Construct a new PatchArray object.

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

◆ PatchArray() [3/3]

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

Copy constructor.

Parameters
otherthe array to copy

Member Function Documentation

◆ getGhostSliceOn()

template<int D>
template<int M>
View<double, M + 1> ThunderEgg::PatchArray< 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 + 1> ThunderEgg::PatchArray< 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+1> a view to the slice on the face

◆ getSliceOn() [2/2]

template<int D>
template<int M>
View<const double, M + 1> ThunderEgg::PatchArray< 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

◆ getView()

template<int D>
const PatchView<double, D>& ThunderEgg::PatchArray< D >::getView ( )
inline

Get the View for the array.

Returns
const PatchView<double, D>& the View

◆ operator=()

template<int D>
PatchArray<D>& ThunderEgg::PatchArray< D >::operator= ( const PatchArray< 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: