OGS
CreateLinearElasticIsotropic.h
Go to the documentation of this file.
1
11#pragma once
12
13#include "ParameterLib/Utils.h"
14
16
17namespace MaterialLib
18{
19namespace Solids
20{
21template <int DisplacementDim>
22std::unique_ptr<LinearElasticIsotropic<DisplacementDim>>
24 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
25 BaseLib::ConfigTree const& config, const bool skip_type_checking)
26{
27 if (!skip_type_checking)
28 {
30 config.checkConfigParameter("type", "LinearElasticIsotropic");
31 DBUG("Create LinearElasticIsotropic material");
32 }
33
34 // Youngs modulus
35 auto& youngs_modulus = ParameterLib::findParameter<double>(
37 config, "youngs_modulus", parameters, 1);
38
39 DBUG("Use '{:s}' as youngs_modulus parameter.", youngs_modulus.name);
40
41 // Poissons ratio
42 auto& poissons_ratio = ParameterLib::findParameter<double>(
44 config, "poissons_ratio", parameters, 1);
45
46 DBUG("Use '{:s}' as poissons_ratio parameter.", poissons_ratio.name);
47
49 youngs_modulus, poissons_ratio};
50
51 return std::make_unique<LinearElasticIsotropic<DisplacementDim>>(mp);
52}
53
54} // namespace Solids
55} // namespace MaterialLib
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
void checkConfigParameter(std::string const &param, std::string_view const value) const
std::unique_ptr< LinearElasticIsotropic< DisplacementDim > > createLinearElasticIsotropic(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, BaseLib::ConfigTree const &config, const bool skip_type_checking)
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