16#ifndef dealii_tensor_accessors_h
17#define dealii_tensor_accessors_h
74 template <
int index,
int rank,
typename T>
76 template <
int position,
int rank>
78 template <
int no_contr,
int rank_1,
int rank_2,
int dim>
80 template <
int rank_1,
int rank_2,
int dim>
101 template <
typename T>
107 template <
typename T>
113 template <
typename T, std::
size_t N>
119 template <
typename T, std::
size_t N>
133 template <
int deref_steps,
typename T>
141 template <
typename T>
185 template <
int index,
int rank,
typename T>
189 static_assert(0 <= index && index < rank,
190 "The specified index must lie within the range [0,rank)");
217 template <
int rank,
typename T,
typename ArrayType>
264 template <
int no_contr,
272 contract(T1 &result,
const T2 &left,
const T3 &right)
274 static_assert(rank_1 >= no_contr,
275 "The rank of the left tensor must be "
276 "equal or greater than the number of "
278 static_assert(rank_2 >= no_contr,
279 "The rank of the right tensor must be "
280 "equal or greater than the number of "
284 template contract<T1, T2, T3>(result, left, right);
316 template <
int rank_1,
324 contract3(
const T2 &left,
const T3 &middle,
const T4 &right)
327 template contract3<T1, T2, T3, T4>(left, middle, right);
337 template <
int rank,
typename S>
339 template <
typename T>
341 template <
int no_contr,
int dim>
353 template <
typename T>
359 template <
int rank,
typename S>
365 template <
int index,
int rank,
typename T>
400 template <
int index,
int rank,
typename T>
434 template <
int rank,
typename T>
457 template <
typename T>
483 template <
typename T>
511 template <
int rank,
typename S>
534 return s_.apply(j)[
i_];
546 template <
typename S>
562 return s_.apply(j)[
i_];
578 template <
int position,
int rank>
581 template <
typename T,
typename ArrayType>
582 constexpr static typename ReturnType<rank - position, T>::value_type &
587 ArrayType>(t[indices[position]], indices);
596 template <
typename T,
typename ArrayType>
620 template <
int no_contr,
int rank_1,
int rank_2,
int dim>
624 template <
typename T1,
typename T2,
typename T3>
626 contract(T1 &result,
const T2 &left,
const T3 &right)
628 for (
unsigned int i = 0; i < dim; ++i)
650 template <
int no_contr,
int rank_2,
int dim>
654 template <
typename T1,
typename T2,
typename T3>
656 contract(T1 &result,
const T2 &left,
const T3 &right)
658 for (
unsigned int i = 0; i < dim; ++i)
680 template <
int no_contr,
int dim>
684 template <
typename T1,
typename T2,
typename T3>
686 contract(T1 &result,
const T2 &left,
const T3 &right)
696 template <
int no_contr,
int dim>
700 template <
typename T1,
typename T2,
typename T3>
714 Contract2<no_contr - 1, dim>::template contract2<T1>(left[0],
716 for (
unsigned int i = 1; i < dim; ++i)
732 template <
typename T1,
typename T2,
typename T3>
755 template <
int rank_1,
int rank_2,
int dim>
759 template <
typename T1,
typename T2,
typename T3,
typename T4>
760 constexpr static inline T1
761 contract3(
const T2 &left,
const T3 &middle,
const T4 &right)
766 for (
unsigned int i = 0; i < dim; ++i)
768 left[i], middle[i], right);
785 template <
int rank_2,
int dim>
789 template <
typename T1,
typename T2,
typename T3,
typename T4>
790 constexpr static inline T1
791 contract3(
const T2 &left,
const T3 &middle,
const T4 &right)
796 for (
unsigned int i = 0; i < dim; ++i)
812 template <
typename T1,
typename T2,
typename T3,
typename T4>
814 contract3(
const T2 &left,
const T3 &middle,
const T4 &right)
816 return left * middle * right;
static constexpr T1 contract2(const T2 &left, const T3 &right)
static constexpr T1 contract2(const T2 &left, const T3 &right)
static constexpr T1 contract3(const T2 &left, const T3 &middle, const T4 &right)
static constexpr T1 contract3(const T2 &left, const T3 &middle, const T4 &right)
static constexpr T1 contract3(const T2 &left, const T3 &middle, const T4 &right)
static constexpr void contract(T1 &result, const T2 &left, const T3 &right)
static constexpr void contract(T1 &result, const T2 &left, const T3 &right)
static constexpr void contract(T1 &result, const T2 &left, const T3 &right)
constexpr ReferenceType< return_type >::type apply(unsigned int j) const
constexpr Identity(typename ReferenceType< T >::type t)
typename ValueType< T >::value_type return_type
ReferenceType< T >::type t_
ReferenceType< T >::type t_
typename ReferenceType< typename ValueType< T >::value_type >::type value_type
constexpr value_type operator[](unsigned int j) const
constexpr ReorderedIndexView(typename ReferenceType< T >::type t)
constexpr value_type operator[](unsigned int j) const
ReferenceType< T >::type t_
constexpr ReorderedIndexView(typename ReferenceType< T >::type t)
ReorderedIndexView< index - 1, rank - 1, typename ValueType< T >::value_type > value_type
ReferenceType< T >::type t_
constexpr value_type operator[](unsigned int j) const
constexpr ReorderedIndexView(typename ReferenceType< T >::type t)
constexpr StoreIndex(S s, int i)
constexpr return_type & operator[](unsigned int j) const
typename ValueType< typename S::return_type >::value_type return_type
typename ValueType< typename S::return_type >::value_type return_type
constexpr StoreIndex(S s, int i)
constexpr value_type operator[](unsigned int j) const
StoreIndex< rank - 1, StoreIndex< rank, S > > value_type
constexpr ReferenceType< return_type >::type apply(unsigned int j) const
#define DEAL_II_ALWAYS_INLINE
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
constexpr ReturnType< rank, T >::value_type & extract(T &t, const ArrayType &indices)
constexpr internal::ReorderedIndexView< index, rank, T > reordered_index_view(T &t)
constexpr void contract(T1 &result, const T2 &left, const T3 &right)
constexpr T1 contract3(const T2 &left, const T3 &middle, const T4 &right)
typename ReturnType< deref_steps - 1, typename ValueType< T >::value_type >::value_type value_type
const typename T::value_type value_type
typename T::value_type value_type
static constexpr DEAL_II_HOST_DEVICE_ALWAYS_INLINE const T & value(const T &t)