Peano
Loading...
Searching...
No Matches
exahype2::VolumeIndex< N, Args > Struct Template Reference

A lot of the loop routines expect a voxel (or face) index which is a vector over integers. More...

#include <VolumeIndex.h>

Public Types

using VectorType = tarch::la::Vector<N, int>
 

Static Public Member Functions

static VectorType generate (Args... args)
 

Static Private Member Functions

template<int I, class... RestArgs>
static void fillVector (VectorType &vector, int arg, RestArgs... args)
 
template<int I>
static void fillVector (VectorType &)
 

Detailed Description

template<int N, typename... Args>
struct exahype2::VolumeIndex< N, Args >

A lot of the loop routines expect a voxel (or face) index which is a vector over integers.

Syntactically, I can just hand over

volumeIndex(x, y, z)

Peano's vector class then provides the right constructor to convert this into a vector object. However, this constructor has to rely on a while loop that iterates over the arguments. A while loop in return cannot vectorise or be inlined/unrolled. So I need this helper routine which is way less elegant, yet knows how often the underlying while loop is to be unrolled. The unrolling happens via template magic, i.e., the compiler takes care of that.

Definition at line 25 of file VolumeIndex.h.

Member Typedef Documentation

◆ VectorType

template<int N, typename... Args>
using exahype2::VolumeIndex< N, Args >::VectorType = tarch::la::Vector<N, int>

Definition at line 26 of file VolumeIndex.h.

Member Function Documentation

◆ fillVector() [1/2]

template<int N, typename... Args>
template<int I>
static void exahype2::VolumeIndex< N, Args >::fillVector ( VectorType & )
staticprivate

Definition at line 43 of file VolumeIndex.h.

◆ fillVector() [2/2]

template<int N, typename... Args>
template<int I, class... RestArgs>
static void exahype2::VolumeIndex< N, Args >::fillVector ( VectorType & vector,
int arg,
RestArgs... args )
staticprivate

Definition at line 36 of file VolumeIndex.h.

◆ generate()

template<int N, typename... Args>
static VectorType exahype2::VolumeIndex< N, Args >::generate ( Args... args)
static

Definition at line 28 of file VolumeIndex.h.

Referenced by peano4.Project.Project::build(), and exahype2::volumeIndex().

Here is the caller graph for this function:

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