OGS
ThermoRichardsMechanics/ConstitutiveStress_StrainTemperature/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{
9{
10template <int DisplacementDim>
12 SpaceTimeData const& x_t, TemperatureData<DisplacementDim> const& T_data,
14{
15 namespace MPL = MaterialPropertyLib;
16
17 MPL::VariableArray variable_array;
18 MPL::VariableArray variable_array_prev;
19
20 auto const null_state = solid_material_.createMaterialStateVariables();
21 solid_material_.initializeInternalStateVariables(x_t.t, x_t.x, *null_state);
22
24
25 variable_array.stress.emplace<KV>(KV::Zero());
26 variable_array.mechanical_strain.emplace<KV>(KV::Zero());
27 variable_array.temperature = T_data.T;
28
29 variable_array_prev.stress.emplace<KV>(KV::Zero());
30 variable_array_prev.mechanical_strain.emplace<KV>(KV::Zero());
31 variable_array_prev.temperature = T_data.T_prev;
32
33 auto&& solution = solid_material_.integrateStress(
34 variable_array_prev, variable_array, x_t.t, x_t.x, x_t.dt, *null_state);
35
36 if (!solution)
37 {
38 OGS_FATAL("Computation of elastic tangent stiffness failed.");
39 }
40
41 out.C_el = std::move(std::get<2>(*solution));
42}
43
46} // namespace ConstitutiveStress_StrainTemperature
47} // namespace ProcessLib::ThermoRichardsMechanics
#define OGS_FATAL(...)
Definition Error.h:19
KV::KelvinVectorType< DisplacementDim > KelvinVector
void eval(SpaceTimeData const &x_t, TemperatureData< DisplacementDim > const &T_data, ElasticTangentStiffnessData< DisplacementDim > &out) const