OGS
Variable.h
Go to the documentation of this file.
1
11#pragma once
12
13#include <MGIS/Behaviour/Variable.hxx>
14
18
20{
26template <typename Derived>
28{
30 template <int DisplacementDim>
31 static constexpr std::size_t size()
32 {
33 return rows<DisplacementDim>() * cols<DisplacementDim>();
34 }
35
37 template <int DisplacementDim>
38 static constexpr std::size_t rows()
39 {
40 using T = mgis::behaviour::Variable::Type;
41 switch (Derived::type)
42 {
43 case T::SCALAR:
44 return 1;
45 case T::VECTOR:
46 return DisplacementDim;
47 case T::STENSOR:
49 DisplacementDim);
50 case T::TENSOR:
51 return MaterialPropertyLib::tensorSize(DisplacementDim);
52 }
53 }
54
56 template <int DisplacementDim>
57 static constexpr std::size_t cols()
58 {
59 using T = mgis::behaviour::Variable::Type;
60 switch (Derived::type)
61 {
62 case T::SCALAR:
63 return 1;
64 case T::VECTOR:
65 return 1;
66 case T::STENSOR:
67 return 1;
68 case T::TENSOR:
69 return 1;
70 }
71 }
72};
73
75struct Strain : Variable<Strain>
76{
78 constexpr static const char* name = "Strain";
79
81 constexpr static mgis::behaviour::Variable::Type type =
82 mgis::behaviour::Variable::Type::STENSOR;
83
87 constexpr static auto mpl_var =
89};
90
92static constexpr Strain strain;
93
95struct GreenLagrangeStrain : Variable<GreenLagrangeStrain>
96{
98 constexpr static const char* name = "GreenLagrangeStrain";
99
101 constexpr static mgis::behaviour::Variable::Type type =
102 mgis::behaviour::Variable::Type::STENSOR;
103
107 constexpr static auto mpl_var =
109};
110
113
115struct DeformationGradient : Variable<DeformationGradient>
116{
118 constexpr static const char* name = "DeformationGradient";
119
121 constexpr static mgis::behaviour::Variable::Type type =
122 mgis::behaviour::Variable::Type::TENSOR;
123
125 constexpr static auto mpl_var =
127};
128
131
132struct LiquidPressure : Variable<LiquidPressure>
133{
134 constexpr static const char* name = "LiquidPressure";
135
136 constexpr static mgis::behaviour::Variable::Type type =
137 mgis::behaviour::Variable::Type::SCALAR;
138
139 constexpr static auto mpl_var =
141};
142
144
145struct Stress : Variable<Stress>
146{
147 constexpr static const char* name = "Stress";
148
149 constexpr static mgis::behaviour::Variable::Type type =
150 mgis::behaviour::Variable::Type::STENSOR;
151
153};
154
155static constexpr Stress stress;
156
157struct SecondPiolaKirchhoffStress : Variable<SecondPiolaKirchhoffStress>
158{
159 constexpr static const char* name = "SecondPiolaKirchhoffStress";
160
161 constexpr static mgis::behaviour::Variable::Type type =
162 mgis::behaviour::Variable::Type::STENSOR;
163
165};
166
168
169struct Saturation : Variable<Saturation>
170{
171 constexpr static const char* name = "Saturation";
172
173 constexpr static mgis::behaviour::Variable::Type type =
174 mgis::behaviour::Variable::Type::SCALAR;
175
176 constexpr static auto mpl_var =
178};
179
180static constexpr Saturation saturation;
181
182struct Temperature : Variable<Temperature>
183{
184 constexpr static const char* name = "Temperature";
185
186 constexpr static mgis::behaviour::Variable::Type type =
187 mgis::behaviour::Variable::Type::SCALAR;
188
189 constexpr static auto mpl_var =
191};
192
193static constexpr Temperature temperature;
194} // namespace MaterialLib::Solids::MFront
std::variant< std::monostate, Eigen::Matrix< double, 4, 1 >, Eigen::Matrix< double, 6, 1 > > mechanical_strain
std::variant< std::monostate, Eigen::Matrix< double, 5, 1 >, Eigen::Matrix< double, 9, 1 > > deformation_gradient
std::variant< std::monostate, Eigen::Matrix< double, 4, 1 >, Eigen::Matrix< double, 6, 1 > > stress
static constexpr Temperature temperature
Definition Variable.h:193
static constexpr SecondPiolaKirchhoffStress second_piola_kirchhoff_stress
Definition Variable.h:167
static constexpr LiquidPressure liquid_pressure
Definition Variable.h:143
static constexpr Strain strain
Instance that can be used for overload resolution/template type deduction.
Definition Variable.h:92
static constexpr DeformationGradient deformation_gradient
Instance that can be used for overload resolution/template type deduction.
Definition Variable.h:130
static constexpr Saturation saturation
Definition Variable.h:180
static constexpr GreenLagrangeStrain green_lagrange_strain
Instance that can be used for overload resolution/template type deduction.
Definition Variable.h:112
static constexpr Stress stress
Definition Variable.h:155
constexpr int tensorSize(int dim)
See Tensor type for details.
Definition Tensor.h:19
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.
Meta data for deformation gradient.
Definition Variable.h:116
static constexpr const char * name
The name of the variable in MFront.
Definition Variable.h:118
static constexpr auto mpl_var
The VariableArray entry that holds this variable in OGS.
Definition Variable.h:125
static constexpr mgis::behaviour::Variable::Type type
The type of the variable in MFront.
Definition Variable.h:121
Meta data for Green-Lagrange strain.
Definition Variable.h:96
static constexpr mgis::behaviour::Variable::Type type
The type of the variable in MFront.
Definition Variable.h:101
static constexpr const char * name
The name of the variable in MFront.
Definition Variable.h:98
static constexpr const char * name
Definition Variable.h:134
static constexpr mgis::behaviour::Variable::Type type
Definition Variable.h:136
static constexpr mgis::behaviour::Variable::Type type
Definition Variable.h:173
static constexpr const char * name
Definition Variable.h:171
static constexpr mgis::behaviour::Variable::Type type
Definition Variable.h:161
Meta data for strain.
Definition Variable.h:76
static constexpr mgis::behaviour::Variable::Type type
The type of the variable in MFront.
Definition Variable.h:81
static constexpr const char * name
The name of the variable in MFront.
Definition Variable.h:78
static constexpr auto mpl_var
Definition Variable.h:87
static constexpr mgis::behaviour::Variable::Type type
Definition Variable.h:149
static constexpr auto mpl_var
Definition Variable.h:152
static constexpr const char * name
Definition Variable.h:147
static constexpr const char * name
Definition Variable.h:184
static constexpr mgis::behaviour::Variable::Type type
Definition Variable.h:186
static constexpr std::size_t cols()
The number of columns of the variable.
Definition Variable.h:57
static constexpr std::size_t rows()
The number of rows of the variable.
Definition Variable.h:38
static constexpr std::size_t size()
The number of components of the variable.
Definition Variable.h:31