18 : independent_variable_(independent_variable), curve_(curve)
25 double const t,
double const )
const
28 if (
Variable const*
const independent_variable =
31 x = std::get<double>(variable_array[*independent_variable]);
33 else if (std::string
const*
const str_ptr =
40 else if (*str_ptr ==
"x")
44 else if (*str_ptr ==
"y")
48 else if (*str_ptr ==
"z")
54 OGS_FATAL(
"Unknown independent_variable {:s} for curve property.",
61 "Could not convert independent_variable neither to a Variable nor "
70 double const ,
double const )
const
72 Variable const*
const independent_variable =
74 if (independent_variable ==
nullptr)
78 if (variable != *independent_variable)
82 auto const x = std::get<double>(variable_array[*independent_variable]);
StringOrVariable const independent_variable_
The variable type that the curve property depends on.
PropertyDataType dValue(VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &, double const, double const) const override
MathLib::PiecewiseLinearInterpolation const & curve_
The curve used by the property.
Curve(std::string name, StringOrVariable const independent_variable, MathLib::PiecewiseLinearInterpolation const &curve)
virtual PropertyDataType value() const
double getDerivative(double const pnt_to_interpolate) const
Calculates derivative using quadratic interpolation and central difference quotient.
double getValue(double pnt_to_interpolate) const
Calculates the interpolation value.
std::optional< MathLib::Point3d > const getCoordinates() const
std::variant< std::string, Variable > StringOrVariable
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