28 int const geometry_dimension,
30 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
33 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
const&
41 if (phase_type.empty())
43 OGS_FATAL(
"Phase type is a mandatory field and cannot be empty.");
46 std::array<std::string, 5>
const allowed_phase_types = {
47 {
"Solid",
"FrozenLiquid",
"AqueousLiquid",
"NonAqueousLiquid",
"Gas"}};
49 if (std::none_of(allowed_phase_types.begin(),
50 allowed_phase_types.end(),
51 [&phase_type](std::string
const& type)
52 { return phase_type == type; }))
54 ERR(
"Phase type should be one of:");
55 for (
auto const& type : allowed_phase_types)
59 OGS_FATAL(
"Wrong phase type '{:s}' given.", phase_type);
63 auto components = createComponents(
67 local_coordinate_system, curves);
70 auto properties = createProperties(
74 local_coordinate_system, curves);
76 if (components.empty() && !properties)
79 "Neither tag <components> nor tag <properties> has been set for "
84 return std::make_unique<Phase>(std::move(phase_type), std::move(components),
85 std::move(properties));