15#ifndef dealii_tensor_accessors_h
16#define dealii_tensor_accessors_h
73 template <
int index,
int rank,
typename T>
75 template <
int position,
int rank>
77 template <
int no_contr,
int rank_1,
int rank_2,
int dim>
79 template <
int rank_1,
int rank_2,
int dim>
100 template <
typename T>
106 template <
typename T>
112 template <
typename T, std::
size_t N>
118 template <
typename T, std::
size_t N>
132 template <
int deref_steps,
typename T>
140 template <
typename T>
184 template <
int index,
int rank,
typename T>
188 static_assert(0 <= index && index < rank,
189 "The specified index must lie within the range [0,rank)");
216 template <
int rank,
typename T,
typename ArrayType>
263 template <
int no_contr,
271 contract(T1 &result,
const T2 &left,
const T3 &right)
273 static_assert(rank_1 >= no_contr,
274 "The rank of the left tensor must be "
275 "equal or greater than the number of "
277 static_assert(rank_2 >= no_contr,
278 "The rank of the right tensor must be "
279 "equal or greater than the number of "
283 template contract<T1, T2, T3>(result, left, right);
315 template <
int rank_1,
323 contract3(
const T2 &left,
const T3 &middle,
const T4 &right)
326 template contract3<T1, T2, T3, T4>(left, middle, right);
336 template <
int rank,
typename S>
338 template <
typename T>
340 template <
int no_contr,
int dim>
352 template <
typename T>
358 template <
int rank,
typename S>
364 template <
int index,
int rank,
typename T>
399 template <
int index,
int rank,
typename T>
433 template <
int rank,
typename T>
456 template <
typename T>
482 template <
typename T>
510 template <
int rank,
typename S>
533 return s_.apply(j)[
i_];
545 template <
typename S>
561 return s_.apply(j)[
i_];
577 template <
int position,
int rank>
580 template <
typename T,
typename ArrayType>
581 constexpr static typename ReturnType<rank - position, T>::value_type &
586 ArrayType>(t[indices[position]], indices);
595 template <
typename T,
typename ArrayType>
619 template <
int no_contr,
int rank_1,
int rank_2,
int dim>
623 template <
typename T1,
typename T2,
typename T3>
625 contract(T1 &result,
const T2 &left,
const T3 &right)
627 for (
unsigned int i = 0; i < dim; ++i)
649 template <
int no_contr,
int rank_2,
int dim>
653 template <
typename T1,
typename T2,
typename T3>
655 contract(T1 &result,
const T2 &left,
const T3 &right)
657 for (
unsigned int i = 0; i < dim; ++i)
679 template <
int no_contr,
int dim>
683 template <
typename T1,
typename T2,
typename T3>
685 contract(T1 &result,
const T2 &left,
const T3 &right)
695 template <
int no_contr,
int dim>
699 template <
typename T1,
typename T2,
typename T3>
713 Contract2<no_contr - 1, dim>::template contract2<T1>(left[0],
715 for (
unsigned int i = 1; i < dim; ++i)
731 template <
typename T1,
typename T2,
typename T3>
754 template <
int rank_1,
int rank_2,
int dim>
758 template <
typename T1,
typename T2,
typename T3,
typename T4>
759 constexpr static inline T1
760 contract3(
const T2 &left,
const T3 &middle,
const T4 &right)
765 for (
unsigned int i = 0; i < dim; ++i)
767 left[i], middle[i], right);
784 template <
int rank_2,
int dim>
788 template <
typename T1,
typename T2,
typename T3,
typename T4>
789 constexpr static inline T1
790 contract3(
const T2 &left,
const T3 &middle,
const T4 &right)
795 for (
unsigned int i = 0; i < dim; ++i)
811 template <
typename T1,
typename T2,
typename T3,
typename T4>
813 contract3(
const T2 &left,
const T3 &middle,
const T4 &right)
815 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)