diff --git a/dune/microstructure/matrix_operations.hh b/dune/microstructure/matrix_operations.hh index 4e0a89c0b6f3c2da574959166fae226c5d727b5d..e99a6112b9dc22746703dbf6a3aae01e7ccc3fb5 100644 --- a/dune/microstructure/matrix_operations.hh +++ b/dune/microstructure/matrix_operations.hh @@ -8,6 +8,7 @@ namespace MatrixOperations { using std::sin; using std::cos; + static MatrixRT sym (MatrixRT M) { // 1/2 (M^T + M) @@ -25,7 +26,6 @@ namespace MatrixOperations { } - static VectorRT crossProduct (VectorRT v, VectorRT w) { // v otimes w return {v[1]*w[2] - v[2]*w[1], -1*(v[0]*w[2] - v[2]*w[0]), v[0]*w[1] - v[1]*w[0]}; } @@ -207,6 +207,29 @@ namespace MatrixOperations { } + /** + * @brief This is used to convert FieldMatrices to 'adouble' + * since adouble-type can not be read from ParSet. + * is there a better way? + * + * @tparam Rtype + * @tparam IMatrixType + * @param A + * @param B + */ + template<class Rtype> + static void convertFieldMatrix(auto& A, + auto& B) + { + for(size_t i=0; i<B.N(); i++) + for(size_t j=0; j<B.M(); j++) + B[i][j] = (Rtype)A[i][j]; + + return; + } + + + } #endif