DUNE-ACFEM (unstable)
Modules | |
TensorComparison | |
TensorMathOperations | |
TensorExpressionOptimizations | |
Functions | |
template<class F , class T0 , class T1 , std::enable_if_t< AreProperTensors< T0, T1 >::value &&!FunctorHas< IsTensorOperation, F >::value, int > = 0> | |
constexpr auto | Dune::ACFem::Tensor::operate (Expressions::DontOptimize, F &&f, T0 &&t0, T1 &&t1) |
Generate a binary tensor expression. | |
template<class F , class T , std::enable_if_t< IsTensor< T >::value, int > = 0> | |
auto | Dune::ACFem::Tensor::zero (F &&, T &&) |
Generate the canonical zero for tensors, given operation. | |
template<class T , std::enable_if_t< Tensor::IsTensor< T >::value, int > = 0> | |
auto | Dune::ACFem::Tensor::one (T &&) |
Generate the canonical scalar one for tensors. | |
template<std::size_t N, class T1 , class T2 , std::enable_if_t< AreProperTensors< T1, T2 >::value, int > = 0> | |
constexpr auto | Dune::ACFem::Tensor::contractInner (T1 &&t1, T2 &&t2, IndexConstant< N >=IndexConstant< N >{}) |
Contraction over the #N inner dimensions. More... | |
template<class T1 , class T2 , std::enable_if_t< AreProperTensors< T1, T2 >::value, int > = 0> | |
auto | Dune::ACFem::Tensor::contractInner (T1 &&t1, T2 &&t2) |
Inner product w.r.t. More... | |
template<class T1 , class T2 , std::enable_if_t< AreProperTensors< T1, T2 >::value, int > = 0> | |
auto | Dune::ACFem::Tensor::outer (T1 &&t1, T2 &&t2) |
Outer tensor product. | |
template<class T , std::enable_if_t< IsProperTensor< T >::value, int > = 0> | |
constexpr auto | Dune::ACFem::Tensor::trace (T &&t) |
Trace is the contraction over all indices with the eye tensor. | |
template<class T1 , class T2 , std::enable_if_t< AreProperTensors< T1, T2 >::value, int > = 0> | |
auto | Dune::ACFem::Tensor::inner (T1 &&t1, T2 &&t2) |
"scalar product" | |
template<class Arg , std::enable_if_t< IsProperTensor< Arg >::value, int > = 0> | |
constexpr auto | Dune::ACFem::Tensor::frobenius2 (Arg &&arg) |
Square of Frobenius norm. | |
template<class T1 , class T2 , std::enable_if_t<(AreProperTensors< T1, T2 >::value &&TensorTraits< T1 >::rank > 0 &&TensorTraits< T2 >::rank > 0 &&TensorTraits< T1 >::template dim< TensorTraits< T1 >::rank - 1 >()==TensorTraits< T2 >::template dim< 0 >()), int > = 0> | |
auto | Dune::ACFem::Tensor::operator* (T1 &&t1, T2 &&t2) |
Multiplication of non-trivial tensors is Einstein-summation over the inner (right-most of the left and the left-most of the right) index if the dimension matches. More... | |
template<class T1 , class T2 , std::enable_if_t< AreProperTensors< T1, T2 >::value, int > = 0> | |
auto | Dune::ACFem::Tensor::operator& (T1 &&t1, T2 &&t2) |
Greedy contraction over all leading matching dimensions. | |
template<class T1 , class T2 , std::enable_if_t<(AreProperTensors< T1, T2 >::value &&TensorTraits< T2 >::rank==0), int > = 0> | |
auto | Dune::ACFem::Tensor::operator/ (T1 &&t1, T2 &&t2) |
Division is multiplication with inverse. | |
template<class T1 , class T2 , std::enable_if_t<(IsTensorOperand< T1 >::value &&IsTensorOperand< T2 >::value &&(IsTensor< T1 >::value||IsTensor< T2 >::value)), int > = 0> | |
T1 & | Dune::ACFem::Tensor::operator+= (T1 &t1, T2 &&t2) |
operator+=() with generic tensors. | |
template<class T1 , class T2 , std::enable_if_t<(IsTensorOperand< T1 >::value &&IsTensorOperand< T2 >::value &&(IsTensor< T1 >::value||IsTensor< T2 >::value)), int > = 0> | |
T1 & | Dune::ACFem::Tensor::operator-= (T1 &t1, T2 &&t2) |
operator-=() with generic tensors. | |
template<class T1 , class T2 , std::enable_if_t<(IsTensorOperand< T1 >::value &&IsTensorOperand< T2 >::value &&(IsTensor< T1 >::value||IsTensor< T2 >::value) &&TensorTraits< T2 >::rank==0), int > = 0> | |
T1 & | Dune::ACFem::Tensor::operator*= (T1 &t1, T2 &&t2) |
operator*=() with rank-0 tensors. | |
template<class F , class T , std::enable_if_t< IsProperTensor< T >::value &&!FunctorHas< IsTensorOperation, F >::value, int > = 0> | |
constexpr auto | Dune::ACFem::Tensor::operate (Expressions::DontOptimize, F &&f, T &&t) |
Generate a unary tensor expression. More... | |
Detailed Description
Function Documentation
◆ contractInner() [1/2]
auto Dune::ACFem::Tensor::contractInner | ( | T1 && | t1, |
T2 && | t2 | ||
) |
Inner product w.r.t.
to just the innermost index position.
◆ contractInner() [2/2]
|
constexpr |
Contraction over the #N inner dimensions.
Special cases:
- if N == 1 and T1 is a matrix and T2 a vector, then this is matrix-vector multiplication.
- if T1 and T2 are matrices, this will yield for N == 1 a matrix-matrix product
An attempt to call contractInner() with mis-matching dimensions is a compile-time error.
- Note
- Internally, this simply forwards to einsum().
Referenced by Dune::ACFem::EllipticEstimator< DiscreteFunctionSpace, Model, Norm >::estimateBoundary(), Dune::ACFem::ParabolicEulerEstimator< OldSolutionFunction, TimeProvider, ImplicitModel, ExplicitModel, Norm >::estimateBoundary(), Dune::ACFem::EllipticEstimator< DiscreteFunctionSpace, Model, Norm >::estimateIntersection(), Dune::ACFem::ParabolicEulerEstimator< OldSolutionFunction, TimeProvider, ImplicitModel, ExplicitModel, Norm >::estimateIntersection(), Dune::ACFem::ParabolicEulerEstimator< OldSolutionFunction, TimeProvider, ImplicitModel, ExplicitModel, Norm >::estimateProcessBoundary(), and Dune::ACFem::EllipticEstimator< DiscreteFunctionSpace, Model, Norm >::estimateProcessorBoundary().
◆ operate()
|
constexpr |
Generate a unary tensor expression.
- Parameters
-
t The operand. f The operation functor.
◆ operator*()
auto Dune::ACFem::Tensor::operator* | ( | T1 && | t1, |
T2 && | t2 | ||
) |
Multiplication of non-trivial tensors is Einstein-summation over the inner (right-most of the left and the left-most of the right) index if the dimension matches.
Multiplication of resp.
with scalars.