12#ifndef COMMON_TYPEDEF_H
13#define COMMON_TYPEDEF_H
19#include <Kokkos_Macros.hpp>
24#if Mallard_DIM != 2 && Mallard_DIM != 3
25#error "Mallard_DIM must be 2 or 3"
28#define N_DIM Mallard_DIM
29#define N_CONSERVATIVE (N_DIM + 2)
30#define N_PRIMITIVE (N_DIM + 3)
32#define FOR_I_DIM for (uint8_t i = 0; i < N_DIM; i++)
33#define FOR_I_CONSERVATIVE for (uint8_t i = 0; i < N_CONSERVATIVE; i++)
34#define FOR_I_PRIMITIVE for (uint8_t i = 0; i < N_PRIMITIVE; i++)
36#ifdef Mallard_USE_DOUBLE
52template <
typename T = rtype>
54#ifdef Mallard_USE_DOUBLE
KOKKOS_INLINE_FUNCTION rtype dot(const rtype *a, const rtype *b)
Compute the dot product of two arrays.
Definition common_math.h:32
std::array< rtype, N_DIM > NVector
Definition common_typedef.h:61
const std::array< std::string, N_PRIMITIVE > PRIMITIVE_NAMES
Definition common_typedef.h:72
float rtype
Definition common_typedef.h:39
const std::array< std::string, N_CONSERVATIVE > CONSERVATIVE_NAMES
Definition common_typedef.h:65
#define N_DIM
Definition common_typedef.h:28
KOKKOS_INLINE_FUNCTION constexpr T precision_tol(double double_tol, double single_tol)
A tolerance that depends on rtype's precision: double_tol in double builds, single_tol in single....
Definition common_typedef.h:53
std::array< std::array< rtype, N_DIM >, N_DIM > NMatrix
Definition common_typedef.h:62