OGS
CreateLinearElasticOrthotropic.cpp
Go to the documentation of this file.
1
12#include "ParameterLib/Utils.h"
13
14namespace MaterialLib
15{
16namespace Solids
17{
18template <int DisplacementDim>
19std::unique_ptr<LinearElasticOrthotropic<DisplacementDim>>
21 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
22 std::optional<ParameterLib::CoordinateSystem> const&
23 local_coordinate_system,
24 BaseLib::ConfigTree const& config, const bool skip_type_checking)
25{
26 if (!skip_type_checking)
27 {
29 config.checkConfigParameter("type", "LinearElasticOrthotropic");
30 DBUG("Create LinearElasticOrthotropic material");
31 }
32
33 // The three Youngs moduli are required even in two-dimensional case. Same
34 // for the shear moduli and the Poissons ratios.
35 auto& youngs_moduli = ParameterLib::findParameter<double>(
37 config, "youngs_moduli", parameters, 3);
38 DBUG("Use '{:s}' as youngs_moduli parameter.", youngs_moduli.name);
39
40 // Shear moduli
41 auto& shear_moduli = ParameterLib::findParameter<double>(
43 config, "shear_moduli", parameters, 3);
44 DBUG("Use '{:s}' as shear_moduli parameter.", shear_moduli.name);
45
46 // Poissons ratios
47 auto& poissons_ratios = ParameterLib::findParameter<double>(
49 config, "poissons_ratios", parameters, 3);
50 DBUG("Use '{:s}' as poissons_ratios parameter.", poissons_ratios.name);
51
53 youngs_moduli, shear_moduli, poissons_ratios};
54
55 return std::make_unique<LinearElasticOrthotropic<DisplacementDim>>(
56 mp, local_coordinate_system);
57}
58
59template std::unique_ptr<LinearElasticOrthotropic<2>>
61 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
62 std::optional<ParameterLib::CoordinateSystem> const&
63 local_coordinate_system,
64 BaseLib::ConfigTree const& config, const bool skip_type_checking);
65
66template std::unique_ptr<LinearElasticOrthotropic<3>>
68 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
69 std::optional<ParameterLib::CoordinateSystem> const&
70 local_coordinate_system,
71 BaseLib::ConfigTree const& config, const bool skip_type_checking);
72} // namespace Solids
73} // 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< LinearElasticOrthotropic< DisplacementDim > > createLinearElasticOrthotropic(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, BaseLib::ConfigTree const &config, const bool skip_type_checking)