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;
34 auto elastic_data =
36 parameters, config, skip_type_checking);
37
40 config, "a", parameters, 1);
41
44 config, "n", parameters, 1);
45
48 config, "sigma0", parameters, 1);
49
52 config, "q", parameters, 1);
53
54 auto const& nonlinear_solver_config =
56 config.getConfigSubtree("nonlinear_solver");
57 auto const nonlinear_solver_parameters =
58 NumLib::createNewtonRaphsonSolverParameters(nonlinear_solver_config);
59
60 return std::unique_ptr<CreepBGRa<DisplacementDim>>{
61 new CreepBGRa<DisplacementDim>{elastic_data->getMaterialProperties(),
62 nonlinear_solver_parameters, A, n,
63 sigma0, Q}};
64}
65
66template std::unique_ptr<MaterialLib::Solids::MechanicsBase<2>>
68 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
69 BaseLib::ConfigTree const& config);
70
71template std::unique_ptr<MaterialLib::Solids::MechanicsBase<3>>
73 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
74 BaseLib::ConfigTree const& config);
75} // namespace Creep
76} // namespace Solids
77} // 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)