OGS
CreateSaturationDependentSwelling.cpp
Go to the documentation of this file.
1
10#include "BaseLib/ConfigTree.h"
13
14namespace MaterialPropertyLib
15{
16std::unique_ptr<SaturationDependentSwelling> createSaturationDependentSwelling(
17 BaseLib::ConfigTree const& config,
18 ParameterLib::CoordinateSystem const* const local_coordinate_system)
19{
21 config.checkConfigParameter("type", "SaturationDependentSwelling");
22
23 // Second access for storage.
25 auto property_name = config.peekConfigParameter<std::string>("name");
26
27 DBUG("Create SaturationDependentSwelling solid phase property {:s}.",
28 property_name);
29
30 auto const swelling_pressures =
32 config.getConfigParameter<std::vector<double>>("swelling_pressures");
33
34 if (swelling_pressures.size() != 3)
35 {
37 "The number of swelling pressures must be three, but {:d} were "
38 "given.",
39 swelling_pressures.size());
40 }
41
42 auto const exponents =
44 config.getConfigParameter<std::vector<double>>("exponents");
45
46 if (exponents.size() != 3)
47 {
48 OGS_FATAL("The number of exponents must be three, but {:d} were given.",
49 exponents.size());
50 }
51
52 if (swelling_pressures.size() != exponents.size())
53 {
55 "The number of swelling pressures and exponents must be equal, but "
56 "they are {:d} and {:d}, respectively.",
57 swelling_pressures.size(), exponents.size());
58 }
59
60 auto const lower_saturation_limit =
62 config.getConfigParameter<double>("lower_saturation_limit");
63
64 auto const upper_saturation_limit =
66 config.getConfigParameter<double>("upper_saturation_limit");
67
68 return std::make_unique<SaturationDependentSwelling>(
69 std::move(property_name),
70 std::array<double, 3>{swelling_pressures[0], swelling_pressures[1],
71 swelling_pressures[2]},
72 std::array<double, 3>{exponents[0], exponents[1], exponents[2]},
73 lower_saturation_limit, upper_saturation_limit,
74 local_coordinate_system);
75}
76} // namespace MaterialPropertyLib
#define OGS_FATAL(...)
Definition Error.h:26
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
T peekConfigParameter(std::string const &param) const
T getConfigParameter(std::string const &param) const
void checkConfigParameter(std::string const &param, std::string_view const value) const
std::unique_ptr< SaturationDependentSwelling > createSaturationDependentSwelling(BaseLib::ConfigTree const &config, ParameterLib::CoordinateSystem const *const local_coordinate_system)
A local coordinate system used for tensor transformations.