OGS
CreateLinearElasticTransverseIsotropic.cpp
Go to the documentation of this file.
1
13
14#include "ParameterLib/Utils.h"
15
16namespace MaterialLib
17{
18namespace Solids
19{
20template <int DisplacementDim>
21std::unique_ptr<LinearElasticTransverseIsotropic<DisplacementDim>>
23 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
24 std::optional<ParameterLib::CoordinateSystem> const&
25 local_coordinate_system,
26 BaseLib::ConfigTree const& config, const bool skip_type_checking)
27{
28 if (!skip_type_checking)
29 {
31 config.checkConfigParameter("type", "LinearElasticTransverseIsotropic");
32 DBUG("Create LinearElasticTransverseIsotropic material");
33 }
34
37 config, "youngs_modulus_i", parameters, 1);
38 DBUG("Use '{}' as the in-plane Young’s modulus, E_i.", E_i.name);
39
42 config, "youngs_modulus_a", parameters, 1);
43 DBUG(
44 "Use '{}' as the Young’s modulus w.r.t. the direction of anisotropy, "
45 "E_a.",
46 E_a.name);
47
48 auto const& nu_ii = ParameterLib::findParameter<double>(
50 config, "poissons_ratio_ii", parameters, 1);
51 DBUG("Use '{}' as the in-plane Poisson’s ratio, nu_ii.", nu_ii.name);
52
53 auto const& nu_ia = ParameterLib::findParameter<double>(
55 config, "poissons_ratio_ia", parameters, 1);
56 DBUG(
57 "Use '{}' as the Poisson ratio perpendicular to the plane of isotropy, "
58 "due to strain in the plane of isotropy, nu_ia.",
59 nu_ia.name);
60
61 auto const& G_ia = ParameterLib::findParameter<double>(
63 config, "shear_modulus_ia", parameters, 1);
64 DBUG(
65 "Use '{}' as the shear modulus between directions of isotropy and "
66 "anisotropy , G_ia.",
67 G_ia.name);
68
69 return std::make_unique<LinearElasticTransverseIsotropic<DisplacementDim>>(
70 E_i, E_a, nu_ii, nu_ia, G_ia, local_coordinate_system);
71}
72
73template std::unique_ptr<LinearElasticTransverseIsotropic<2>>
75 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
76 std::optional<ParameterLib::CoordinateSystem> const&
77 local_coordinate_system,
78 BaseLib::ConfigTree const& config, const bool skip_type_checking);
79
80template std::unique_ptr<LinearElasticTransverseIsotropic<3>>
82 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
83 std::optional<ParameterLib::CoordinateSystem> const&
84 local_coordinate_system,
85 BaseLib::ConfigTree const& config, const bool skip_type_checking);
86} // namespace Solids
87} // 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< LinearElasticTransverseIsotropic< DisplacementDim > > createLinearElasticTransverseIsotropic(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)
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