18template <
int GlobalDim>
21 Eigen::Matrix<double, GlobalDim, 1>
operator()(
double const value)
const
23 if constexpr (GlobalDim == 1)
25 return Eigen::Matrix<double, 1, 1>{value};
27 if constexpr (GlobalDim == 2)
29 return Eigen::Matrix<double, 2, 1>{value, value};
31 if constexpr (GlobalDim == 3)
33 return Eigen::Matrix<double, 3, 1>{value, value, value};
35 OGS_FATAL(
"Cannot convert a scalar to a {:d}d vector.", GlobalDim);
39 Eigen::Vector2d
const& values)
const
41 if constexpr (GlobalDim == 2)
45 OGS_FATAL(
"Cannot convert a 2d vector to a {:d}d vector.", GlobalDim);
49 Eigen::Vector3d
const& values)
const
51 if constexpr (GlobalDim == 3)
55 OGS_FATAL(
"Cannot convert a 3d vector to a {:d}d vector.", GlobalDim);
59 Eigen::Matrix<double, 2, 2>
const& )
const
61 OGS_FATAL(
"Cannot convert a 2d tensor to a {:d}d Vector.", GlobalDim);
64 Eigen::Matrix<double, 3, 3>
const& )
const
66 OGS_FATAL(
"Cannot convert a 3d tensor to a {:d}d Vector.", GlobalDim);
70 Eigen::Matrix<double, 4, 1>
const& )
const
72 OGS_FATAL(
"Cannot convert a 4d vector to a {:d}d vector.", GlobalDim);
76 Eigen::Matrix<double, 6, 1>
const& )
const
78 OGS_FATAL(
"Cannot convert a 6d vector to a {:d}d vector.", GlobalDim);
82 Eigen::MatrixXd
const& )
const
84 OGS_FATAL(
"Cannot convert a dynamic Eigen matrix to a {:d}d vector ",
89template <
int GlobalDim>
template Eigen::Matrix< double, 1, 1 > formEigenVector< 1 >(MaterialPropertyLib::PropertyDataType const &values)
Eigen::Matrix< double, GlobalDim, 1 > formEigenVector(MaterialPropertyLib::PropertyDataType const &values)
template Eigen::Matrix< double, 2, 1 > formEigenVector< 2 >(MaterialPropertyLib::PropertyDataType const &values)
template Eigen::Matrix< double, 3, 1 > formEigenVector< 3 >(MaterialPropertyLib::PropertyDataType const &values)
std::variant< double, Eigen::Matrix< double, 2, 1 >, Eigen::Matrix< double, 3, 1 >, Eigen::Matrix< double, 2, 2 >, Eigen::Matrix< double, 3, 3 >, Eigen::Matrix< double, 4, 1 >, Eigen::Matrix< double, 6, 1 >, Eigen::MatrixXd > PropertyDataType