16#ifndef dealii_tensor_accessors_h
17#define dealii_tensor_accessors_h
75 template <
int index,
int rank,
typename T>
77 template <
int position,
int rank>
79 template <
int no_contr,
int rank_1,
int rank_2,
int dim>
81 template <
int rank_1,
int rank_2,
int dim>
102 template <
typename T>
108 template <
typename T>
114 template <
typename T, std::
size_t N>
120 template <
typename T, std::
size_t N>
134 template <
int deref_steps,
typename T>
142 template <
typename T>
186 template <
int index,
int rank,
typename T>
190 static_assert(0 <= index && index < rank,
191 "The specified index must lie within the range [0,rank)");
218 template <
int rank,
typename T,
typename ArrayType>
265 template <
int no_contr,
273 contract(T1 &result,
const T2 &left,
const T3 &right)
275 static_assert(rank_1 >= no_contr,
276 "The rank of the left tensor must be "
277 "equal or greater than the number of "
279 static_assert(rank_2 >= no_contr,
280 "The rank of the right tensor must be "
281 "equal or greater than the number of "
285 template contract<T1, T2, T3>(result, left, right);
317 template <
int rank_1,
325 contract3(
const T2 &left,
const T3 &middle,
const T4 &right)
328 template contract3<T1, T2, T3, T4>(left, middle, right);
338 template <
int rank,
typename S>
340 template <
typename T>
342 template <
int no_contr,
int dim>
354 template <
typename T>
360 template <
int rank,
typename S>
366 template <
int index,
int rank,
typename T>
401 template <
int index,
int rank,
typename T>
435 template <
int rank,
typename T>
458 template <
typename T>
484 template <
typename T>
512 template <
int rank,
typename S>
535 return s_.apply(j)[
i_];
547 template <
typename S>
563 return s_.apply(j)[
i_];
579 template <
int position,
int rank>
582 template <
typename T,
typename ArrayType>
583 constexpr static typename ReturnType<rank - position,
T>::value_type &
588 ArrayType>(t[indices[position]], indices);
597 template <
typename T,
typename ArrayType>
621 template <
int no_contr,
int rank_1,
int rank_2,
int dim>
625 template <
typename T1,
typename T2,
typename T3>
627 contract(T1 &result,
const T2 &left,
const T3 &right)
629 for (
unsigned int i = 0; i < dim; ++i)
651 template <
int no_contr,
int rank_2,
int dim>
655 template <
typename T1,
typename T2,
typename T3>
657 contract(T1 &result,
const T2 &left,
const T3 &right)
659 for (
unsigned int i = 0; i < dim; ++i)
681 template <
int no_contr,
int dim>
685 template <
typename T1,
typename T2,
typename T3>
687 contract(T1 &result,
const T2 &left,
const T3 &right)
697 template <
int no_contr,
int dim>
701 template <
typename T1,
typename T2,
typename T3>
715 Contract2<no_contr - 1, dim>::template contract2<T1>(left[0],
717 for (
unsigned int i = 1; i < dim; ++i)
733 template <
typename T1,
typename T2,
typename T3>
756 template <
int rank_1,
int rank_2,
int dim>
760 template <
typename T1,
typename T2,
typename T3,
typename T4>
761 constexpr static inline T1
762 contract3(
const T2 &left,
const T3 &middle,
const T4 &right)
767 for (
unsigned int i = 0; i < dim; ++i)
769 left[i], middle[i], right);
786 template <
int rank_2,
int dim>
790 template <
typename T1,
typename T2,
typename T3,
typename T4>
791 constexpr static inline T1
792 contract3(
const T2 &left,
const T3 &middle,
const T4 &right)
797 for (
unsigned int i = 0; i < dim; ++i)
813 template <
typename T1,
typename T2,
typename T3,
typename T4>
815 contract3(
const T2 &left,
const T3 &middle,
const T4 &right)
817 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 const T & value(const T &t)