25 switch (values.size())
33 return Eigen::Vector2d{values[0], values[1]};
37 return Eigen::Vector3d{values[0], values[1], values[2]};
41 using M = Eigen::Matrix2d;
43 using MRM = Eigen::Matrix<double, 2, 2, Eigen::RowMajor>;
44 return M{Eigen::Map<MRM const>{values.data(), 2, 2}};
49 using M = Eigen::Matrix<double, 6, 1>;
50 return M{Eigen::Map<M const>{values.data(), 6}};
54 using M = Eigen::Matrix3d;
56 using MRM = Eigen::Matrix<double, 3, 3, Eigen::RowMajor>;
57 return M{Eigen::Map<MRM const>{values.data(), 3, 3}};
62 "Conversion of a {:d}-vector to PropertyDataType is not "
73 std::numeric_limits<double>::quiet_NaN());
87 double const ,
double const )
const
97 double const t,
double const dt)
const
109 double const ,
double const )
const
122 double const t,
double const dt)
const
146 std::vector<std::unique_ptr<Phase>>
const& )
153 return "property '" +
name_ +
"' defined for " +
155 [](
auto&& scale) -> std::string
157 if (scale ==
nullptr)
159 return "unknown scale";
161 return scale->description();
virtual void setProperties(std::vector< std::unique_ptr< Phase > > const &phases)
Default implementation:
virtual PropertyDataType d2Value(VariableArray const &variable_array, Variable const variable1, Variable const variable2, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
Default implementation: 2nd derivative of any constant property is zero.
std::string description() const
PropertyDataType value_
The single value of a property.
virtual PropertyDataType value() const
std::variant< Medium *, Phase *, Component * > scale_
virtual PropertyDataType initialValue(ParameterLib::SpatialPosition const &pos, double const t) const
virtual PropertyDataType dValue(VariableArray const &variable_array, VariableArray const &variable_array_prev, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
PropertyDataType fromVector(std::vector< double > const &values)
static const VariableArray EmptyVariableArray
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