OGS
CreatePermeabilityMohrCoulombFailureIndexModel.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
5
6#include <string>
7
9#include "Parameter.h"
12#include "ParameterLib/Utils.h"
14
15namespace MaterialPropertyLib
16{
18 int const geometry_dimension,
19 BaseLib::ConfigTree const& config,
20 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
21 ParameterLib::CoordinateSystem const* const local_coordinate_system)
22{
23 if ((geometry_dimension != 2) && (geometry_dimension != 3))
24 {
26 "The PermeabilityMohrCoulombFailureIndexModel is implemented only "
27 "for 2D or 3D problems");
28 }
29
31 config.checkConfigParameter("type",
32 "PermeabilityMohrCoulombFailureIndexModel");
33
34 // Second access for storage.
36 auto property_name = config.peekConfigParameter<std::string>("name");
37
38 DBUG("Create PermeabilityMohrCoulombFailureIndexModel property {:s}.",
39 property_name);
40
41 std::string const& parameter_name =
43 config.getConfigParameter<std::string>("initial_permeability");
44 auto const& parameter_k0 = ParameterLib::findParameter<double>(
45 parameter_name, parameters, 0, nullptr);
46
47 auto const kr =
49 config.getConfigParameter<double>("reference_permeability");
50 auto const b =
52 config.getConfigParameter<double>("fitting_factor");
53 auto const c =
55 config.getConfigParameter<double>("cohesion");
56 auto const phi =
58 config.getConfigParameter<double>("friction_angle");
59 auto const max_k =
61 config.getConfigParameter<double>("maximum_permeability");
62 auto const t_sigma_max =
64 config.getConfigParameter<double>("tensile_strength_parameter");
65
66 if (geometry_dimension == 2)
67 {
68 return std::make_unique<PermeabilityMohrCoulombFailureIndexModel<2>>(
69 std::move(property_name), parameter_k0, kr, b, c, phi, max_k,
70 t_sigma_max, local_coordinate_system);
71 }
72
73 return std::make_unique<PermeabilityMohrCoulombFailureIndexModel<3>>(
74 std::move(property_name), parameter_k0, kr, b, c, phi, max_k,
75 t_sigma_max, local_coordinate_system);
76}
77} // namespace MaterialPropertyLib
#define OGS_FATAL(...)
Definition Error.h:19
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
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)
A local coordinate system used for tensor transformations.