13#include <dune/common/diagonalmatrix.hh>
14#include <dune/common/fmatrix.hh>
15#include <dune/common/fvector.hh>
16#include <dune/istl/scaledidmatrix.hh>
29 template <
typename ScalarType,
int size>
32 for (
int i = 0; i < size; ++i)
33 fieldVector[i] = vec[i];
46 template <
typename ScalarType,
int rows>
48 assert(vec.cols() == 1 &&
"The passed matrix needs to have a single column.");
51 for (
int i = 0; i < vec.rows(); ++i)
52 fieldVector[i] = vec(i, 0);
65 template <
typename ScalarType,
int rows,
int cols>
66 Dune::FieldMatrix<ScalarType, rows, cols>
toDune(
const Eigen::Matrix<ScalarType, rows, cols>& mat) {
67 Dune::FieldMatrix<ScalarType, rows, cols> fieldMatrix{0.0};
69 for (
int i = 0; i < mat.rows(); ++i)
70 for (
int j = 0; j < mat.cols(); ++j)
71 fieldMatrix[i][j] = mat(i, j);
82 template <
typename ScalarType,
int size>
84 return {vec.data(), size};
94 template <
typename ScalarType,
int size>
96 return {vec.data(), size};
Definition: simpleassemblers.hh:21
Eigen::Map< const Eigen::Vector< ScalarType, size > > toEigenMap(const Dune::FieldVector< ScalarType, size > &vec)
View a Dune::FieldVector as an Eigen::Vector using Map, no copies take place.
Definition: eigendunetransformations.hh:83
Dune::FieldVector< ScalarType, size > toDune(const Eigen::Vector< ScalarType, size > &vec)
Create Eigen::Vector to Dune::FieldVector.
Definition: eigendunetransformations.hh:30
Definition: resultevaluators.hh:20