19 int const geometry_dimension,
21 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>& parameters,
24 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
const&
32 if (phase_type.empty())
34 OGS_FATAL(
"Phase type is a mandatory field and cannot be empty.");
37 std::array<std::string, 5>
const allowed_phase_types = {
47 if (std::none_of(allowed_phase_types.begin(),
48 allowed_phase_types.end(),
49 [&phase_type](std::string
const& type)
50 { return phase_type == type; }))
52 ERR(
"Phase type should be one of:");
53 for (
auto const& type : allowed_phase_types)
57 OGS_FATAL(
"Wrong phase type '{:s}' given.", phase_type);
65 local_coordinate_system, curves);
72 local_coordinate_system, curves);
74 if (components.empty() && !properties)
77 "Neither tag <components> nor tag <properties> has been set for "
82 return std::make_unique<Phase>(std::move(phase_type), std::move(components),
83 std::move(properties));
90 int const geometry_dimension,
91 std::optional<BaseLib::ConfigTree>
const& config,
92 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>& parameters,
95 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
const&
103 std::vector<std::unique_ptr<Phase>> phases;
105 for (
auto phase_config :
107 config->getConfigSubtreeList(
"phase"))
109 auto phase = createPhase(geometry_dimension, phase_config, parameters,
110 local_coordinate_system, curves);
112 if (std::find_if(phases.begin(),
114 [phase_name = phase->name](
auto const& p)
115 { return p->name == phase_name; }) != phases.end())
117 OGS_FATAL(
"Found duplicates with the same phase name tag '{:s}'.",
121 phases.push_back(std::move(phase));
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
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.