Intrepid2
Classes | Macros | Functions
Intrepid2_Utils.hpp File Reference

Header function for Intrepid2::Util class and other utility functions. More...

#include "Intrepid2_ConfigDefs.hpp"
#include "Intrepid2_Types.hpp"
#include "Kokkos_Core.hpp"

Go to the source code of this file.

Classes

struct  Intrepid2::ScalarTraits< T >
 scalar type traits More...
 
struct  Intrepid2::ScalarTraits< float >
 Built in support for float. More...
 
struct  Intrepid2::ScalarTraits< double >
 Built in support for double. More...
 
struct  Intrepid2::ScalarTraits< int >
 Built in support for int. More...
 
struct  Intrepid2::ScalarTraits< long int >
 Built in support for long int. More...
 
struct  Intrepid2::ScalarTraits< long long >
 Built in support for long long. More...
 
struct  Intrepid2::ExecSpace< ViewSpaceType, UserSpaceType >
 space overload More...
 
struct  Intrepid2::ExecSpace< ViewSpaceType, void >
 space overload More...
 
struct  Intrepid2::DeduceLayout< ViewType >
 layout deduction (temporary meta-function) More...
 
class  Intrepid2::Util< T >
 small utility functions More...
 

Macros

#define INTREPID2_TEST_FOR_WARNING(test, msg)
 
#define INTREPID2_TEST_FOR_EXCEPTION(test, x, msg)
 
#define INTREPID2_TEST_FOR_ABORT(test, msg)
 
#define INTREPID2_TEST_FOR_DEBUG_ABORT(test, info, msg)
 

Functions

template<typename IdxType , typename DimType , typename IterType >
static
KOKKOS_FORCEINLINE_FUNCTION
void 
Intrepid2::unrollIndex (IdxType &i, IdxType &j, const DimType, const DimType dim1, const IterType iter)
 
template<typename IdxType , typename DimType , typename IterType >
static
KOKKOS_FORCEINLINE_FUNCTION
void 
Intrepid2::unrollIndex (IdxType &i, IdxType &j, IdxType &k, const DimType dim0, const DimType dim1, const DimType dim2, const IterType iter)
 
template<typename T >
static
KOKKOS_FORCEINLINE_FUNCTION T 
Intrepid2::min (const T &a, const T &b)
 
template<typename T >
static
KOKKOS_FORCEINLINE_FUNCTION T 
Intrepid2::max (const T &a, const T &b)
 
template<typename T >
static
KOKKOS_FORCEINLINE_FUNCTION T 
Intrepid2::abs (const T &a)
 
template<typename T >
KOKKOS_FORCEINLINE_FUNCTION
constexpr std::enable_if
< !std::is_pod< T >::value,
typename ScalarTraits< T >
::scalar_type >::type 
Intrepid2::get_scalar_value (const T &obj)
 functions returning the scalar value. for pod types, they return the input object itself. of other types it returns the member function val() of the type T. For Sacado Fad types it returns the scalar value.
 
template<typename T >
KOKKOS_FORCEINLINE_FUNCTION
constexpr std::enable_if
< std::is_pod< T >::value,
typename ScalarTraits< T >
::scalar_type >::type 
Intrepid2::get_scalar_value (const T &obj)
 
template<typename T , typename... P>
KOKKOS_INLINE_FUNCTION
constexpr std::enable_if
< std::is_pod< T >::value,
unsigned >::type 
Intrepid2::dimension_scalar (const Kokkos::DynRankView< T, P...>)
 specialization of functions for pod types, returning the scalar dimension (1 for pod types) of a view these functions are specialized in Sacado and they return the scalar dimension (i.e. the dimension of the type w.r.t. the type associated to the pointer type).
 
template<typename T , typename... P>
KOKKOS_INLINE_FUNCTION
constexpr std::enable_if
< std::is_pod< T >::value,
unsigned >::type 
Intrepid2::dimension_scalar (const Kokkos::View< T, P...> view)
 
template<typename T >
static
KOKKOS_FORCEINLINE_FUNCTION
ordinal_type 
Intrepid2::get_dimension_scalar (const T view)
 

Detailed Description

Header function for Intrepid2::Util class and other utility functions.

Author
Created by P. Bochev and D. Ridzal. Kokkorized by Kyungjoo Kim

Definition in file Intrepid2_Utils.hpp.

Macro Definition Documentation

#define INTREPID2_TEST_FOR_ABORT (   test,
  msg 
)
Value:
if (test) { \
printf("[Intrepid2] Error in file %s, line %d\n",__FILE__,__LINE__); \
printf(" Test that evaluated to true: %s\n", #test); \
printf(" %s \n", msg); \
Kokkos::abort( "[Intrepid2] Abort\n"); \
}

Definition at line 83 of file Intrepid2_Utils.hpp.

#define INTREPID2_TEST_FOR_DEBUG_ABORT (   test,
  info,
  msg 
)
Value:
if (!(info) && (test)) { \
printf("[Intrepid2] Error in file %s, line %d\n",__FILE__,__LINE__); \
printf(" Test that evaluated to true: %s\n", #test); \
printf(" %s \n", msg); \
info = true ; \
Kokkos::abort( "[Intrepid2] Abort\n"); \
}

Definition at line 101 of file Intrepid2_Utils.hpp.

#define INTREPID2_TEST_FOR_EXCEPTION (   test,
  x,
  msg 
)
Value:
if (test) { \
printf("[Intrepid2] Error in file %s, line %d\n",__FILE__,__LINE__); \
printf(" Test that evaluated to true: %s\n", #test); \
printf(" %s \n", msg); \
throw x(msg); \
}

Definition at line 75 of file Intrepid2_Utils.hpp.

#define INTREPID2_TEST_FOR_WARNING (   test,
  msg 
)
Value:
if (test) { \
printf("[Intrepid2] Warning in file %s, line %d\n",__FILE__,__LINE__); \
printf(" Test that evaluated to true: %s\n", #test); \
printf(" %s \n", msg); \
}

Definition at line 68 of file Intrepid2_Utils.hpp.