OGS
TH2M/ConstitutiveRelations/ElasticTangentStiffnessModel.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
5
7
8namespace ProcessLib::TH2M
9{
11{
12template <int DisplacementDim>
14 SpaceTimeData const& x_t, TemperatureData const& T_data,
16{
17 namespace MPL = MaterialPropertyLib;
18
19 MPL::VariableArray variable_array;
20 MPL::VariableArray variable_array_prev;
21
22 auto const null_state = solid_material_.createMaterialStateVariables();
23 solid_material_.initializeInternalStateVariables(x_t.t, x_t.x, *null_state);
24
26
27 variable_array.stress.emplace<KV>(KV::Zero());
28 variable_array.mechanical_strain.emplace<KV>(KV::Zero());
29 variable_array.temperature = T_data.T;
30
31 variable_array_prev.stress.emplace<KV>(KV::Zero());
32 variable_array_prev.mechanical_strain.emplace<KV>(KV::Zero());
33 variable_array_prev.temperature = T_data.T_prev;
34
35 auto&& solution = solid_material_.integrateStress(
36 variable_array_prev, variable_array, x_t.t, x_t.x, x_t.dt, *null_state);
37
38 if (!solution)
39 {
40 OGS_FATAL("Computation of elastic tangent stiffness failed.");
41 }
42
43 out.stiffness_tensor = std::move(std::get<2>(*solution));
44}
45
48} // namespace ConstitutiveRelations
49} // namespace ProcessLib::TH2M
#define OGS_FATAL(...)
Definition Error.h:19
KV::KelvinVectorType< DisplacementDim > KelvinVector
void eval(SpaceTimeData const &x_t, TemperatureData const &T_data, ElasticTangentStiffnessData< DisplacementDim > &out) const