21 std::unique_ptr<PropertyArray>&& properties)
22 : phases_(std::move(phases))
39 [&phase_name](std::unique_ptr<MaterialPropertyLib::Phase>
const&
phase)
40 { return phase->name == phase_name; },
41 "Could not find phase name '" + phase_name +
"'.");
47 [&phase_name](
auto const&
phase)
56 OGS_FATAL(
"Trying to access undefined property '{:s}' of {:s}",
86 return medium.
phase(
"Gas");
88 if (medium.
hasPhase(
"AqueousLiquid"))
90 return medium.
phase(
"AqueousLiquid");
93 "Neither Gas nor AqueousLiquid phase is available for the medium, but "
94 "a fluid phase was requested.");
std::size_t numberOfPhases() const
Phase const & phase(std::size_t index) const
Medium(std::vector< std::unique_ptr< Phase >> &&phases, std::unique_ptr< PropertyArray > &&properties)
std::vector< std::unique_ptr< Phase > > const phases_
The vector that holds the phases.
bool hasPhase(std::string const &phase_name) const
A query for a named phase.
PropertyArray properties_
Property const & property(PropertyType const &p) const
bool hasProperty(PropertyType const &p) const
static std::string description()
Short description of the medium.
Property const & operator[](PropertyType const &p) const
std::iterator_traits< InputIt >::reference findElementOrError(InputIt begin, InputIt end, Predicate predicate, std::string const &error="")
void overwriteExistingProperties(PropertyArray &properties, PropertyArray &new_properties, std::variant< Medium *, Phase *, Component * > scale_pointer)
static const std::array< std::string, PropertyType::number_of_properties > property_enum_to_string
Phase const & fluidPhase(Medium const &medium)
Returns a gas or aqueous liquid phase of the given medium.