Alsvinn  0.5.3
The fast FVM simulator with UQ support
Functions
index.hpp File Reference

Go to the source code of this file.

Functions

const char * dataAtRawConst (const char *pointer, size_t ix, size_t iy, size_t iz, size_t nx, size_t ny)
 dataAtRaw gets the data at the given indexes More...
 
char * dataAtRaw (char *pointer, size_t ix, size_t iy, size_t iz, size_t nx, size_t ny)
 dataAtRaw gets the data at the given indexes More...
 
template<class T >
const T & dataAt (const T *pointer, size_t ix, size_t iy, size_t iz, size_t nx, size_t ny)
 dataAt gets the data at the given address More...
 
template<class T >
T & dataAt (T *pointer, size_t ix, size_t iy, size_t iz, size_t nx, size_t ny)
 dataAt gets the data at the given address More...
 
size_t calculateIndex (size_t x, size_t y, size_t z, size_t nx, size_t ny)
 calculateIndex calculates the index for the given coordinates More...
 

Function Documentation

◆ calculateIndex()

size_t calculateIndex ( size_t  x,
size_t  y,
size_t  z,
size_t  nx,
size_t  ny 
)
inline

calculateIndex calculates the index for the given coordinates

Parameters
xthe x index
ythe y index
zthe z index
nxthe number of cells in x direction
nythe number of cells in y direction
Returns
the linear index

◆ dataAt() [1/2]

template<class T >
const T& dataAt ( const T *  pointer,
size_t  ix,
size_t  iy,
size_t  iz,
size_t  nx,
size_t  ny 
)
inline

dataAt gets the data at the given address

Parameters
pointerthe pointer to the data
ixthe x index
iythe y index
izthe z index
nxthe number of elements in x direction (in bytes)
nythe number of elements in z direction (in bytes)
Returns
the data element

◆ dataAt() [2/2]

template<class T >
T& dataAt ( T *  pointer,
size_t  ix,
size_t  iy,
size_t  iz,
size_t  nx,
size_t  ny 
)
inline

dataAt gets the data at the given address

Parameters
pointerthe pointer to the data
ixthe x index
iythe y index
izthe z index
nxthe number of elements in x direction (in bytes)
nythe number of elements in z direction (in bytes)
Returns
the data element

◆ dataAtRaw()

char* dataAtRaw ( char *  pointer,
size_t  ix,
size_t  iy,
size_t  iz,
size_t  nx,
size_t  ny 
)
inline

dataAtRaw gets the data at the given indexes

Parameters
pointerthe pointer to the data
ixthe x index (in bytes)
iythe y index (in bytes)
izthe z index (in bytes)
nxthe number of elements in x direction (in bytes)
nythe number of elements in z direction (in bytes)
Returns
the pointer to the data element

◆ dataAtRawConst()

const char* dataAtRawConst ( const char *  pointer,
size_t  ix,
size_t  iy,
size_t  iz,
size_t  nx,
size_t  ny 
)
inline

dataAtRaw gets the data at the given indexes

This file contains various utility functions for indexing

Parameters
pointerthe pointer to the data
ixthe x index (in bytes)
iythe y index (in bytes)
izthe z index (in bytes)
nxthe number of elements in x direction (in bytes)
nythe number of elements in z direction (in bytes)
Returns
the pointer to the data element