OGS
CreatePermeabilityMohrCoulombFailureIndexModel.cpp
Go to the documentation of this file.
1
13
14#include <string>
15
16#include "BaseLib/ConfigTree.h"
17#include "Parameter.h"
20#include "ParameterLib/Utils.h"
22
23namespace MaterialPropertyLib
24{
26 int const geometry_dimension,
27 BaseLib::ConfigTree const& config,
28 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
29 ParameterLib::CoordinateSystem const* const local_coordinate_system)
30{
31 if ((geometry_dimension != 2) && (geometry_dimension != 3))
32 {
34 "The PermeabilityMohrCoulombFailureIndexModel is implemented only "
35 "for 2D or 3D problems");
36 }
37
39 config.checkConfigParameter("type",
40 "PermeabilityMohrCoulombFailureIndexModel");
41
42 // Second access for storage.
44 auto property_name = config.peekConfigParameter<std::string>("name");
45
46 DBUG("Create PermeabilityMohrCoulombFailureIndexModel property {:s}.",
47 property_name);
48
49 std::string const& parameter_name =
51 config.getConfigParameter<std::string>("initial_permeability");
52 auto const& parameter_k0 = ParameterLib::findParameter<double>(
53 parameter_name, parameters, 0, nullptr);
54
55 auto const kr =
57 config.getConfigParameter<double>("reference_permeability");
58 auto const b =
60 config.getConfigParameter<double>("fitting_factor");
61 auto const c =
63 config.getConfigParameter<double>("cohesion");
64 auto const phi =
66 config.getConfigParameter<double>("friction_angle");
67 auto const max_k =
69 config.getConfigParameter<double>("maximum_permeability");
70 auto const t_sigma_max =
72 config.getConfigParameter<double>("tensile_strength_parameter");
73
74 if (geometry_dimension == 2)
75 {
76 return std::make_unique<PermeabilityMohrCoulombFailureIndexModel<2>>(
77 std::move(property_name), parameter_k0, kr, b, c, phi, max_k,
78 t_sigma_max, local_coordinate_system);
79 }
80
81 return std::make_unique<PermeabilityMohrCoulombFailureIndexModel<3>>(
82 std::move(property_name), parameter_k0, kr, b, c, phi, max_k,
83 t_sigma_max, local_coordinate_system);
84}
85} // 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 > createPermeabilityMohrCoulombFailureIndexModel(int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system)
OGS_NO_DANGLING Parameter< ParameterDataType > & findParameter(std::string const &parameter_name, std::vector< std::unique_ptr< ParameterBase > > const &parameters, int const num_components, MeshLib::Mesh const *const mesh=nullptr)
Definition Utils.h:102
A local coordinate system used for tensor transformations.