28 int const geometry_dimension,
30 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>& 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 = {
56 if (std::none_of(allowed_phase_types.begin(),
57 allowed_phase_types.end(),
58 [&phase_type](std::string
const& type)
59 { return phase_type == type; }))
61 ERR(
"Phase type should be one of:");
62 for (
auto const& type : allowed_phase_types)
66 OGS_FATAL(
"Wrong phase type '{:s}' given.", phase_type);
74 local_coordinate_system, curves);
81 local_coordinate_system, curves);
83 if (components.empty() && !properties)
86 "Neither tag <components> nor tag <properties> has been set for "
91 return std::make_unique<Phase>(std::move(phase_type), std::move(components),
92 std::move(properties));
99 int const geometry_dimension,
100 std::optional<BaseLib::ConfigTree>
const& config,
101 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>& parameters,
103 std::map<std::string,
104 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
const&
112 std::vector<std::unique_ptr<Phase>> phases;
114 for (
auto phase_config :
116 config->getConfigSubtreeList(
"phase"))
118 auto phase = createPhase(geometry_dimension, phase_config, parameters,
119 local_coordinate_system, curves);
121 if (std::find_if(phases.begin(),
123 [phase_name = phase->name](
auto const& p)
124 { return p->name == phase_name; }) != phases.end())
126 OGS_FATAL(
"Found duplicates with the same phase name tag '{:s}'.",
130 phases.push_back(std::move(phase));
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the PiecewiseLinearInterpolation class.
std::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) const
T getConfigParameter(std::string const ¶m) const
std::vector< std::unique_ptr< Component > > createComponents(int const geometry_dimension, std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > ¶meters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
std::unique_ptr< PropertyArray > createProperties(int const geometry_dimension, std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > ¶meters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
std::vector< std::unique_ptr< Phase > > createPhases(int const geometry_dimension, std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > ¶meters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
std::unique_ptr< MaterialPropertyLib::Phase > createPhase(int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > ¶meters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
A local coordinate system used for tensor transformations.