OGS
SolidMechanics.cpp
Go to the documentation of this file.
1
10#include "SolidMechanics.h"
11
13{
14namespace ConstitutiveRelations
15{
16template <int DisplacementDim>
18 SpaceTimeData const& x_t,
19 Temperature const& temperature,
20 DeformationGradientData<DisplacementDim> const& deformation_gradient_data,
22 deformation_gradient_data_prev,
24 PrevState<StressData<DisplacementDim>> const& stress_data_prev,
25 StressData<DisplacementDim>& stress_data,
26 SolidMechanicsDataStateless<DisplacementDim>& current_stateless) const
27{
28 namespace MPL = MaterialPropertyLib;
29
30 // current state
31 MPL::VariableArray variables;
32 {
33 // thermodynamic forces
34 variables.stress = stress_data.sigma;
35
36 // gradient
37 variables.deformation_gradient =
38 deformation_gradient_data.deformation_gradient;
39
40 // external state variables
41 variables.temperature = *temperature;
42 }
43
44 // previous state
45 MPL::VariableArray variables_prev;
46 {
47 // thermodynamic forces
48 variables_prev.stress = stress_data_prev->sigma;
49
50 // gradient
51 variables_prev.deformation_gradient =
52 deformation_gradient_data_prev->deformation_gradient;
53
54 // external state variables
55 variables_prev.temperature = *temperature;
56 }
57
58 auto solution = solid_material_.integrateStress(
59 variables_prev, variables, x_t.t, x_t.x, x_t.dt,
60 *mat_state.material_state_variables);
61
62 if (!solution)
63 {
64 OGS_FATAL("Computation of local constitutive relation failed.");
65 }
66
67 auto& tdyn_forces_data = std::get<0>(*solution);
68
69 auto const view = solid_material_.createThermodynamicForcesView();
70
71 stress_data.sigma =
72 view.block(MSM::second_piola_kirchhoff_stress, tdyn_forces_data);
73 mat_state.material_state_variables = std::move(std::get<1>(*solution));
74
75 auto const& tangent_operator_data = std::get<2>(*solution);
76
77 current_stateless.stiffness_tensor = tangent_operator_blocks_view_.block(
79 tangent_operator_data);
80}
81
82template struct SolidMechanicsModel<2>;
83template struct SolidMechanicsModel<3>;
84} // namespace ConstitutiveRelations
85} // namespace ProcessLib::LargeDeformation
#define OGS_FATAL(...)
Definition Error.h:26
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 SecondPiolaKirchhoffStress second_piola_kirchhoff_stress
Definition Variable.h:167
static constexpr GreenLagrangeStrain green_lagrange_strain
Instance that can be used for overload resolution/template type deduction.
Definition Variable.h:112
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(SpaceTimeData const &x_t, Temperature const &temperature, DeformationGradientData< DisplacementDim > const &deformation_gradient_data, PrevState< DeformationGradientData< DisplacementDim > > const &deformation_gradient_data_prev, MaterialStateData< DisplacementDim > &mat_state, PrevState< StressData< DisplacementDim > > const &stress_data_prev, StressData< DisplacementDim > &stress_data, SolidMechanicsDataStateless< DisplacementDim > &current_stateless) const
MaterialPropertyLib::Tensor< DisplacementDim > deformation_gradient
Definition Base.h:70