33 #ifndef __H__UG__COMMON__MATH_TENSOR_FUNCTIONS__
34 #define __H__UG__COMMON__MATH_TENSOR_FUNCTIONS__
47 template <std::
size_t TDim, std::
size_t TDimSQ>
49 Tens2ToVec(DenseVector<FixedArray1<number, TDimSQ> > &vec,
const MathMatrix<TDim, TDim>& tens2);
52 template <std::
size_t TDim, std::
size_t TDimSQ>
54 VecToTens2(MathMatrix<TDim, TDim>& tens2,
const DenseVector<FixedArray1<number, TDimSQ> > &vec);
58 template <std::
size_t TDim, std::
size_t TDimSQ>
60 Tens4ToMat(DenseMatrix<FixedArray2<number, TDimSQ, TDimSQ> > &mat,
const MathTensor4<TDim, TDim, TDim, TDim>& tens4);
64 template <std::
size_t TDim, std::
size_t TDimSQ>
66 MatToTens4(MathTensor4<TDim, TDim, TDim, TDim>& tens4,
const DenseMatrixInverse<FixedArray2<number, TDimSQ, TDimSQ> > &mat);
72 template <std::
size_t TDim>
74 Tens4Add(MathTensor4<TDim, TDim, TDim, TDim>& tens4_out,
75 const MathTensor4<TDim, TDim, TDim, TDim>& tens4a,
76 const MathTensor4<TDim, TDim, TDim, TDim>& tens4b);
80 template <std::
size_t TDim>
83 const MathTensor4<TDim, TDim, TDim, TDim>& tens4a,
84 const MathTensor4<TDim, TDim, TDim, TDim>& tens4b);
90 template <std::
size_t TDim>
92 TransTens4(MathTensor4<TDim, TDim, TDim, TDim>& tens4_out,
93 const MathTensor4<TDim, TDim, TDim, TDim>& tens4);
99 template <std::
size_t TDim>
101 InvertTensor4(MathTensor4<TDim, TDim, TDim, TDim>& tens4_out,
102 const MathTensor4<TDim, TDim, TDim, TDim>& tens4);
108 template <std::
size_t TDim>
111 const MathTensor4<TDim, TDim, TDim, TDim>& A,
112 const MathMatrix<TDim, TDim>& rhs);
118 template <std::
size_t TDim>
121 const MathTensor4<TDim, TDim, TDim, TDim>& tens4,
122 const MathMatrix<TDim, TDim>& tens2);
126 template <std::
size_t TDim>
128 Tens4Contract(MathTensor4<TDim, TDim, TDim, TDim>& tens4_out,
129 const MathTensor4<TDim, TDim, TDim, TDim>& tens4a,
130 const MathTensor4<TDim, TDim, TDim, TDim>& tens4b);
134 template <std::
size_t TDim>
136 Tens4Contract(MathTensor4<TDim, TDim, TDim, TDim>& tens4_out,
137 const MathTensor4<TDim, TDim, TDim, TDim>& tens4a,
138 const MathTensor4<TDim, TDim, TDim, TDim>& tens4b,
139 const MathTensor4<TDim, TDim, TDim, TDim>& tens4c);
143 template <std::
size_t TDim>
145 Tens4Zero(MathTensor4<TDim, TDim, TDim, TDim>& tensOut);
148 template <std::
size_t TDim>
153 template <std::
size_t TDim>
void MatToTens4(MathTensor4< TDim, TDim, TDim, TDim > &tens4, const DenseMatrixInverse< FixedArray2< number, TDimSQ, TDimSQ > > &mat)
Definition: math_tensor_functions_common_impl.hpp:109
void Tens4Contract(MathMatrix< TDim, TDim > &tens2_out, const MathTensor4< TDim, TDim, TDim, TDim > &tens4, const MathMatrix< TDim, TDim > &tens2)
Definition: math_tensor_functions_common_impl.hpp:278
void VecToTens2(MathMatrix< TDim, TDim > &tens2, const DenseVector< FixedArray1< number, TDimSQ > > &vec)
transformation of a vector (R^(dim^2)) into a tensor of rank 2 (R^dim x R^dim)
Definition: math_tensor_functions_common_impl.hpp:70
void Tens4Zero(MathTensor4< TDim, TDim, TDim, TDim > &tensOut)
Definition: math_tensor_functions_common_impl.hpp:364
void Tens4Identity(MathTensor4< TDim, TDim, TDim, TDim > &Ident)
this function computes the 4th order identity tensor
Definition: math_tensor_functions_common_impl.hpp:379
void TransTens4(MathTensor4< TDim, TDim, TDim, TDim > &tens4_out, const MathTensor4< TDim, TDim, TDim, TDim > &tens4)
Definition: math_tensor_functions_common_impl.hpp:183
void InvertTensor4(MathTensor4< TDim, TDim, TDim, TDim > &tens4_out, const MathTensor4< TDim, TDim, TDim, TDim > &tens4)
Definition: math_tensor_functions_common_impl.hpp:205
void SolveTensorMatrixEquation(MathMatrix< TDim, TDim > &X, const MathTensor4< TDim, TDim, TDim, TDim > &A, const MathMatrix< TDim, TDim > &rhs)
Definition: math_tensor_functions_common_impl.hpp:243
void Tens4Add(MathTensor4< TDim, TDim, TDim, TDim > &tens4_out, const MathTensor4< TDim, TDim, TDim, TDim > &tens4a, const MathTensor4< TDim, TDim, TDim, TDim > &tens4b)
Definition: math_tensor_functions_common_impl.hpp:134
void Tens4IdentitySym(MathTensor4< TDim, TDim, TDim, TDim > &Ident)
this function computes the symmetric 4th order identity tensor
Definition: math_tensor_functions_common_impl.hpp:396
void Tens4Subtract(MathTensor4< TDim, TDim, TDim, TDim > &tens4_out, const MathTensor4< TDim, TDim, TDim, TDim > &tens4a, const MathTensor4< TDim, TDim, TDim, TDim > &tens4b)
Definition: math_tensor_functions_common_impl.hpp:158
void Tens4ToMat(DenseMatrix< FixedArray2< number, TDimSQ, TDimSQ > > &mat, const MathTensor4< TDim, TDim, TDim, TDim > &tens4)
Definition: math_tensor_functions_common_impl.hpp:88
void Tens2ToVec(DenseVector< FixedArray1< number, TDimSQ > > &vec, const MathMatrix< TDim, TDim > &tens2)
transformation of a tensor of rank 2 (R^dim x R^dim) into a vector (R^(dim^2))
Definition: math_tensor_functions_common_impl.hpp:53