OGS
MaterialPropertyLib::Property Class Reference

Detailed Description

This class is the base class for any material property of any scale (i.e. components, phases, media, ...). The single value of that Property can hold scalars, vectors, tensors, strings, etc.

Definition at line 43 of file MaterialLib/MPL/Property.h.

#include <Property.h>

Inherited by MaterialPropertyLib::AverageMolarMass, MaterialPropertyLib::BishopsPowerLaw, MaterialPropertyLib::BishopsSaturationCutoff, MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten, MaterialPropertyLib::CapillaryPressureVanGenuchten, MaterialPropertyLib::ClausiusClapeyron, MaterialPropertyLib::Constant, MaterialPropertyLib::CubicLawPermeability, MaterialPropertyLib::Curve, MaterialPropertyLib::DupuitPermeability, MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >, MaterialPropertyLib::EmbeddedFracturePermeability< DisplacementDim >, MaterialPropertyLib::Exponential, MaterialPropertyLib::Function, MaterialPropertyLib::GasPressureDependentPermeability< DisplacementDim >, MaterialPropertyLib::IdealGasLaw, MaterialPropertyLib::IdealGasLawBinaryMixture, MaterialPropertyLib::KozenyCarmanModel, MaterialPropertyLib::Linear, MaterialPropertyLib::LinearSaturationSwellingStress, MaterialPropertyLib::LinearWaterVapourLatentHeat, MaterialPropertyLib::LiquidViscosityVogels< VogelsConstants >, MaterialPropertyLib::OrthotropicEmbeddedFracturePermeability< DisplacementDim >, MaterialPropertyLib::Parameter, MaterialPropertyLib::PengRobinson, MaterialPropertyLib::PermeabilityMohrCoulombFailureIndexModel< DisplacementDim >, MaterialPropertyLib::PermeabilityOrthotropicPowerLaw< DisplacementDim >, MaterialPropertyLib::PorosityFromMassBalance, MaterialPropertyLib::RelPermBrooksCorey, MaterialPropertyLib::RelPermBrooksCoreyNonwettingPhase, MaterialPropertyLib::RelPermGeneralizedPower, MaterialPropertyLib::RelPermGeneralizedPowerNonwettingPhase, MaterialPropertyLib::RelPermLiakopoulos, MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem, MaterialPropertyLib::RelPermUdell, MaterialPropertyLib::RelPermUdellNonwettingPhase, MaterialPropertyLib::RelPermVanGenuchten, MaterialPropertyLib::SaturationBrooksCorey, MaterialPropertyLib::SaturationDependentSwelling, MaterialPropertyLib::SaturationExponential, MaterialPropertyLib::SaturationLiakopoulos, MaterialPropertyLib::SaturationVanGenuchten, MaterialPropertyLib::SaturationVanGenuchtenWithVolumetricStrain, MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension >, MaterialPropertyLib::SpecificHeatCapacityWithLatentHeat, MaterialPropertyLib::StrainDependentPermeability< DisplacementDim >, MaterialPropertyLib::TemperatureDependentDiffusion, MaterialPropertyLib::TemperatureDependentFraction, MaterialPropertyLib::TransportPorosityFromMassBalance, MaterialPropertyLib::VapourDiffusionDeVries, MaterialPropertyLib::VapourDiffusionFEBEX, MaterialPropertyLib::VapourDiffusionPMQ, MaterialPropertyLib::VermaPruessModel, MaterialPropertyLib::VolumeFractionAverage, MaterialPropertyLib::WaterDensityIAPWSIF97Region1, MaterialPropertyLib::WaterEnthalpyIAPWSIF97Region1, MaterialPropertyLib::WaterLiquidDensityIAPWSIF97Region4, MaterialPropertyLib::WaterLiquidEnthalpyIAPWSIF97Region4, MaterialPropertyLib::WaterSaturationTemperatureIAPWSIF97Region4, MaterialPropertyLib::WaterTemperatureIAPWSIF97Region1, MaterialPropertyLib::WaterThermalConductivityIAPWS, MaterialPropertyLib::WaterVapourDensity, MaterialPropertyLib::WaterVapourDensityIAPWSIF97Region4, MaterialPropertyLib::WaterVapourEnthalpyIAPWSIF97Region4, MaterialPropertyLib::WaterVapourLatentHeatWithCriticalTemperature, and MaterialPropertyLib::WaterViscosityIAPWS.

Public Member Functions

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, VariableArray const &variable_array_prev, Variable const variable, 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

Protected Attributes

std::string name_
PropertyDataType value_
 The single value of a property.
PropertyDataType dvalue_
std::variant< Medium *, Phase *, Component * > scale_

Private Member Functions

virtual void checkScale () const
std::string description () const

Private Attributes

bool property_used = false

Static Private Attributes

static constexpr std::array property_data_type_names_
 Corresponds to the PropertyDataType.

Constructor & Destructor Documentation

◆ ~Property()

virtual MaterialPropertyLib::Property::~Property ( )
inlinevirtual

Definition at line 47 of file MaterialLib/MPL/Property.h.

48 {
49 if (property_used)
50 {
51 DBUG("Property is used: '{:s}'", description());
52 }
53 else
54 {
55 WARN("Property is not used: '{:s}'", description());
56 }
57 }
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:34

References DBUG(), description(), property_used, and WARN().

Member Function Documentation

◆ checkScale()

virtual void MaterialPropertyLib::Property::checkScale ( ) const
inlineprivatevirtual

