Skip to content
Snippets Groups Projects
Commit 92d0c0c3 authored by Tom Fischer's avatar Tom Fischer
Browse files

[MPL] Change LinearProperty implementation.

reference_value * (1 + slope * (independent_variable - independent_variable_reference_condition))
parent 119c4410
No related branches found
No related tags found
No related merge requests found
......@@ -23,18 +23,20 @@ LinearProperty::LinearProperty(PropertyDataType const& property_reference_value,
PropertyDataType LinearProperty::value(
VariableArray const& variable_array) const
{
return boost::get<double>(_value) +
boost::get<double>(_independent_variable.slope) *
(boost::get<double>(variable_array[static_cast<int>(
_independent_variable.type)]) -
boost::get<double>(_independent_variable.reference_condition));
return boost::get<double>(_value) *
(1 + boost::get<double>(_independent_variable.slope) *
(boost::get<double>(variable_array[static_cast<int>(
_independent_variable.type)]) -
boost::get<double>(
_independent_variable.reference_condition)));
}
PropertyDataType LinearProperty::dValue(VariableArray const& /*variable_array*/,
Variable const primary_variable) const
{
return _independent_variable.type == primary_variable
? _independent_variable.slope
? boost::get<double>(_value) *
boost::get<double>(_independent_variable.slope)
: decltype(_value){};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment