OGS
CreateCoulomb.cpp
Go to the documentation of this file.
1
10#include "CreateCoulomb.h"
11
12#include "Coulomb.h"
14#include "ParameterLib/Utils.h"
15
16namespace MaterialLib
17{
18namespace Fracture
19{
20template <int DisplacementDim>
21std::unique_ptr<FractureModelBase<DisplacementDim>> createCoulomb(
22 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
23 BaseLib::ConfigTree const& config)
24{
26 config.checkConfigParameter("type", "Coulomb");
27 DBUG("Create Coulomb material");
28
31 config, "normal_stiffness", parameters, 1);
32
35 config, "shear_stiffness", parameters, 1);
36
37 auto& friction_angle = ParameterLib::findParameter<double>(
39 config, "friction_angle", parameters, 1);
40
41 auto& dilatancy_angle = ParameterLib::findParameter<double>(
43 config, "dilatancy_angle", parameters, 1);
44
47 config, "cohesion", parameters, 1);
48
49 auto const penalty_aperture_cutoff =
51 config.getConfigParameter<double>("penalty_aperture_cutoff");
52
53 auto const tension_cutoff =
55 config.getConfigParameter<bool>("tension_cutoff");
56
58 Kn, Ks, friction_angle, dilatancy_angle, cohesion};
59
60 auto const& nonlinear_solver_config =
62 config.getConfigSubtree("nonlinear_solver");
63 auto const nonlinear_solver_parameters =
64 NumLib::createNewtonRaphsonSolverParameters(nonlinear_solver_config);
65
66 return std::make_unique<Coulomb::Coulomb<DisplacementDim>>(
67 nonlinear_solver_parameters, penalty_aperture_cutoff, tension_cutoff,
68 mp);
69}
70
71template std::unique_ptr<FractureModelBase<2>> createCoulomb(
72 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
73 BaseLib::ConfigTree const& config);
74
75template std::unique_ptr<FractureModelBase<3>> createCoulomb(
76 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
77 BaseLib::ConfigTree const& config);
78
79} // namespace Fracture
80} // namespace MaterialLib
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
T getConfigParameter(std::string const &param) const
ConfigTree getConfigSubtree(std::string const &root) const
void checkConfigParameter(std::string const &param, std::string_view const value) const
std::unique_ptr< FractureModelBase< DisplacementDim > > createCoulomb(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, BaseLib::ConfigTree const &config)
NewtonRaphsonSolverParameters createNewtonRaphsonSolverParameters(BaseLib::ConfigTree const &config)
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
Variables specific to the material model.
Definition Coulomb.h:58