diff --git a/MaterialLib/MPL/Properties/ExponentialProperty.cpp b/MaterialLib/MPL/Properties/ExponentialProperty.cpp index be4d4d8fbf58f7368b72dc8dd02bebc5decd3e1a..07802b9f2b72f9bb9be9fda2550b058b39a07d37 100644 --- a/MaterialLib/MPL/Properties/ExponentialProperty.cpp +++ b/MaterialLib/MPL/Properties/ExponentialProperty.cpp @@ -25,7 +25,9 @@ ExponentialProperty::ExponentialProperty( } PropertyDataType ExponentialProperty::value( - VariableArray const& variable_array) const + VariableArray const& variable_array, + ParameterLib::SpatialPosition const& /*pos*/, + double const /*t*/) const { return std::get<double>(_value) * std::exp( diff --git a/MaterialLib/MPL/Properties/ExponentialProperty.h b/MaterialLib/MPL/Properties/ExponentialProperty.h index ae9c4c384a4579d99f14ae5d903fca7f80e6a6d6..4169461db317c53e938a2628afa330baf4f1419f 100644 --- a/MaterialLib/MPL/Properties/ExponentialProperty.h +++ b/MaterialLib/MPL/Properties/ExponentialProperty.h @@ -38,9 +38,11 @@ public: ExponentData const& v); /// This method computes the value of a property \f$\alpha\f$ depending /// exponentialy on the value of the given primary variable \f$\beta\f$. - PropertyDataType value(VariableArray const& variable_array) const override; - /// This method will compute the derivative of a property with respect to - /// the given primary variable. + PropertyDataType value(VariableArray const& variable_array, + ParameterLib::SpatialPosition const& pos, + double const t) const override; + /// This method will compute the derivative of a property with respect + /// to the given primary variable. PropertyDataType dValue(VariableArray const& variable_array, Variable const primary_variable) const override; /// This method will compute the second derivative of a diff --git a/MaterialLib/MPL/Properties/LinearProperty.cpp b/MaterialLib/MPL/Properties/LinearProperty.cpp index 585653b7d00c2e6b6a35433573470e7e2c92b294..bb09815239d4c5e0e44bea6631745168e7acd932 100644 --- a/MaterialLib/MPL/Properties/LinearProperty.cpp +++ b/MaterialLib/MPL/Properties/LinearProperty.cpp @@ -21,7 +21,9 @@ LinearProperty::LinearProperty(PropertyDataType const& property_reference_value, } PropertyDataType LinearProperty::value( - VariableArray const& variable_array) const + VariableArray const& variable_array, + ParameterLib::SpatialPosition const& /*pos*/, + double const /*t*/) const { return std::get<double>(_value) * (1 + @@ -31,6 +33,7 @@ PropertyDataType LinearProperty::value( std::get<double>(_independent_variable.reference_condition))); } + PropertyDataType LinearProperty::dValue(VariableArray const& /*variable_array*/, Variable const primary_variable) const { diff --git a/MaterialLib/MPL/Properties/LinearProperty.h b/MaterialLib/MPL/Properties/LinearProperty.h index 61727a702d8af81c84dde3b6771edbfa7090d693..f7543c56efe0dfc410afbee1590871514bd0fe39 100644 --- a/MaterialLib/MPL/Properties/LinearProperty.h +++ b/MaterialLib/MPL/Properties/LinearProperty.h @@ -34,9 +34,13 @@ public: /// of the base class Property to that value. LinearProperty(PropertyDataType const& property_reference_value, IndependentVariable const& v); + /// This method computes the value of a property depending linearly on /// the value of the given primary variable. - PropertyDataType value(VariableArray const& variable_array) const override; + PropertyDataType value(VariableArray const& variable_array, + ParameterLib::SpatialPosition const& pos, + double const t) const override; + /// This method will compute the derivative of a property with respect to /// the given primary variable. PropertyDataType dValue(VariableArray const& variable_array, diff --git a/MaterialLib/MPL/Property.cpp b/MaterialLib/MPL/Property.cpp index 10fca184d674b4f0309c5a6dbc3deb3e5d9fd79f..2572850b43ec8a65c406e81251e852731bb6b0ae 100644 --- a/MaterialLib/MPL/Property.cpp +++ b/MaterialLib/MPL/Property.cpp @@ -22,9 +22,12 @@ PropertyDataType Property::value() const { return _value; } + /// The default implementation of this method only returns the property value /// without altering it. -PropertyDataType Property::value(VariableArray const& /*variable_array*/) const +PropertyDataType Property::value(VariableArray const& /*variable_array*/, + ParameterLib::SpatialPosition const& /*pos*/, + double const /*t*/) const { return _value; } diff --git a/MaterialLib/MPL/Property.h b/MaterialLib/MPL/Property.h index 889bbb1777c30e5c295ecb0699896d16ff976e7b..22e83c2873881ce4abb03e86c198eccb73875f8c 100644 --- a/MaterialLib/MPL/Property.h +++ b/MaterialLib/MPL/Property.h @@ -19,6 +19,8 @@ #include "PropertyType.h" #include "VariableType.h" +#include "ParameterLib/SpatialPosition.h" + namespace MaterialPropertyLib { /// This is a custom data type for arbitrary properties, based on the @@ -53,7 +55,9 @@ public: virtual PropertyDataType value() const; /// This virtual method will compute the property value based on the primary /// variables that are passed as arguments. - virtual PropertyDataType value(VariableArray const& variable_array) const; + virtual PropertyDataType value(VariableArray const& variable_array, + ParameterLib::SpatialPosition const& pos, + double const t) const; /// This virtual method will compute the derivative of a property /// with respect to the given variable pv. virtual PropertyDataType dValue(VariableArray const& variable_array, @@ -69,11 +73,15 @@ public: { return std::get<T>(value()); } + template <typename T> - T value(VariableArray const& variable_array) const + T value(VariableArray const& variable_array, + ParameterLib::SpatialPosition const& pos, + double const t) const { - return std::get<T>(value(variable_array)); + return std::get<T>(value(variable_array, pos, t)); } + template <typename T> T dValue(VariableArray const& variable_array, Variable const variable) const