Reimplemented in MaterialPropertyLib::AverageMolarMass, MaterialPropertyLib::BishopsPowerLaw, MaterialPropertyLib::BishopsSaturationCutoff, MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten, MaterialPropertyLib::CapillaryPressureVanGenuchten, MaterialPropertyLib::ClausiusClapeyron, MaterialPropertyLib::CubicLawPermeability, MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >, MaterialPropertyLib::EmbeddedFracturePermeability< DisplacementDim >, MaterialPropertyLib::GasPressureDependentPermeability< DisplacementDim >, MaterialPropertyLib::IdealGasLaw, MaterialPropertyLib::IdealGasLawBinaryMixture, MaterialPropertyLib::LinearSaturationSwellingStress, MaterialPropertyLib::LinearWaterVapourLatentHeat, MaterialPropertyLib::LiquidViscosityVogels< VogelsConstants >, MaterialPropertyLib::OrthotropicEmbeddedFracturePermeability< DisplacementDim >, MaterialPropertyLib::PermeabilityMohrCoulombFailureIndexModel< DisplacementDim >, MaterialPropertyLib::PermeabilityOrthotropicPowerLaw< DisplacementDim >, MaterialPropertyLib::PorosityFromMassBalance, MaterialPropertyLib::RelPermBrooksCorey, MaterialPropertyLib::RelPermBrooksCoreyNonwettingPhase, MaterialPropertyLib::RelPermGeneralizedPower, MaterialPropertyLib::RelPermGeneralizedPowerNonwettingPhase, MaterialPropertyLib::RelPermLiakopoulos, MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem, MaterialPropertyLib::RelPermUdell, MaterialPropertyLib::RelPermUdellNonwettingPhase, MaterialPropertyLib::RelPermVanGenuchten, MaterialPropertyLib::SaturationBrooksCorey, MaterialPropertyLib::SaturationDependentSwelling, MaterialPropertyLib::SaturationExponential, MaterialPropertyLib::SaturationLiakopoulos, MaterialPropertyLib::SaturationVanGenuchten, MaterialPropertyLib::SaturationVanGenuchtenWithVolumetricStrain, MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension >, MaterialPropertyLib::SpecificHeatCapacityWithLatentHeat, MaterialPropertyLib::StrainDependentPermeability< DisplacementDim >, MaterialPropertyLib::TemperatureDependentDiffusion, MaterialPropertyLib::TemperatureDependentFraction, MaterialPropertyLib::TransportPorosityFromMassBalance, MaterialPropertyLib::VapourDiffusionDeVries, MaterialPropertyLib::VapourDiffusionFEBEX, MaterialPropertyLib::VapourDiffusionPMQ, MaterialPropertyLib::VolumeFractionAverage, MaterialPropertyLib::WaterDensityIAPWSIF97Region1, MaterialPropertyLib::WaterEnthalpyIAPWSIF97Region1, MaterialPropertyLib::WaterLiquidDensityIAPWSIF97Region4, MaterialPropertyLib::WaterLiquidEnthalpyIAPWSIF97Region4, MaterialPropertyLib::WaterSaturationTemperatureIAPWSIF97Region4, MaterialPropertyLib::WaterTemperatureIAPWSIF97Region1, MaterialPropertyLib::WaterThermalConductivityIAPWS, MaterialPropertyLib::WaterVapourDensity, MaterialPropertyLib::WaterVapourDensityIAPWSIF97Region4, MaterialPropertyLib::WaterVapourEnthalpyIAPWSIF97Region4, MaterialPropertyLib::WaterVapourLatentHeatWithCriticalTemperature, and MaterialPropertyLib::WaterViscosityIAPWS.

Definition at line 293 of file MaterialLib/MPL/Property.h.

294 {
295 // Empty check for properties which can be defined on every scale,
296 // medium, phase or component
297 }

Referenced by setScale().

◆ d2Value() [1/2]

