OGS
CreateStrainDependentPermeability.cpp
Go to the documentation of this file.
1
13
14#include <string>
15
16#include "BaseLib/ConfigTree.h"
17#include "BaseLib/Error.h"
18#include "Parameter.h"
21#include "ParameterLib/Utils.h"
23
24namespace MaterialPropertyLib
25{
26std::unique_ptr<Property> createStrainDependentPermeability(
27 int const geometry_dimension,
28 BaseLib::ConfigTree const& config,
29 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
30 ParameterLib::CoordinateSystem const* const local_coordinate_system)
31{
32 if ((geometry_dimension != 2) && (geometry_dimension != 3))
33 {
35 "The StrainDependentPermeability is implemented only for 2D or 3D "
36 "problems");
37 }
38
40 config.checkConfigParameter("type", "StrainDependentPermeability");
41
42 // Second access for storage.
44 auto property_name = config.peekConfigParameter<std::string>("name");
45
46 DBUG("Create StrainDependentPermeability property {:s}.", property_name);
47
48 std::string const& parameter_name =
50 config.getConfigParameter<std::string>("initial_permeability");
51 auto const& parameter_k0 = ParameterLib::findParameter<double>(
52 parameter_name, parameters, 0, nullptr);
53
54 auto const b1 =
56 config.getConfigParameter<double>("b1");
57 auto const b2 =
59 config.getConfigParameter<double>("b2");
60 auto const b3 =
62 config.getConfigParameter<double>("b3");
63 auto const minimum_permeability =
65 config.getConfigParameter<double>("minimum_permeability");
66 auto const maximum_permeability =
68 config.getConfigParameter<double>("maximum_permeability");
69
70 if (minimum_permeability > maximum_permeability)
71 {
73 "The value of minimum_permeability of {:e} is larger that the "
74 "value of maximum_permeability of {:e} in "
75 "StrainDependentPermeability",
76 minimum_permeability, maximum_permeability);
77 }
78
79 if (geometry_dimension == 2)
80 {
81 return std::make_unique<StrainDependentPermeability<2>>(
82 std::move(property_name), parameter_k0, b1, b2, b3,
83 minimum_permeability, maximum_permeability,
84 local_coordinate_system);
85 }
86
87 return std::make_unique<StrainDependentPermeability<3>>(
88 std::move(property_name), parameter_k0, b1, b2, b3,
89 minimum_permeability, maximum_permeability, local_coordinate_system);
90}
91} // 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< Property > createStrainDependentPermeability(int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system)
A local coordinate system used for tensor transformations.