OGS
ElasticTangentStiffnessModel.cpp
Go to the documentation of this file.
1
11
13
14namespace ProcessLib::TH2M
15{
16namespace ConstitutiveRelations
17{
18template <int DisplacementDim>
20 SpaceTimeData const& x_t, TemperatureData const& T_data,
22{
23 namespace MPL = MaterialPropertyLib;
24
25 MPL::VariableArray variable_array;
26 MPL::VariableArray variable_array_prev;
27
28 auto const null_state = solid_material_.createMaterialStateVariables();
29 solid_material_.initializeInternalStateVariables(x_t.t, x_t.x, *null_state);
30
32
33 variable_array.stress.emplace<KV>(KV::Zero());
34 variable_array.mechanical_strain.emplace<KV>(KV::Zero());
35 variable_array.temperature = T_data.T;
36
37 variable_array_prev.stress.emplace<KV>(KV::Zero());
38 variable_array_prev.mechanical_strain.emplace<KV>(KV::Zero());
39 variable_array_prev.temperature = T_data.T_prev;
40
41 auto&& solution = solid_material_.integrateStress(
42 variable_array_prev, variable_array, x_t.t, x_t.x, x_t.dt, *null_state);
43
44 if (!solution)
45 {
46 OGS_FATAL("Computation of elastic tangent stiffness failed.");
47 }
48
49 out.stiffness_tensor = std::move(std::get<2>(*solution));
50}
51
54} // namespace ConstitutiveRelations
55} // namespace ProcessLib::TH2M
#define OGS_FATAL(...)
Definition Error.h:26
KV::KelvinVectorType< DisplacementDim > KelvinVector
Definition Base.h:26
ParameterLib::SpatialPosition x
Definition Base.h:74
void eval(SpaceTimeData const &x_t, TemperatureData const &T_data, ElasticTangentStiffnessData< DisplacementDim > &out) const