30 static_assert(always_false<T>,
"Specialize SerialAccess for this type.");
34 #define SERIAL_ACCESS_SCALAR(type) \ 36 struct SerialAccess<type> \ 38 static type * data(type & obj) { return &obj; } \ 39 static constexpr std::size_t size(type &) { return 1u; } \ 40 static constexpr std::size_t size() { return 1u; } \ 49 #define SERIAL_ACCESS_CONST_SIZE(type, dataptr, sizeval) \ 50 template <typename T> \ 51 struct SerialAccess<type<T>> \ 53 static auto * data(type<T> & obj) { return dataptr; } \ 54 static constexpr std::size_t size(type<T> &) { return sizeval; } \ 55 static constexpr std::size_t size() { return sizeval; } \ 68 #define SERIAL_ACCESS_DYNAMIC_SIZE(type, dataptr, sizeval) \ 69 template <typename T> \ 70 struct SerialAccess<type<T>> \ 72 static auto * data(type<T> & obj) { return dataptr; } \ 73 static constexpr std::size_t size(type<T> & obj) { return sizeval; } \ 105 typedef typename std::conditional<std::is_const_v<T>,
const R,
R>::type
V;
149 template <
typename T>
157 template <
typename... Ts>
162 static constexpr std::size_t
size =
sizeof...(Ts);
166 template <
template <
typename,
int>
class L,
int I,
typename T,
typename... Ts,
typename... As>
170 L<T, I>::apply(args...);
171 if constexpr (
sizeof...(Ts) > 0)
172 typeLoopInternal<L, I + 1>(
TypeList<Ts...>{}, args...);
176 template <
template <
typename,
int>
class L,
typename... Ts,
typename... As>
180 typeLoopInternal<L, 0>(
TypeList<Ts...>{}, args...);
RankFourTensorTempl is designed to handle any N-dimensional fourth order tensor, C.
SERIAL_ACCESS_CONST_SIZE(libMesh::VectorValue, &obj(0u), Moose::dim)
void typeLoopInternal(TypeList< T, Ts... >, As... args)
Type loop.
std::conditional< std::is_const_v< T >, const R, R >::type V
Value type with the correct constness.
const iterator & operator++()
static constexpr std::size_t size
bool operator!=(const iterator &j) const
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
void typeLoop(TypeList< Ts... >, As... args)
Type loop.
Value type helper (necessary for any type that does not have a value_type member or where value_type ...
std::tuple< Ts *... > PointerTuple
bool operator==(const iterator &j) const
DualNumber< Real, DNDerivativeType, true > ADReal
std::tuple< Ts... > Tuple
SERIAL_ACCESS_SCALAR(Real)
SerialAccessValueTypeHelper< typename std::remove_const< T >::type >::value_type R
Value type of the components of T.
Serial access requires object data to be stored contiguously.
SerialAccessRange< T > serialAccess(T &obj)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
RankTwoTensorTempl is designed to handle the Stress or Strain Tensor for a fully anisotropic material...
SERIAL_ACCESS_DYNAMIC_SIZE(DenseVector, &obj(0u), obj.size())
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
SerialAccessRange(T &obj)
Helper structure to hold a list of types.