13#include <dune/common/diagonalmatrix.hh>
14#include <dune/common/fmatrix.hh>
15#include <dune/common/fvector.hh>
16#include <dune/istl/scaledidmatrix.hh>
29template <
typename ST,
int size>
32 for (
int i = 0; i < size; ++i)
33 fieldVector[i] = vec[i];
46template <
typename ST,
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);
65template <
typename ST,
int rows,
int cols>
66Dune::FieldMatrix<ST, rows, cols>
toDune(
const Eigen::Matrix<ST, rows, cols>& mat) {
67 Dune::FieldMatrix<ST, 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);
82template <
typename ST,
int size>
84 return {vec.data(), size};
94template <
typename ST,
int size>
96 return {vec.data(), size};
Definition: assemblermanipulatorbuildingblocks.hh:22
Dune::FieldVector< ST, size > toDune(const Eigen::Vector< ST, size > &vec)
Create Eigen::Vector to Dune::FieldVector.
Definition: eigendunetransformations.hh:30
Eigen::Map< const Eigen::Vector< ST, size > > toEigenMap(const Dune::FieldVector< ST, size > &vec)
View a Dune::FieldVector as an Eigen::Vector using Map, no copies take place.
Definition: eigendunetransformations.hh:83
Definition: utils/dirichletvalues.hh:32