OGS
CreateConstitutiveRelation.cpp
Go to the documentation of this file.
1
13
14#include "CreateCreepBGRa.h"
15#include "CreateEhlers.h"
19#include "CreateLubby2.h"
20#ifdef OGS_USE_MFRONT
21#include "MFront/CreateMFront.h"
22#endif // OGS_USE_MFRONT
23
25#include "MechanicsBase.h"
26
27namespace MaterialLib
28{
29namespace Solids
30{
31template <int DisplacementDim>
32std::unique_ptr<MaterialLib::Solids::MechanicsBase<DisplacementDim>>
34 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
35 std::optional<ParameterLib::CoordinateSystem> const&
36 local_coordinate_system,
37 BaseLib::ConfigTree const& config)
38{
39 auto const type =
41 config.peekConfigParameter<std::string>("type");
42
43 if (type == "Ehlers")
44 {
46 parameters, config);
47 }
48 if (type == "LinearElasticIsotropic")
49 {
50 const bool skip_type_checking = false;
52 DisplacementDim>(parameters, config, skip_type_checking);
53 }
54 if (type == "LinearElasticOrthotropic")
55 {
56 const bool skip_type_checking = false;
58 DisplacementDim>(
59 parameters, local_coordinate_system, config, skip_type_checking);
60 }
61 if (type == "LinearElasticTransverseIsotropic")
62 {
63 const bool skip_type_checking = false;
65 DisplacementDim>(
66 parameters, local_coordinate_system, config, skip_type_checking);
67 }
68 if (type == "Lubby2")
69 {
71 parameters, config);
72 }
73 if (type == "CreepBGRa")
74 {
76 parameters, config);
77 }
78 if (type == "MFront")
79 {
80#ifdef OGS_USE_MFRONT
82 parameters, local_coordinate_system, config);
83#else // OGS_USE_MFRONT
85 "OGS is compiled without MFront support. See OGS_USE_MFRONT CMake "
86 "option.");
87#endif // OGS_USE_MFRONT
88 }
89 OGS_FATAL("Cannot construct constitutive relation of given type '{:s}'.",
90 type);
91}
92
93template std::unique_ptr<MaterialLib::Solids::MechanicsBase<2>>
95 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
96 std::optional<ParameterLib::CoordinateSystem> const&
97 local_coordinate_system,
98 BaseLib::ConfigTree const& config);
99
100template std::unique_ptr<MaterialLib::Solids::MechanicsBase<3>>
102 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
103 std::optional<ParameterLib::CoordinateSystem> const&
104 local_coordinate_system,
105 BaseLib::ConfigTree const& config);
106
107template <int DisplacementDim>
108std::map<int,
109 std::shared_ptr<MaterialLib::Solids::MechanicsBase<DisplacementDim>>>
111 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
112 std::optional<ParameterLib::CoordinateSystem> const&
113 local_coordinate_system,
114 MeshLib::PropertyVector<int> const* const material_ids,
115 BaseLib::ConfigTree const& config)
116{
119 parameters,
120 local_coordinate_system,
121 material_ids,
122 config,
124}
125
126template std::map<int, std::shared_ptr<MaterialLib::Solids::MechanicsBase<2>>>
128 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
129 std::optional<ParameterLib::CoordinateSystem> const&
130 local_coordinate_system,
131 MeshLib::PropertyVector<int> const* const material_ids,
132 BaseLib::ConfigTree const& config);
133
134template std::map<int, std::shared_ptr<MaterialLib::Solids::MechanicsBase<3>>>
136 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters,
137 std::optional<ParameterLib::CoordinateSystem> const&
138 local_coordinate_system,
139 MeshLib::PropertyVector<int> const* const material_ids,
140 BaseLib::ConfigTree const& config);
141} // namespace Solids
142} // namespace MaterialLib
#define OGS_FATAL(...)
Definition Error.h:26
T peekConfigParameter(std::string const &param) const
std::unique_ptr< MaterialLib::Solids::MechanicsBase< DisplacementDim > > createCreepBGRa(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, BaseLib::ConfigTree const &config)
std::unique_ptr< SolidEhlers< DisplacementDim > > createEhlers(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, BaseLib::ConfigTree const &config)
std::unique_ptr< Lubby2< DisplacementDim > > createLubby2(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, BaseLib::ConfigTree const &config)
std::unique_ptr< MechanicsBase< DisplacementDim > > createMFront(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, BaseLib::ConfigTree const &config)
std::map< int, std::shared_ptr< MaterialLib::Solids::MechanicsBase< DisplacementDim > > > createConstitutiveRelations(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, MeshLib::PropertyVector< int > const *const material_ids, BaseLib::ConfigTree const &config)
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)
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)
std::unique_ptr< LinearElasticIsotropic< DisplacementDim > > createLinearElasticIsotropic(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, BaseLib::ConfigTree const &config, const bool skip_type_checking)
std::map< int, std::shared_ptr< SolidConstitutiveRelation > > createConstitutiveRelationsGeneric(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, MeshLib::PropertyVector< int > const *const material_ids, BaseLib::ConfigTree const &config, std::unique_ptr< SolidConstitutiveRelation >(*create_constitutive_relation)(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &, std::optional< ParameterLib::CoordinateSystem > const &, BaseLib::ConfigTree const &))
template std::map< int, std::shared_ptr< MaterialLib::Solids::MechanicsBase< 2 > > > createConstitutiveRelations< 2 >(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, MeshLib::PropertyVector< int > const *const material_ids, BaseLib::ConfigTree const &config)
std::unique_ptr< MaterialLib::Solids::MechanicsBase< DisplacementDim > > createConstitutiveRelation(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, BaseLib::ConfigTree const &config)
template std::map< int, std::shared_ptr< MaterialLib::Solids::MechanicsBase< 3 > > > createConstitutiveRelations< 3 >(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, MeshLib::PropertyVector< int > const *const material_ids, BaseLib::ConfigTree const &config)