OGS
SolidMechanics.cpp
Go to the documentation of this file.
1
10#include "SolidMechanics.h"
11
12namespace ProcessLib::TH2M
13{
14namespace ConstitutiveRelations
15{
16template <int DisplacementDim>
18 const SpaceTimeData& x_t,
19 TemperatureData const& T_data,
20 MechanicalStrainData<DisplacementDim> const& mechanical_strain_data,
22 mechanical_strain_prev_data,
25 eff_stress_prev_data,
27 eff_stress_data,
30 EquivalentPlasticStrainData& equivalent_plastic_strain) const
31{
32 namespace MPL = MaterialPropertyLib;
33 MPL::VariableArray variables;
34
36 mechanical_strain_data.eps_m);
37 variables.temperature = T_data.T;
38
39 MPL::VariableArray variables_prev;
40 variables_prev.stress.emplace<KelvinVector<DisplacementDim>>(
41 eff_stress_prev_data->sigma);
43 mechanical_strain_prev_data->eps_m);
44 variables_prev.temperature = T_data.T_prev;
45
46 auto solution = solid_material_.integrateStress(
47 variables_prev, variables, x_t.t, x_t.x, x_t.dt,
48 *mat_state.material_state_variables);
49
50 if (!solution)
51 {
52 OGS_FATAL("Computation of local constitutive relation failed.");
53 }
54
55 std::tie(eff_stress_data.sigma, mat_state.material_state_variables,
56 out.stiffness_tensor) = std::move(*solution);
57
58 *equivalent_plastic_strain =
59 mat_state.material_state_variables->getEquivalentPlasticStrain();
60}
61
62template struct SolidMechanicsModel<2>;
63template struct SolidMechanicsModel<3>;
64} // namespace ConstitutiveRelations
65} // namespace ProcessLib::TH2M
#define OGS_FATAL(...)
Definition Error.h:26
KV::KelvinVectorType< DisplacementDim > KelvinVector
Definition Base.h:26
Represents a previous state of type T.
Definition Base.h:21
ParameterLib::SpatialPosition x
Definition Base.h:74
MathLib::KelvinVector::KelvinVectorType< DisplacementDim > sigma
Definition StressData.h:20
void eval(const SpaceTimeData &x_t, TemperatureData const &T_data, MechanicalStrainData< DisplacementDim > const &mechanical_strain_data, PrevState< MechanicalStrainData< DisplacementDim > > const &mechanical_strain_prev_data, PrevState< ProcessLib::ConstitutiveRelations::StressData< DisplacementDim > > const &eff_stress_prev_data, ProcessLib::ConstitutiveRelations::StressData< DisplacementDim > &eff_stress_data, MaterialStateData< DisplacementDim > &mat_state, SolidMechanicsDataStateless< DisplacementDim > &out, EquivalentPlasticStrainData &equivalent_plastic_strain) const