OGS
CreateCreepBGRa.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
4#include "CreateCreepBGRa.h"
5
8#include "CreepBGRa.h"
9#include "MechanicsBase.h"
12#include "ParameterLib/Utils.h"
13
14namespace MaterialLib
15{
16namespace Solids
17{
18namespace Creep
19{
20template <int DisplacementDim>
21std::unique_ptr<MaterialLib::Solids::MechanicsBase<DisplacementDim>>
23 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
24 BaseLib::ConfigTree const& config)
25{
27 config.checkConfigParameter("type", "CreepBGRa");
28 DBUG("Create CreepBGRa material");
29
30 // Read elastic data first.
31 const bool skip_type_checking = true;
32 auto elastic_data =
34 parameters, config, skip_type_checking);
35
38 config, "a", parameters, 1);
39
42 config, "n", parameters, 1);
43
46 config, "sigma0", parameters, 1);
47
50 config, "q", parameters, 1);
51
52 auto const& nonlinear_solver_config =
54 config.getConfigSubtree("nonlinear_solver");
55 auto const nonlinear_solver_parameters =
56 NumLib::createNewtonRaphsonSolverParameters(nonlinear_solver_config);
57
58 return std::unique_ptr<CreepBGRa<DisplacementDim>>{
59 new CreepBGRa<DisplacementDim>{elastic_data->getMaterialProperties(),
60 nonlinear_solver_parameters, A, n,
61 sigma0, Q}};
62}
63
64template std::unique_ptr<MaterialLib::Solids::MechanicsBase<2>>
66 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
67 BaseLib::ConfigTree const& config);
68
69template std::unique_ptr<MaterialLib::Solids::MechanicsBase<3>>
71 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
72 BaseLib::ConfigTree const& config);
73} // namespace Creep
74} // namespace Solids
75} // namespace MaterialLib
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
ConfigTree getConfigSubtree(std::string const &root) const
void checkConfigParameter(std::string const &param, std::string_view const value) const
A class for computing the BGRa creep model, which reads.
Definition CreepBGRa.h:32
template std::unique_ptr< MaterialLib::Solids::MechanicsBase< 2 > > createCreepBGRa< 2 >(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, BaseLib::ConfigTree const &config)
template std::unique_ptr< MaterialLib::Solids::MechanicsBase< 3 > > createCreepBGRa< 3 >(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, BaseLib::ConfigTree const &config)
std::unique_ptr< MaterialLib::Solids::MechanicsBase< DisplacementDim > > createCreepBGRa(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, BaseLib::ConfigTree const &config)
std::unique_ptr< LinearElasticIsotropic< DisplacementDim > > createLinearElasticIsotropic(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, BaseLib::ConfigTree const &config, const bool skip_type_checking)
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)