waves
Basic FE playground
EnsembleTraits.h
Go to the documentation of this file.
1 #ifndef KATOPTRON_ENSEMBLETRAITS_H
2 #define KATOPTRON_ENSEMBLETRAITS_H
3 
4 #include "Sacado.hpp"
5 #include "Stokhos_Tpetra_Utilities_MP_Vector.hpp"
6 
7 template <typename T>
9 {
10  static const int size = 1;
11  typedef T value_type;
12  static const value_type &coeff(const T &x, int i) { return x; }
13  static value_type &coeff(T &x, int i) { return x; }
14 };
15 
16 template <typename S>
17 struct EnsembleTraits<Sacado::MP::Vector<S>>
18 {
19  static const int size = S::static_size;
20  typedef typename S::value_type value_type;
21  static const value_type &coeff(const Sacado::MP::Vector<S> &x, int i)
22  {
23  return x.fastAccessCoeff(i);
24  }
25  static value_type &coeff(Sacado::MP::Vector<S> &x, int i)
26  {
27  return x.fastAccessCoeff(i);
28  }
29 };
30 #endif // KATOPTRON_ENSEMBLETRAITS_H
EnsembleTraits::coeff
static value_type & coeff(T &x, int i)
Definition: EnsembleTraits.h:13
EnsembleTraits
Definition: EnsembleTraits.h:8
EnsembleTraits< Sacado::MP::Vector< S > >::coeff
static value_type & coeff(Sacado::MP::Vector< S > &x, int i)
Definition: EnsembleTraits.h:25
EnsembleTraits::value_type
T value_type
Definition: EnsembleTraits.h:11
EnsembleTraits< Sacado::MP::Vector< S > >::coeff
static const value_type & coeff(const Sacado::MP::Vector< S > &x, int i)
Definition: EnsembleTraits.h:21
EnsembleTraits< Sacado::MP::Vector< S > >::value_type
S::value_type value_type
Definition: EnsembleTraits.h:20
EnsembleTraits::size
static const int size
Definition: EnsembleTraits.h:10
EnsembleTraits::coeff
static const value_type & coeff(const T &x, int i)
Definition: EnsembleTraits.h:12