template<typename T>
T MaterialPropertyLib::Property::d2Value ( VariableArray const & variable_array,
Variable const & variable1,
Variable const & variable2,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
inline

Definition at line 256 of file MaterialLib/MPL/Property.h.

260 {
261 try
262 {
263#ifndef NDEBUG
264 property_used = true;
265#endif
266 return std::get<T>(
267 d2Value(variable_array, variable1, variable2, pos, t, dt));
268 }
269 catch (std::bad_variant_access const&)
270 {
271 OGS_FATAL(
272 "The second derivative value of {:s} is not of the requested "
273 "type '{:s}' but a {:s}.",
274 description(),
276 property_data_type_names_[d2Value(variable_array, variable1,
277 variable2, pos, t, dt)
278 .index()]);
279 }
280 }
#define OGS_FATAL(...)
Definition Error.h:19
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.
static constexpr std::array property_data_type_names_
Corresponds to the PropertyDataType.
std::string typeToString()

References d2Value(), description(), OGS_FATAL, property_data_type_names_, property_used, and BaseLib::typeToString().

◆ d2Value() [2/2]

PropertyDataType MaterialPropertyLib::Property::d2Value ( VariableArray const & variable_array,
Variable const variable1,
Variable const variable2,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
virtual

◆ description()

std::string MaterialPropertyLib::Property::description ( ) const
private

Definition at line 142 of file MaterialLib/MPL/Property.cpp.

143{
144 return "property '" + name_ + "' defined for " +
145 std::visit(
146 [](auto&& scale) -> std::string
147 {
148 if (scale == nullptr)
149 {
150 return "unknown scale";
151 }
152 return scale->description();
153 },
154 scale_);
155}
std::variant< Medium *, Phase *, Component * > scale_
void scale(PETScVector &x, PetscScalar const a)
Definition LinAlg.cpp:37

References name_, and scale_.

Referenced by ~Property(), d2Value(), dValue(), dValue(), initialValue(), value(), value(), and value().

◆ dValue() [1/4]

PropertyDataType MaterialPropertyLib::Property::dValue ( VariableArray const & variable_array,
Variable const variable,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
virtual

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 in MaterialPropertyLib::AverageMolarMass, MaterialPropertyLib::BishopsPowerLaw, MaterialPropertyLib::BishopsSaturationCutoff, MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten, MaterialPropertyLib::CapillaryPressureVanGenuchten, MaterialPropertyLib::ClausiusClapeyron, MaterialPropertyLib::CubicLawPermeability, MaterialPropertyLib::Curve, MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >, MaterialPropertyLib::EmbeddedFracturePermeability< DisplacementDim >, MaterialPropertyLib::Exponential, MaterialPropertyLib::Function, MaterialPropertyLib::GasPressureDependentPermeability< DisplacementDim >, MaterialPropertyLib::IdealGasLaw, MaterialPropertyLib::IdealGasLawBinaryMixture, MaterialPropertyLib::Linear, MaterialPropertyLib::LinearSaturationSwellingStress, MaterialPropertyLib::LinearWaterVapourLatentHeat, MaterialPropertyLib::LiquidViscosityVogels< VogelsConstants >, MaterialPropertyLib::OrthotropicEmbeddedFracturePermeability< DisplacementDim >, MaterialPropertyLib::Parameter, MaterialPropertyLib::PengRobinson, MaterialPropertyLib::PermeabilityMohrCoulombFailureIndexModel< DisplacementDim >, MaterialPropertyLib::PermeabilityOrthotropicPowerLaw< DisplacementDim >, MaterialPropertyLib::PorosityFromMassBalance, MaterialPropertyLib::RelPermBrooksCorey, MaterialPropertyLib::RelPermBrooksCoreyNonwettingPhase, MaterialPropertyLib::RelPermGeneralizedPower, MaterialPropertyLib::RelPermGeneralizedPowerNonwettingPhase, MaterialPropertyLib::RelPermLiakopoulos, MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem, MaterialPropertyLib::RelPermUdell, MaterialPropertyLib::RelPermUdellNonwettingPhase, MaterialPropertyLib::RelPermVanGenuchten, MaterialPropertyLib::SaturationBrooksCorey, MaterialPropertyLib::SaturationExponential, MaterialPropertyLib::SaturationLiakopoulos, MaterialPropertyLib::SaturationVanGenuchten, MaterialPropertyLib::SaturationVanGenuchtenWithVolumetricStrain, MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension >, MaterialPropertyLib::SpecificHeatCapacityWithLatentHeat, MaterialPropertyLib::StrainDependentPermeability< DisplacementDim >, MaterialPropertyLib::TemperatureDependentFraction, MaterialPropertyLib::TransportPorosityFromMassBalance, MaterialPropertyLib::VapourDiffusionDeVries, MaterialPropertyLib::VapourDiffusionFEBEX, MaterialPropertyLib::VapourDiffusionPMQ, MaterialPropertyLib::VolumeFractionAverage, MaterialPropertyLib::WaterDensityIAPWSIF97Region1, MaterialPropertyLib::WaterEnthalpyIAPWSIF97Region1, MaterialPropertyLib::WaterLiquidDensityIAPWSIF97Region4, MaterialPropertyLib::WaterLiquidEnthalpyIAPWSIF97Region4, MaterialPropertyLib::WaterSaturationTemperatureIAPWSIF97Region4, MaterialPropertyLib::WaterTemperatureIAPWSIF97Region1, MaterialPropertyLib::WaterThermalConductivityIAPWS, MaterialPropertyLib::WaterVapourDensity, MaterialPropertyLib::WaterVapourDensityIAPWSIF97Region4, MaterialPropertyLib::WaterVapourEnthalpyIAPWSIF97Region4, MaterialPropertyLib::WaterVapourLatentHeatWithCriticalTemperature, and MaterialPropertyLib::WaterViscosityIAPWS.

Definition at line 110 of file MaterialLib/MPL/Property.cpp.

114{
115#ifndef NDEBUG
116 property_used = true;
117#endif
118 return dValue(variable_array, EmptyVariableArray, variable, pos, t, dt);
119}
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
static const VariableArray EmptyVariableArray

References dValue(), MaterialPropertyLib::EmptyVariableArray, and property_used.

◆ dValue() [2/4]

template<typename T>
T MaterialPropertyLib::Property::dValue ( VariableArray const & variable_array,
Variable const variable,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
inline

Definition at line 233 of file MaterialLib/MPL/Property.h.

236 {
237 try
238 {
239#ifndef NDEBUG
240 property_used = true;
241#endif
242 return std::get<T>(dValue(variable_array, variable, pos, t, dt));
243 }
244 catch (std::bad_variant_access const&)
245 {
246 OGS_FATAL(
247 "The first derivative value of {:s} is not of the requested "
248 "type '{:s}' but a {:s}.",
249 description(),
252 [dValue(variable_array, variable, pos, t, dt).index()]);
253 }
254 }

References description(), dValue(), OGS_FATAL, property_data_type_names_, property_used, and BaseLib::typeToString().

◆ dValue() [3/4]

PropertyDataType MaterialPropertyLib::Property::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

This virtual method will compute the property derivative value based on the variables that are passed as arguments and the variables from the previous time step.

Reimplemented in MaterialPropertyLib::Constant, and MaterialPropertyLib::SaturationDependentSwelling.

Definition at line 96 of file MaterialLib/MPL/Property.cpp.

101{
102#ifndef NDEBUG
103 property_used = true;
104#endif
105 return dvalue_;
106}

References dvalue_, and property_used.

Referenced by dValue(), and dValue().

◆ dValue() [4/4]

template<typename T>
T MaterialPropertyLib::Property::dValue ( VariableArray const & variable_array,
VariableArray const & variable_array_prev,
Variable const variable,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
inline

Definition at line 208 of file MaterialLib/MPL/Property.h.

212 {
213 try
214 {
215#ifndef NDEBUG
216 property_used = true;
217#endif
218 return std::get<T>(dValue(variable_array, variable_array_prev,
219 variable, pos, t, dt));
220 }
221 catch (std::bad_variant_access const&)
222 {
223 OGS_FATAL(
224 "The first derivative value of {:s} is not of the requested "
225 "type '{:s}' but a {:s}.",
226 description(),
229 [dValue(variable_array, variable, pos, t, dt).index()]);
230 }
231 }

References description(), dValue(), OGS_FATAL, property_data_type_names_, property_used, and BaseLib::typeToString().

◆ initialValue() [1/2]

PropertyDataType MaterialPropertyLib::Property::initialValue ( ParameterLib::SpatialPosition const & pos,
double const t ) const
virtual

Returns the initial (or reference) value of the property. The default implementation forwards to the value function.

Reimplemented in MaterialPropertyLib::PorosityFromMassBalance, and MaterialPropertyLib::TransportPorosityFromMassBalance.

Definition at line 60 of file MaterialLib/MPL/Property.cpp.

62{
63 return value(EmptyVariableArray, pos, t,
64 std::numeric_limits<double>::quiet_NaN());
65}
virtual PropertyDataType value() const

References MaterialPropertyLib::EmptyVariableArray, and value().

Referenced by initialValue(), and MaterialPropertyLib::PermeabilityOrthotropicPowerLaw< DisplacementDim >::value().

◆ initialValue() [2/2]

template<typename T>
T MaterialPropertyLib::Property::initialValue ( ParameterLib::SpatialPosition const & pos,
double const t ) const
inline

Definition at line 118 of file MaterialLib/MPL/Property.h.

120 {
121 try
122 {
123 return std::get<T>(initialValue(pos, t));
124 }
125 catch (std::bad_variant_access const&)
126 {
127 OGS_FATAL(
128 "The initial value of {:s} does not hold requested type '{:s}' "
129 "but a {:s}.",
130 description(),
132 property_data_type_names_[initialValue(pos, t).index()]);
133 }
134 }
virtual PropertyDataType initialValue(ParameterLib::SpatialPosition const &pos, double const t) const

References description(), initialValue(), OGS_FATAL, property_data_type_names_, and BaseLib::typeToString().

◆ setProperties()

void MaterialPropertyLib::Property::setProperties ( std::vector< std::unique_ptr< Phase > > const & phases)
virtual

Default implementation:

This virtual method will collect the properties of the phases in order to access them from the medium property level.

Reimplemented in MaterialPropertyLib::SpecificHeatCapacityWithLatentHeat, and MaterialPropertyLib::VolumeFractionAverage.

Definition at line 136 of file MaterialLib/MPL/Property.cpp.

138{
139 // empty
140}

◆ setScale()

void MaterialPropertyLib::Property::setScale ( std::variant< Medium *, Phase *, Component * > scale)
inline

Definition at line 111 of file MaterialLib/MPL/Property.h.

112 {
113 scale_ = scale;
114 checkScale();
115 };

References checkScale(), and scale_.

◆ value() [1/6]

PropertyDataType MaterialPropertyLib::Property::value ( ) const
virtual

This virtual method simply returns the private value_ attribute without changing it.

Definition at line 67 of file MaterialLib/MPL/Property.cpp.

68{
69#ifndef NDEBUG
70 property_used = true;
71#endif
72 return value_;
73}
PropertyDataType value_
The single value of a property.

References property_used, and value_.

Referenced by ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobianEvalConstitutiveSetting(), anonymous_namespace{ogs_mpl.cpp}::bindLinear(), MaterialPropertyLib::AverageMolarMass::dValue(), MaterialPropertyLib::ClausiusClapeyron::dValue(), MaterialPropertyLib::PengRobinson::dValue(), MaterialPropertyLib::RelPermBrooksCorey::dValue(), MaterialPropertyLib::RelPermBrooksCoreyNonwettingPhase::dValue(), MaterialPropertyLib::RelPermLiakopoulos::dValue(), MaterialPropertyLib::SpecificHeatCapacityWithLatentHeat::dValue(), ProcessLib::TH2M::ConstitutiveRelations::PermeabilityModel< DisplacementDim >::eval(), ProcessLib::TH2M::ConstitutiveRelations::SolidThermalExpansionModel< DisplacementDim >::eval(), ProcessLib::TH2M::ConstitutiveRelations::SwellingModel< DisplacementDim >::eval(), ProcessLib::ThermoRichardsMechanics::SolidThermalExpansionModel< DisplacementDim >::eval(), ProcessLib::ThermoRichardsMechanics::TRMHeatStorageAndFluxModel< DisplacementDim >::eval(), initialValue(), MaterialPropertyLib::ClausiusClapeyron::molarMass(), MaterialPropertyLib::AverageMolarMass::value(), MaterialPropertyLib::PorosityFromMassBalance::value(), value(), value(), value(), MaterialPropertyLib::RelPermBrooksCorey::value(), MaterialPropertyLib::RelPermBrooksCoreyNonwettingPhase::value(), MaterialPropertyLib::RelPermLiakopoulos::value(), MaterialPropertyLib::SpecificHeatCapacityWithLatentHeat::value(), and MaterialPropertyLib::TransportPorosityFromMassBalance::value().

◆ value() [2/6]

template<typename T>
T MaterialPropertyLib::Property::value ( ) const
inline

Definition at line 137 of file MaterialLib/MPL/Property.h.

138 {
139 try
140 {
141#ifndef NDEBUG
142 property_used = true;
143#endif
144 return std::get<T>(value());
145 }
146 catch (std::bad_variant_access const&)
147 {
148 OGS_FATAL(
149 "The value of {:s} does not hold requested type '{:s}' but a "
150 "{:s}.",
151 description(),
154 }
155 }

References description(), OGS_FATAL, property_data_type_names_, property_used, BaseLib::typeToString(), and value().

◆ value() [3/6]

PropertyDataType MaterialPropertyLib::Property::value ( VariableArray const & variable_array,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
virtual

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 in MaterialPropertyLib::AverageMolarMass, MaterialPropertyLib::BishopsPowerLaw, MaterialPropertyLib::BishopsSaturationCutoff, MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten, MaterialPropertyLib::CapillaryPressureVanGenuchten, MaterialPropertyLib::ClausiusClapeyron, MaterialPropertyLib::CubicLawPermeability, MaterialPropertyLib::Curve, MaterialPropertyLib::DupuitPermeability, MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >, MaterialPropertyLib::EmbeddedFracturePermeability< DisplacementDim >, MaterialPropertyLib::Exponential, MaterialPropertyLib::Function, MaterialPropertyLib::GasPressureDependentPermeability< DisplacementDim >, MaterialPropertyLib::IdealGasLaw, MaterialPropertyLib::IdealGasLawBinaryMixture, MaterialPropertyLib::KozenyCarmanModel, MaterialPropertyLib::Linear, MaterialPropertyLib::LinearSaturationSwellingStress, MaterialPropertyLib::LinearWaterVapourLatentHeat, MaterialPropertyLib::LiquidViscosityVogels< VogelsConstants >, MaterialPropertyLib::OrthotropicEmbeddedFracturePermeability< DisplacementDim >, MaterialPropertyLib::Parameter, MaterialPropertyLib::PengRobinson, MaterialPropertyLib::PermeabilityMohrCoulombFailureIndexModel< DisplacementDim >, MaterialPropertyLib::PermeabilityOrthotropicPowerLaw< DisplacementDim >, MaterialPropertyLib::PorosityFromMassBalance, MaterialPropertyLib::RelPermBrooksCorey, MaterialPropertyLib::RelPermBrooksCoreyNonwettingPhase, MaterialPropertyLib::RelPermGeneralizedPower, MaterialPropertyLib::RelPermGeneralizedPowerNonwettingPhase, MaterialPropertyLib::RelPermLiakopoulos, MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem, MaterialPropertyLib::RelPermUdell, MaterialPropertyLib::RelPermUdellNonwettingPhase, MaterialPropertyLib::RelPermVanGenuchten, MaterialPropertyLib::SaturationBrooksCorey, MaterialPropertyLib::SaturationExponential, MaterialPropertyLib::SaturationLiakopoulos, MaterialPropertyLib::SaturationVanGenuchten, MaterialPropertyLib::SaturationVanGenuchtenWithVolumetricStrain, MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension >, MaterialPropertyLib::SpecificHeatCapacityWithLatentHeat, MaterialPropertyLib::StrainDependentPermeability< DisplacementDim >, MaterialPropertyLib::TemperatureDependentDiffusion, MaterialPropertyLib::TemperatureDependentFraction, MaterialPropertyLib::TransportPorosityFromMassBalance, MaterialPropertyLib::VapourDiffusionDeVries, MaterialPropertyLib::VapourDiffusionFEBEX, MaterialPropertyLib::VapourDiffusionPMQ, MaterialPropertyLib::VermaPruessModel, MaterialPropertyLib::VolumeFractionAverage, MaterialPropertyLib::WaterDensityIAPWSIF97Region1, MaterialPropertyLib::WaterEnthalpyIAPWSIF97Region1, MaterialPropertyLib::WaterLiquidDensityIAPWSIF97Region4, MaterialPropertyLib::WaterLiquidEnthalpyIAPWSIF97Region4, MaterialPropertyLib::WaterSaturationTemperatureIAPWSIF97Region4, MaterialPropertyLib::WaterTemperatureIAPWSIF97Region1, MaterialPropertyLib::WaterThermalConductivityIAPWS, MaterialPropertyLib::WaterVapourDensity, MaterialPropertyLib::WaterVapourDensityIAPWSIF97Region4, MaterialPropertyLib::WaterVapourEnthalpyIAPWSIF97Region4, MaterialPropertyLib::WaterVapourLatentHeatWithCriticalTemperature, and MaterialPropertyLib::WaterViscosityIAPWS.

Definition at line 86 of file MaterialLib/MPL/Property.cpp.

89{
90#ifndef NDEBUG
91 property_used = true;
92#endif
93 return value(variable_array, EmptyVariableArray, pos, t, dt);
94}

References MaterialPropertyLib::EmptyVariableArray, property_used, and value().

◆ value() [4/6]

template<typename T>
T MaterialPropertyLib::Property::value ( VariableArray const & variable_array,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
inline

Definition at line 184 of file MaterialLib/MPL/Property.h.

187 {
188 try
189 {
190#ifndef NDEBUG
191 property_used = true;
192#endif
193 return std::get<T>(value(variable_array, pos, t, dt));
194 }
195 catch (std::bad_variant_access const&)
196 {
197 OGS_FATAL(
198 "The value of {:s} is not of the requested type '{:s}' but a "
199 "{:s}.",
200 description(),
202 property_data_type_names_[value(variable_array, pos, t, dt)
203 .index()]);
204 }
205 }

References description(), OGS_FATAL, property_data_type_names_, property_used, BaseLib::typeToString(), and value().

◆ value() [5/6]

PropertyDataType MaterialPropertyLib::Property::value ( VariableArray const & variable_array,
VariableArray const & variable_array_prev,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
virtual

This virtual method will compute the property value based on the variables that are passed as arguments and the variables from the previous time step.

Reimplemented in MaterialPropertyLib::LinearSaturationSwellingStress, MaterialPropertyLib::Parameter, MaterialPropertyLib::PorosityFromMassBalance, MaterialPropertyLib::SaturationDependentSwelling, and MaterialPropertyLib::TransportPorosityFromMassBalance.

Definition at line 75 of file MaterialLib/MPL/Property.cpp.

79{
80#ifndef NDEBUG
81 property_used = true;
82#endif
83 return value_;
84}

References property_used, and value_.

◆ value() [6/6]

template<typename T>
T MaterialPropertyLib::Property::value ( VariableArray const & variable_array,
VariableArray const & variable_array_prev,
ParameterLib::SpatialPosition const & pos,
double const t,
double const dt ) const
inline

Definition at line 158 of file MaterialLib/MPL/Property.h.

162 {
163 try
164 {
165#ifndef NDEBUG
166 property_used = true;
167#endif
168 return std::get<T>(
169 value(variable_array, variable_array_prev, pos, t, dt));
170 }
171 catch (std::bad_variant_access const&)
172 {
173 OGS_FATAL(
174 "The value of {:s} is not of the requested type '{:s}' but a "
175 "{:s}.",
176 description(),
178 property_data_type_names_[value(variable_array,
179 variable_array_prev, pos, t, dt)
180 .index()]);
181 }
182 }

References description(), OGS_FATAL, property_data_type_names_, property_used, BaseLib::typeToString(), and value().

Member Data Documentation

◆ dvalue_

PropertyDataType MaterialPropertyLib::Property::dvalue_
protected

Definition at line 286 of file MaterialLib/MPL/Property.h.

Referenced by MaterialPropertyLib::Constant::Constant(), and dValue().

◆ name_

std::string MaterialPropertyLib::Property::name_
protected

Definition at line 283 of file MaterialLib/MPL/Property.h.

Referenced by MaterialPropertyLib::AverageMolarMass::AverageMolarMass(), MaterialPropertyLib::BishopsPowerLaw::BishopsPowerLaw(), MaterialPropertyLib::BishopsSaturationCutoff::BishopsSaturationCutoff(), MaterialPropertyLib::CapillaryPressureVanGenuchten::CapillaryPressureVanGenuchten(), MaterialPropertyLib::ClausiusClapeyron::ClausiusClapeyron(), MaterialPropertyLib::Constant::Constant(), MaterialPropertyLib::CubicLawPermeability::CubicLawPermeability(), MaterialPropertyLib::Curve::Curve(), MaterialPropertyLib::DupuitPermeability::DupuitPermeability(), MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >::EffectiveThermalConductivityPorosityMixing(), MaterialPropertyLib::EmbeddedFracturePermeability< DisplacementDim >::EmbeddedFracturePermeability(), MaterialPropertyLib::Exponential::Exponential(), MaterialPropertyLib::Function::Function(), MaterialPropertyLib::GasPressureDependentPermeability< DisplacementDim >::GasPressureDependentPermeability(), MaterialPropertyLib::IdealGasLaw::IdealGasLaw(), MaterialPropertyLib::IdealGasLawBinaryMixture::IdealGasLawBinaryMixture(), MaterialPropertyLib::Linear::Linear(), MaterialPropertyLib::LinearSaturationSwellingStress::LinearSaturationSwellingStress(), MaterialPropertyLib::LinearWaterVapourLatentHeat::LinearWaterVapourLatentHeat(), MaterialPropertyLib::LiquidViscosityVogels< VogelsConstants >::LiquidViscosityVogels(), MaterialPropertyLib::OrthotropicEmbeddedFracturePermeability< DisplacementDim >::OrthotropicEmbeddedFracturePermeability(), MaterialPropertyLib::Parameter::Parameter(), MaterialPropertyLib::PermeabilityMohrCoulombFailureIndexModel< DisplacementDim >::PermeabilityMohrCoulombFailureIndexModel(), MaterialPropertyLib::PermeabilityOrthotropicPowerLaw< DisplacementDim >::PermeabilityOrthotropicPowerLaw(), MaterialPropertyLib::PorosityFromMassBalance::PorosityFromMassBalance(), MaterialPropertyLib::RelPermBrooksCorey::RelPermBrooksCorey(), MaterialPropertyLib::RelPermBrooksCoreyNonwettingPhase::RelPermBrooksCoreyNonwettingPhase(), MaterialPropertyLib::RelPermGeneralizedPower::RelPermGeneralizedPower(), MaterialPropertyLib::RelPermGeneralizedPowerNonwettingPhase::RelPermGeneralizedPowerNonwettingPhase(), MaterialPropertyLib::RelPermLiakopoulos::RelPermLiakopoulos(), MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem::RelPermNonWettingPhaseVanGenuchtenMualem(), MaterialPropertyLib::RelPermUdell::RelPermUdell(), MaterialPropertyLib::RelPermUdellNonwettingPhase::RelPermUdellNonwettingPhase(), MaterialPropertyLib::RelPermVanGenuchten::RelPermVanGenuchten(), MaterialPropertyLib::SaturationBrooksCorey::SaturationBrooksCorey(), MaterialPropertyLib::SaturationDependentSwelling::SaturationDependentSwelling(), MaterialPropertyLib::SaturationExponential::SaturationExponential(), MaterialPropertyLib::SaturationLiakopoulos::SaturationLiakopoulos(), MaterialPropertyLib::SaturationVanGenuchten::SaturationVanGenuchten(), MaterialPropertyLib::SaturationVanGenuchtenWithVolumetricStrain::SaturationVanGenuchtenWithVolumetricStrain(), MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension >::SaturationWeightedThermalConductivity(), MaterialPropertyLib::SpecificHeatCapacityWithLatentHeat::SpecificHeatCapacityWithLatentHeat(), MaterialPropertyLib::StrainDependentPermeability< DisplacementDim >::StrainDependentPermeability(), MaterialPropertyLib::TemperatureDependentFraction::TemperatureDependentFraction(), MaterialPropertyLib::TransportPorosityFromMassBalance::TransportPorosityFromMassBalance(), MaterialPropertyLib::VapourDiffusionDeVries::VapourDiffusionDeVries(), MaterialPropertyLib::VapourDiffusionFEBEX::VapourDiffusionFEBEX(), MaterialPropertyLib::VapourDiffusionPMQ::VapourDiffusionPMQ(), MaterialPropertyLib::VolumeFractionAverage::VolumeFractionAverage(), MaterialPropertyLib::WaterDensityIAPWSIF97Region1::WaterDensityIAPWSIF97Region1(), MaterialPropertyLib::WaterEnthalpyIAPWSIF97Region1::WaterEnthalpyIAPWSIF97Region1(), MaterialPropertyLib::WaterLiquidDensityIAPWSIF97Region4::WaterLiquidDensityIAPWSIF97Region4(), MaterialPropertyLib::WaterLiquidEnthalpyIAPWSIF97Region4::WaterLiquidEnthalpyIAPWSIF97Region4(), MaterialPropertyLib::WaterSaturationTemperatureIAPWSIF97Region4::WaterSaturationTemperatureIAPWSIF97Region4(), MaterialPropertyLib::WaterTemperatureIAPWSIF97Region1::WaterTemperatureIAPWSIF97Region1(), MaterialPropertyLib::WaterThermalConductivityIAPWS::WaterThermalConductivityIAPWS(), MaterialPropertyLib::WaterVapourDensity::WaterVapourDensity(), MaterialPropertyLib::WaterVapourDensityIAPWSIF97Region4::WaterVapourDensityIAPWSIF97Region4(), MaterialPropertyLib::WaterVapourEnthalpyIAPWSIF97Region4::WaterVapourEnthalpyIAPWSIF97Region4(), MaterialPropertyLib::WaterVapourLatentHeatWithCriticalTemperature::WaterVapourLatentHeatWithCriticalTemperature(), MaterialPropertyLib::WaterViscosityIAPWS::WaterViscosityIAPWS(), description(), MaterialPropertyLib::Function::dValue(), and MaterialPropertyLib::Function::value().

◆ property_data_type_names_

std::array MaterialPropertyLib::Property::property_data_type_names_
staticconstexprprivate
Initial value:
= {
"scalar", "2-vector", "3-vector",
"2x2-matrix", "3x3-matrix", "2D-Kelvin vector",
"3D-Kelvin vector", "dynamic matrix type"}

Corresponds to the PropertyDataType.

Definition at line 305 of file MaterialLib/MPL/Property.h.

305 {
306 "scalar", "2-vector", "3-vector",
307 "2x2-matrix", "3x3-matrix", "2D-Kelvin vector",
308 "3D-Kelvin vector", "dynamic matrix type"};

Referenced by d2Value(), dValue(), dValue(), initialValue(), value(), value(), and value().

◆ property_used

bool MaterialPropertyLib::Property::property_used = false
mutableprivate

Definition at line 300 of file MaterialLib/MPL/Property.h.

Referenced by ~Property(), d2Value(), d2Value(), dValue(), dValue(), value(), value(), and value().

◆ scale_

std::variant<Medium*, Phase*, Component*> MaterialPropertyLib::Property::scale_
protected

Definition scale of the property. Can be one of medium, phase, or component in general. Set through setScale method which takes care of the correctness in special cases.

Definition at line 290 of file MaterialLib/MPL/Property.h.

Referenced by MaterialPropertyLib::AverageMolarMass::checkScale(), MaterialPropertyLib::BishopsPowerLaw::checkScale(), MaterialPropertyLib::BishopsSaturationCutoff::checkScale(), MaterialPropertyLib::CapillaryPressureRegularizedVanGenuchten::checkScale(), MaterialPropertyLib::CapillaryPressureVanGenuchten::checkScale(), MaterialPropertyLib::ClausiusClapeyron::checkScale(), MaterialPropertyLib::CubicLawPermeability::checkScale(), MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >::checkScale(), MaterialPropertyLib::EmbeddedFracturePermeability< DisplacementDim >::checkScale(), MaterialPropertyLib::GasPressureDependentPermeability< DisplacementDim >::checkScale(), MaterialPropertyLib::IdealGasLaw::checkScale(), MaterialPropertyLib::IdealGasLawBinaryMixture::checkScale(), MaterialPropertyLib::LinearSaturationSwellingStress::checkScale(), MaterialPropertyLib::LinearWaterVapourLatentHeat::checkScale(), MaterialPropertyLib::LiquidViscosityVogels< VogelsConstants >::checkScale(), MaterialPropertyLib::OrthotropicEmbeddedFracturePermeability< DisplacementDim >::checkScale(), MaterialPropertyLib::PermeabilityMohrCoulombFailureIndexModel< DisplacementDim >::checkScale(), MaterialPropertyLib::PermeabilityOrthotropicPowerLaw< DisplacementDim >::checkScale(), MaterialPropertyLib::PorosityFromMassBalance::checkScale(), MaterialPropertyLib::RelPermBrooksCorey::checkScale(), MaterialPropertyLib::RelPermBrooksCoreyNonwettingPhase::checkScale(), MaterialPropertyLib::RelPermGeneralizedPower::checkScale(), MaterialPropertyLib::RelPermGeneralizedPowerNonwettingPhase::checkScale(), MaterialPropertyLib::RelPermLiakopoulos::checkScale(), MaterialPropertyLib::RelPermNonWettingPhaseVanGenuchtenMualem::checkScale(), MaterialPropertyLib::RelPermUdell::checkScale(), MaterialPropertyLib::RelPermUdellNonwettingPhase::checkScale(), MaterialPropertyLib::RelPermVanGenuchten::checkScale(), MaterialPropertyLib::SaturationBrooksCorey::checkScale(), MaterialPropertyLib::SaturationDependentSwelling::checkScale(), MaterialPropertyLib::SaturationExponential::checkScale(), MaterialPropertyLib::SaturationLiakopoulos::checkScale(), MaterialPropertyLib::SaturationVanGenuchten::checkScale(), MaterialPropertyLib::SaturationVanGenuchtenWithVolumetricStrain::checkScale(), MaterialPropertyLib::SaturationWeightedThermalConductivity< MeantType, GlobalDimension >::checkScale(), MaterialPropertyLib::SpecificHeatCapacityWithLatentHeat::checkScale(), MaterialPropertyLib::StrainDependentPermeability< DisplacementDim >::checkScale(), MaterialPropertyLib::TemperatureDependentDiffusion::checkScale(), MaterialPropertyLib::TemperatureDependentFraction::checkScale(), MaterialPropertyLib::TransportPorosityFromMassBalance::checkScale(), MaterialPropertyLib::VapourDiffusionDeVries::checkScale(), MaterialPropertyLib::VapourDiffusionFEBEX::checkScale(), MaterialPropertyLib::VapourDiffusionPMQ::checkScale(), MaterialPropertyLib::VolumeFractionAverage::checkScale(), MaterialPropertyLib::WaterDensityIAPWSIF97Region1::checkScale(), MaterialPropertyLib::WaterEnthalpyIAPWSIF97Region1::checkScale(), MaterialPropertyLib::WaterLiquidDensityIAPWSIF97Region4::checkScale(), MaterialPropertyLib::WaterLiquidEnthalpyIAPWSIF97Region4::checkScale(), MaterialPropertyLib::WaterSaturationTemperatureIAPWSIF97Region4::checkScale(), MaterialPropertyLib::WaterTemperatureIAPWSIF97Region1::checkScale(), MaterialPropertyLib::WaterThermalConductivityIAPWS::checkScale(), MaterialPropertyLib::WaterVapourDensity::checkScale(), MaterialPropertyLib::WaterVapourDensityIAPWSIF97Region4::checkScale(), MaterialPropertyLib::WaterVapourEnthalpyIAPWSIF97Region4::checkScale(), MaterialPropertyLib::WaterVapourLatentHeatWithCriticalTemperature::checkScale(), MaterialPropertyLib::WaterViscosityIAPWS::checkScale(), MaterialPropertyLib::TemperatureDependentFraction::d2Value(), description(), MaterialPropertyLib::AverageMolarMass::dValue(), MaterialPropertyLib::ClausiusClapeyron::dValue(), MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >::dValue(), MaterialPropertyLib::RelPermBrooksCorey::dValue(), MaterialPropertyLib::RelPermBrooksCoreyNonwettingPhase::dValue(), MaterialPropertyLib::RelPermLiakopoulos::dValue(), MaterialPropertyLib::SpecificHeatCapacityWithLatentHeat::dValue(), MaterialPropertyLib::TemperatureDependentFraction::dValue(), MaterialPropertyLib::VolumeFractionAverage::dValue(), MaterialPropertyLib::SpecificHeatCapacityWithLatentHeat::effectiveVolumetricHeatCapacity(), setScale(), MaterialPropertyLib::AverageMolarMass::value(), MaterialPropertyLib::ClausiusClapeyron::value(), MaterialPropertyLib::EffectiveThermalConductivityPorosityMixing< GlobalDim >::value(), MaterialPropertyLib::PermeabilityOrthotropicPowerLaw< DisplacementDim >::value(), MaterialPropertyLib::PorosityFromMassBalance::value(), MaterialPropertyLib::RelPermBrooksCorey::value(), MaterialPropertyLib::RelPermBrooksCoreyNonwettingPhase::value(), MaterialPropertyLib::RelPermLiakopoulos::value(), MaterialPropertyLib::SpecificHeatCapacityWithLatentHeat::value(), MaterialPropertyLib::TemperatureDependentFraction::value(), MaterialPropertyLib::TransportPorosityFromMassBalance::value(), and MaterialPropertyLib::VolumeFractionAverage::value().

◆ value_


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