33#ifndef __H__UG__COMMON__MATH_TENSOR_FUNCTIONS__
34#define __H__UG__COMMON__MATH_TENSOR_FUNCTIONS__
47template <std::
size_t TDim, std::
size_t TDimSQ>
49Tens2ToVec(DenseVector<FixedArray1<number, TDimSQ> > &vec,
const MathMatrix<TDim, TDim>& tens2);
52template <std::
size_t TDim, std::
size_t TDimSQ>
54VecToTens2(MathMatrix<TDim, TDim>& tens2,
const DenseVector<FixedArray1<number, TDimSQ> > &vec);
58template <std::
size_t TDim, std::
size_t TDimSQ>
60Tens4ToMat(DenseMatrix<FixedArray2<number, TDimSQ, TDimSQ> > &mat,
const MathTensor4<TDim, TDim, TDim, TDim>& tens4);
64template <std::
size_t TDim, std::
size_t TDimSQ>
66MatToTens4(MathTensor4<TDim, TDim, TDim, TDim>& tens4,
const DenseMatrixInverse<FixedArray2<number, TDimSQ, TDimSQ> > &mat);
72template <std::
size_t TDim>
74Tens4Add(MathTensor4<TDim, TDim, TDim, TDim>& tens4_out,
75 const MathTensor4<TDim, TDim, TDim, TDim>& tens4a,
76 const MathTensor4<TDim, TDim, TDim, TDim>& tens4b);
80template <std::
size_t TDim>
83 const MathTensor4<TDim, TDim, TDim, TDim>& tens4a,
84 const MathTensor4<TDim, TDim, TDim, TDim>& tens4b);
90template <std::
size_t TDim>
92TransTens4(MathTensor4<TDim, TDim, TDim, TDim>& tens4_out,
93 const MathTensor4<TDim, TDim, TDim, TDim>& tens4);
99template <std::
size_t TDim>
102 const MathTensor4<TDim, TDim, TDim, TDim>& tens4);
108template <std::
size_t TDim>
111 const MathTensor4<TDim, TDim, TDim, TDim>& A,
112 const MathMatrix<TDim, TDim>& rhs);
118template <std::
size_t TDim>
121 const MathTensor4<TDim, TDim, TDim, TDim>& tens4,
122 const MathMatrix<TDim, TDim>& tens2);
126template <std::
size_t TDim>
129 const MathTensor4<TDim, TDim, TDim, TDim>& tens4a,
130 const MathTensor4<TDim, TDim, TDim, TDim>& tens4b);
134template <std::
size_t TDim>
137 const MathTensor4<TDim, TDim, TDim, TDim>& tens4a,
138 const MathTensor4<TDim, TDim, TDim, TDim>& tens4b,
139 const MathTensor4<TDim, TDim, TDim, TDim>& tens4c);
143template <std::
size_t TDim>
145Tens4Zero(MathTensor4<TDim, TDim, TDim, TDim>& tensOut);
148template <std::
size_t TDim>
153template <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