Array for acessing data of a patch. It supports variable striding.
More...
#include <View.h>
|
using | T_ptr = typename std::add_pointer< T >::type |
|
|
| View () |
| Constructs a view of size 0.
|
|
| View (T_ptr data, const std::array< int, D > &strides, const std::array< int, D > &ghost_start, const std::array< int, D > &start, const std::array< int, D > &end, const std::array< int, D > &ghost_end) |
| Construct a new View object. More...
|
|
T & | operator[] (const std::array< int, D > &coord) const |
| Get a reference to the element at the specified coordinate. More...
|
|
template<class... Types> |
T & | operator() (Types... args) const |
| Get a reference to the element at the specified coordinate. More...
|
|
void | set (const std::array< int, D > &coord, T value) const |
| Set the value at a coordinate to the specified value. More...
|
|
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.
|
|
| operator View< std::add_const_t< T >, D > () const |
|
|
int | getIndex (const std::array< int, D > &coord) const |
|
T_ptr | getData () const |
|
template<typename T, int D>
class ThunderEgg::View< T, D >
Array for acessing data of a patch. It supports variable striding.
- Template Parameters
-
D | number of cartesian dimensions |
◆ View()
template<typename T , int D>
ThunderEgg::View< T, D >::View |
( |
T_ptr |
data, |
|
|
const std::array< int, D > & |
strides, |
|
|
const std::array< int, D > & |
ghost_start, |
|
|
const std::array< int, D > & |
start, |
|
|
const std::array< int, D > & |
end, |
|
|
const std::array< int, D > & |
ghost_end |
|
) |
| |
|
inline |
Construct a new View object.
- Parameters
-
data | pointer to the first element in the patch (non-ghost cell element) |
strides | the strides in each direction |
lengths | the lengths in each direction |
num_ghost_cells | the number of ghost cells on each side of the patch |
ldm | the local data manager for the data |
◆ operator()()
template<typename T , int D>
template<class... Types>
Get a reference to the element at the specified coordinate.
for example uasage in 3d is view(ix,iy,iz)
- Template Parameters
-
- Parameters
-
args | the coordnate in x,y,z form |
- Returns
- const double& the value
◆ operator[]()
template<typename T , int D>
T& ThunderEgg::View< T, D >::operator[] |
( |
const std::array< int, D > & |
coord | ) |
const |
|
inline |
Get a reference to the element at the specified coordinate.
- Parameters
-
- Returns
- double& the element
◆ set()
template<typename T , int D>
void ThunderEgg::View< T, D >::set |
( |
const std::array< int, D > & |
coord, |
|
|
T |
value |
|
) |
| const |
|
inline |
Set the value at a coordinate to the specified value.
- Parameters
-
coord | the coordinate |
value | the value |
The documentation for this class was generated from the following file: