18template <
int GlobalDim>
24 result.template head<3>() = Eigen::Vector3d::Constant(value);
31 result.template head<2>() = values;
38 result.template head<3>() = values;
44 if constexpr (GlobalDim == 2)
47 result << values(0, 0), values(1, 1), 0., values(0, 1);
50 OGS_FATAL(
"Cannot convert 2d matrix to 3d symmetric Tensor.");
55 if constexpr (GlobalDim == 3)
58 result << values(0, 0), values(1, 1), values(2, 2), values(0, 1),
59 values(1, 2), values(0, 2);
62 OGS_FATAL(
"Cannot convert 3d matrix to 2d symmetric Tensor.");
68 if constexpr (GlobalDim == 2)
72 OGS_FATAL(
"Cannot convert 3d symmetric tensor to 2d symmetric tensor.");
78 if constexpr (GlobalDim == 3)
82 OGS_FATAL(
"Cannot convert 2d symmetric tensor to 3d symmetric tensor.");
86 Eigen::MatrixXd
const& )
const
89 "Cannot convert dynamic Eigen matrix to {:d}d symmetric tensor.",
94template <
int GlobalDim>
template Eigen::Matrix< double, 4, 1 > getSymmetricTensor< 2 >(MaterialPropertyLib::PropertyDataType const &values)
template Eigen::Matrix< double, 6, 1 > getSymmetricTensor< 3 >(MaterialPropertyLib::PropertyDataType const &values)
Eigen::Matrix< double, symmetric_tensor_size< GlobalDim >, 1 > SymmetricTensor
SymmetricTensor< GlobalDim > getSymmetricTensor(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
SymmetricTensor< GlobalDim > operator()(double const &value) const
SymmetricTensor< GlobalDim > operator()(Eigen::Vector3d const &values) const
SymmetricTensor< GlobalDim > operator()(Eigen::MatrixXd const &) const
SymmetricTensor< GlobalDim > operator()(Eigen::Matrix2d const &values) const
SymmetricTensor< GlobalDim > operator()(Eigen::Vector2d const &values) const
SymmetricTensor< GlobalDim > operator()(Eigen::Matrix3d const &values) const
SymmetricTensor< GlobalDim > operator()(SymmetricTensor< 2 > const &values) const
SymmetricTensor< GlobalDim > operator()(SymmetricTensor< 3 > const &values) const