OGS 6.2.2-330-gf48c72f61.dirty.20200225212913
MaterialPropertyLib::Component Class Reference

Detailed Description

This class defines components (substances).

The Component class is a base class used for not further specified components. Components are specified by the property 'name'. For specified components we derive special classes from this class (for clarity they are located in the 'components' subfolder).

Definition at line 23 of file Component.h.

#include <Component.h>

Inheritance diagram for MaterialPropertyLib::Component:

Public Member Functions

 Component ()
 
 Component (std::string const &component_name, std::unique_ptr< PropertyArray > &&properties)
 Constructor for a custom component. More...
 
virtual ~Component ()=default
 
Property const & property (PropertyType const &) const
 A get-function for retrieving a certain property. More...
 
bool hasProperty (PropertyType const &p) const
 
template<typename T >
value (PropertyType const p) const
 
template<typename T >
value (PropertyType const p, VariableArray const &variable_array) const
 
template<typename T >
dValue (PropertyType const p, VariableArray const &variable_array, Variable const variable) const
 
template<typename T >
d2Value (PropertyType const p, VariableArray const &variable_array, Variable const variable1, Variable const variable2) const
 

Public Attributes

std::string const name
 

Protected Attributes

PropertyArray _properties
 The property array of the component. More...
 

Constructor & Destructor Documentation

◆ Component() [1/2]

MaterialPropertyLib::Component::Component ( )

Default constructor of Component. This constructor is used when the component is not specified via the 'name'-tag.

Definition at line 19 of file Component.cpp.

20 {
21 }

◆ Component() [2/2]

MaterialPropertyLib::Component::Component ( std::string const &  component_name,
std::unique_ptr< PropertyArray > &&  properties 
)

Constructor for a custom component.

Definition at line 23 of file Component.cpp.

References _properties, and MaterialPropertyLib::overwriteExistingProperties().

25  : name(component_name)
26 {
27  if (properties)
28  {
29  overwriteExistingProperties(_properties, *properties, this);
30  }
31 }
void overwriteExistingProperties(PropertyArray &properties, PropertyArray &new_properties, std::variant< Medium *, Phase *, Component *> scale_pointer)
Definition: Property.h:121
PropertyArray _properties
The property array of the component.
Definition: Component.h:74
std::string const name
Definition: Component.h:70

◆ ~Component()

virtual MaterialPropertyLib::Component::~Component ( )
virtualdefault

Member Function Documentation

◆ d2Value()

template<typename T >
T MaterialPropertyLib::Component::d2Value ( PropertyType const  p,
VariableArray const &  variable_array,
Variable const  variable1,
Variable const  variable2 
) const
inline

Definition at line 60 of file Component.h.

References property().

64  {
65  return property(p).template d2Value<T>(variable_array, variable1,
66  variable2);
67  }
Property const & property(PropertyType const &) const
A get-function for retrieving a certain property.
Definition: Component.cpp:33
static const double p

◆ dValue()

template<typename T >
T MaterialPropertyLib::Component::dValue ( PropertyType const  p,
VariableArray const &  variable_array,
Variable const  variable 
) const
inline

Definition at line 52 of file Component.h.

References property().

55  {
56  return property(p).template dValue<T>(variable_array, variable);
57  }
Property const & property(PropertyType const &) const
A get-function for retrieving a certain property.
Definition: Component.cpp:33
static const double p

◆ hasProperty()

bool MaterialPropertyLib::Component::hasProperty ( PropertyType const &  p) const

Definition at line 38 of file Component.cpp.

References _properties.

Referenced by MaterialPropertyLib::checkRequiredProperties().

39 {
40  return _properties[p] != nullptr;
41 }
static const double p
PropertyArray _properties
The property array of the component.
Definition: Component.h:74

◆ property()

Property const & MaterialPropertyLib::Component::property ( PropertyType const &  p) const

A get-function for retrieving a certain property.

Definition at line 33 of file Component.cpp.

References _properties.

Referenced by d2Value(), dValue(), MaterialPropertyLib::molarMass(), and value().

34 {
35  return *_properties[p];
36 }
static const double p
PropertyArray _properties
The property array of the component.
Definition: Component.h:74

◆ value() [1/2]

template<typename T >
T MaterialPropertyLib::Component::value ( PropertyType const  p) const
inline

Definition at line 40 of file Component.h.

References property().

41  {
42  return property(p).template value<T>();
43  }
Property const & property(PropertyType const &) const
A get-function for retrieving a certain property.
Definition: Component.cpp:33
static const double p

◆ value() [2/2]

template<typename T >
T MaterialPropertyLib::Component::value ( PropertyType const  p,
VariableArray const &  variable_array 
) const
inline

Definition at line 46 of file Component.h.

References property().

47  {
48  return property(p).template value<T>(variable_array);
49  }
Property const & property(PropertyType const &) const
A get-function for retrieving a certain property.
Definition: Component.cpp:33
static const double p

Member Data Documentation

◆ _properties

PropertyArray MaterialPropertyLib::Component::_properties
protected

The property array of the component.

Definition at line 74 of file Component.h.

Referenced by Component(), hasProperty(), and property().

◆ name

std::string const MaterialPropertyLib::Component::name

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