OGS
MaterialPropertyLib::Constant Class Referencefinal

Detailed Description

The constant property class. This property simply retrieves the stored constant value. It accepts all datatypes defined in PropertyDataType (currently: double, Vector, Tensor, std::string)

Definition at line 21 of file Constant.h.

#include <Constant.h>

Inheritance diagram for MaterialPropertyLib::Constant:
[legend]
Collaboration diagram for MaterialPropertyLib::Constant:
[legend]

Public Member Functions

 Constant (std::string name, PropertyDataType const &v)
 
PropertyDataType dValue (VariableArray const &, VariableArray const &, Variable const, ParameterLib::SpatialPosition const &, double const, double const) const override
 
- 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 value (VariableArray const &variable_array, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
virtual PropertyDataType dValue (VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
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.
 
virtual void setProperties (std::vector< std::unique_ptr< Phase > > const &phases)
 Default implementation:
 
void setScale (std::variant< Medium *, Phase *, Component * > scale)
 
template<typename T >
initialValue (ParameterLib::SpatialPosition const &pos, double const t) const
 
template<typename T >
value () const
 
template<typename 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 >
value (VariableArray const &variable_array, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
template<typename 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 >
dValue (VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 
template<typename T >
d2Value (VariableArray const &variable_array, Variable const &variable1, Variable const &variable2, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const
 

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_
 

Constructor & Destructor Documentation

◆ Constant()

MaterialPropertyLib::Constant::Constant ( std::string name,
PropertyDataType const & v )

This constructor accepts single values of any data type defined in the PropertyDataType definition and sets the protected attribute value_ of the base class Property to that value.

Definition at line 56 of file Constant.cpp.

57{
58 name_ = std::move(name);
59 value_ = v;
60 dvalue_ = std::visit(ZeroInitPropertyDataType{}, v);
61};
PropertyDataType value_
The single value of a property.
Definition Property.h:292
PropertyDataType dvalue_
Definition Property.h:293

References MaterialPropertyLib::Property::dvalue_, MaterialPropertyLib::name, MaterialPropertyLib::Property::name_, and MaterialPropertyLib::Property::value_.

Member Function Documentation

◆ dValue()

PropertyDataType MaterialPropertyLib::Constant::dValue ( VariableArray const & ,
VariableArray const & ,
Variable const ,
ParameterLib::SpatialPosition const & ,
double const ,
double const  ) const
inlineoverridevirtual

If the property is no a scalar constant, the returned scalar zero value is used to form a tensor or a vector via calling formEigenTensor or FormEigenVector, respectively

Reimplemented from MaterialPropertyLib::Property.

Definition at line 32 of file Constant.h.

38 {
39 return 0.0;
40 }

The documentation for this class was generated from the following files: