32 Component(std::string
const& component_name,
33 std::unique_ptr<PropertyArray>&& properties);
46 return property(p).template value<T>();
52 return property(p).template value<T>(variable_array);
60 return property(p).template dValue<T>(variable_array, variable);
69 return property(p).template d2Value<T>(variable_array, variable1,
92 std::unique_ptr<Component>
newComponent(std::string
const& component_name,
93 bool& isCustomComponent);
95 template <
typename Container>
97 Container
const& required_properties)
99 for (
auto const& p : required_properties)
101 if (!
c.hasProperty(p))
103 OGS_FATAL(
"The property '{:s}' is missing in the component '{:s}'.",
This class defines components (substances).
T dValue(PropertyType const p, VariableArray const &variable_array, Variable const variable) const
Property const & property(PropertyType const &) const
A get-function for retrieving a certain property.
T d2Value(PropertyType const p, VariableArray const &variable_array, Variable const variable1, Variable const variable2) const
Property const & operator[](PropertyType const &p) const
T value(PropertyType const p) const
virtual ~Component()=default
T value(PropertyType const p, VariableArray const &variable_array) const
PropertyArray properties_
The property array of the component.
bool hasProperty(PropertyType const &p) const
std::string description() const
Short description of the component with its name.
std::array< std::unique_ptr< Property >, PropertyType::number_of_properties > PropertyArray
std::unique_ptr< Component > newComponent(std::string const &component_name, bool &isCustomComponent)
static const std::array< std::string, PropertyType::number_of_properties > property_enum_to_string
std::array< VariableType, static_cast< int >(Variable::number_of_variables)> VariableArray
void checkRequiredProperties(Component const &c, Container const &required_properties)