![]() |
OGS
|
|
Sigmoid property with configurable independent variable
The sigmoid function is a smooth step function with a configurable range defined by the following formula
\[ (X_\mathrm{u} - X_\mathrm{l}) \left[1 + \exp(-k(X - X_\mathrm{c})) \right]^{-1} + X_\mathrm{l} \]
where
#include <Sigmoid.h>
Public Member Functions | |
| Sigmoid (std::string name, double const steepness, double const midpoint, double const lower_bound, double const upper_bound, Variable const independent_variable) | |
| PropertyDataType | value (VariableArray const &variable_array, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override |
| PropertyDataType | dValue (VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override |
| PropertyDataType | d2Value (VariableArray const &variable_array, Variable const variable1, Variable const variable2, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override |
| Default implementation: 2nd derivative of any constant property is zero. | |
| Public Member Functions inherited from MaterialPropertyLib::Property | |
| virtual | ~Property () |
| virtual PropertyDataType | initialValue (ParameterLib::SpatialPosition const &pos, double const t) const |
| virtual PropertyDataType | value () const |
| virtual PropertyDataType | value (VariableArray const &variable_array, VariableArray const &variable_array_prev, ParameterLib::SpatialPosition const &pos, double const t, double const dt) 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 |
| virtual void | setProperties (std::vector< std::unique_ptr< Phase > > const &phases) |
| Default implementation: | |
| void | setScale (std::variant< Medium *, Phase *, Component * > scale) |
| template<typename T> | |
| T | initialValue (ParameterLib::SpatialPosition const &pos, double const t) const |
| template<typename T> | |
| T | value () const |
| template<typename T> | |
| T | value (VariableArray const &variable_array, VariableArray const &variable_array_prev, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const |
| template<typename T> | |
| T | value (VariableArray const &variable_array, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const |
| template<typename T> | |
| 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 |
| template<typename T> | |
| T | dValue (VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const |
| template<typename T> | |
| T | d2Value (VariableArray const &variable_array, Variable const &variable1, Variable const &variable2, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const |
Private Member Functions | |
| bool | derivativeVanishes (Variable const variable) const |
Private Attributes | |
| double | steepness_ |
| double | midpoint_ |
| double | lower_bound_ |
| X_l parameter (lower bound) | |
| double | upper_bound_ |
| X_u parameter (upper bound) | |
| Variable | independent_variable_ |
Additional Inherited Members | |
| Protected Attributes inherited from MaterialPropertyLib::Property | |
| std::string | name_ |
| PropertyDataType | value_ |
| The single value of a property. | |
| PropertyDataType | dvalue_ |
| std::variant< Medium *, Phase *, Component * > | scale_ |
| MaterialPropertyLib::Sigmoid::Sigmoid | ( | std::string | name, |
| double const | steepness, | ||
| double const | midpoint, | ||
| double const | lower_bound, | ||
| double const | upper_bound, | ||
| Variable const | independent_variable ) |
Definition at line 40 of file Sigmoid.cpp.
References independent_variable_, lower_bound_, midpoint_, MaterialPropertyLib::name, MaterialPropertyLib::Property::name_, OGS_FATAL, steepness_, and upper_bound_.
|
overridevirtual |
Default implementation: 2nd derivative of any constant property is zero.
This virtual method will compute the second derivative of a property with respect to the given variables pv1 and pv2.
Reimplemented from MaterialPropertyLib::Property.
Definition at line 119 of file Sigmoid.cpp.
References derivativeVanishes(), lower_bound_, MaterialPropertyLib::normalizedState(), steepness_, MaterialPropertyLib::unused_dt, upper_bound_, and MaterialPropertyLib::Property::value().
|
private |
True when the derivative w.r.t. variable is identically zero, i.e. variable is not the independent variable.
Definition at line 86 of file Sigmoid.cpp.
References independent_variable_.
|
overridevirtual |
This virtual method will compute the property derivative value based on the variables that are passed as arguments with the default implementation using empty variables array for the previous time step.
The default implementation of this method only returns the property value derivative without altering it.
Reimplemented from MaterialPropertyLib::Property.
Definition at line 92 of file Sigmoid.cpp.
References derivativeVanishes(), lower_bound_, MaterialPropertyLib::normalizedState(), steepness_, MaterialPropertyLib::unused_dt, upper_bound_, and MaterialPropertyLib::Property::value().
|
overridevirtual |
This virtual method will compute the property value based on the variables that are passed as arguments with the default implementation using empty variables array for the previous time step.
Reimplemented from MaterialPropertyLib::Property.
Definition at line 63 of file Sigmoid.cpp.
References independent_variable_, lower_bound_, MaterialPropertyLib::max_exp_argument, midpoint_, steepness_, and upper_bound_.
|
private |
Independent material variable (temperature, pressure, etc.)
Definition at line 72 of file Sigmoid.h.
Referenced by Sigmoid(), derivativeVanishes(), and value().
|
private |
|
private |
|
private |
|
private |