32 std::variant<double, Eigen::Matrix<double, 2, 1>,
33 Eigen::Matrix<double, 3, 1>, Eigen::Matrix<double, 2, 2>,
34 Eigen::Matrix<double, 3, 3>, Eigen::Matrix<double, 4, 1>,
35 Eigen::Matrix<double, 6, 1>, Eigen::MatrixXd>;
83 double const t,
double const dt)
const;
89 double const t,
double const dt)
const;
97 double const t,
double const dt)
const;
104 double const t,
double const dt)
const;
111 double const t,
double const dt)
const;
116 std::vector<std::unique_ptr<Phase>>
const& phases);
118 void setScale(std::variant<Medium*, Phase*, Component*> scale)
124 template <
typename T>
126 double const t)
const
132 catch (std::bad_variant_access
const&)
135 "The initial value of {:s} does not hold requested type '{:s}' "
143 template <
typename T>
151 return std::get<T>(
value());
153 catch (std::bad_variant_access
const&)
156 "The value of {:s} does not hold requested type '{:s}' but a "
164 template <
typename T>
168 double const dt)
const
176 value(variable_array, variable_array_prev, pos, t, dt));
178 catch (std::bad_variant_access
const&)
181 "The value of {:s} is not of the requested type '{:s}' but a "
186 variable_array_prev, pos, t, dt)
190 template <
typename T>
193 double const dt)
const
200 return std::get<T>(
value(variable_array, pos, t, dt));
202 catch (std::bad_variant_access
const&)
205 "The value of {:s} is not of the requested type '{:s}' but a "
214 template <
typename T>
218 double const dt)
const
225 return std::get<T>(
dValue(variable_array, variable_array_prev,
226 variable, pos, t, dt));
228 catch (std::bad_variant_access
const&)
231 "The first derivative value of {:s} is not of the requested "
232 "type '{:s}' but a {:s}.",
236 [
dValue(variable_array, variable, pos, t, dt).index()]);
239 template <
typename T>
242 double const dt)
const
249 return std::get<T>(
dValue(variable_array, variable, pos, t, dt));
251 catch (std::bad_variant_access
const&)
254 "The first derivative value of {:s} is not of the requested "
255 "type '{:s}' but a {:s}.",
259 [
dValue(variable_array, variable, pos, t, dt).index()]);
262 template <
typename T>
266 double const dt)
const
274 d2Value(variable_array, variable1, variable2, pos, t, dt));
276 catch (std::bad_variant_access
const&)
279 "The second derivative value of {:s} is not of the requested "
280 "type '{:s}' but a {:s}.",
284 variable2, pos, t, dt)
297 std::variant<Medium*, Phase*, Component*>
scale_;
313 "scalar",
"2-vector",
"3-vector",
314 "2x2-matrix",
"3x3-matrix",
"2D-Kelvin vector",
315 "3D-Kelvin vector",
"dynamic matrix type"};
317 std::variant_size_v<PropertyDataType>,
318 "The array of property data type names has different size "
319 "than the PropertyDataType variant type.");
325 std::variant<Medium*, Phase*, Component*>
328 for (std::size_t i = 0; i < properties.size(); ++i)
330 if (new_properties[i] !=
nullptr)
332 properties[i] = std::move(new_properties[i]);
333 properties[i]->setScale(scale_pointer);
340 std::vector<std::unique_ptr<Phase>>
const& phases)
342 for (
auto& p : properties)
346 p->setProperties(phases);
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
virtual void checkScale() const
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
static constexpr std::array property_data_type_names_
Corresponds to the PropertyDataType.
T dValue(VariableArray const &variable_array, VariableArray const &variable_array_prev, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
T value(VariableArray const &variable_array, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
T d2Value(VariableArray const &variable_array, Variable const &variable1, Variable const &variable2, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
PropertyDataType value_
The single value of a property.
T dValue(VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
T initialValue(ParameterLib::SpatialPosition const &pos, double const t) const
virtual PropertyDataType value() const
void setScale(std::variant< Medium *, Phase *, Component * > scale)
T value(VariableArray const &variable_array, VariableArray const &variable_array_prev, ParameterLib::SpatialPosition const &pos, double const t, double const dt) 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
void overwriteExistingProperties(PropertyArray &properties, PropertyArray &new_properties, std::variant< Medium *, Phase *, Component * > scale_pointer)
PropertyDataType fromVector(std::vector< double > const &values)
std::array< std::unique_ptr< Property >, PropertyType::number_of_properties > PropertyArray
void updatePropertiesForAllPhases(PropertyArray &properties, std::vector< std::unique_ptr< Phase > > const &phases)
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