OGS
LargeDeformation/ConstitutiveRelations/SolidMechanics.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
4#include "SolidMechanics.h"
5
7{
9{
10template <int DisplacementDim>
12 SpaceTimeData const& x_t,
13 Temperature const& temperature,
14 DeformationGradientData<DisplacementDim> const& deformation_gradient_data,
16 deformation_gradient_data_prev,
18 PrevState<StressData<DisplacementDim>> const& stress_data_prev,
19 StressData<DisplacementDim>& stress_data,
20 SolidMechanicsDataStateless<DisplacementDim>& current_stateless) const
21{
22 namespace MPL = MaterialPropertyLib;
23
24 // current state
25 MPL::VariableArray variables;
26 {
27 // thermodynamic forces
28 variables.stress = stress_data.sigma;
29
30 // gradient
31 variables.deformation_gradient =
32 deformation_gradient_data.deformation_gradient;
33
34 // external state variables
35 variables.temperature = *temperature;
36 }
37
38 // previous state
39 MPL::VariableArray variables_prev;
40 {
41 // thermodynamic forces
42 variables_prev.stress = stress_data_prev->sigma;
43
44 // gradient
45 variables_prev.deformation_gradient =
46 deformation_gradient_data_prev->deformation_gradient;
47
48 // external state variables
49 variables_prev.temperature = *temperature;
50 }
51
52 auto solution = solid_material_.integrateStress(
53 variables_prev, variables, x_t.t, x_t.x, x_t.dt,
54 *mat_state.material_state_variables);
55
56 if (!solution)
57 {
58 OGS_FATAL("Computation of local constitutive relation failed.");
59 }
60
61 auto& tdyn_forces_data = std::get<0>(*solution);
62
63 auto const view = solid_material_.createThermodynamicForcesView();
64
65 stress_data.sigma =
66 view.block(MSM::second_piola_kirchhoff_stress, tdyn_forces_data);
67 mat_state.material_state_variables = std::move(std::get<1>(*solution));
68
69 auto const& tangent_operator_data = std::get<2>(*solution);
70
71 current_stateless.stiffness_tensor = tangent_operator_blocks_view_.block(
72 MSM::second_piola_kirchhoff_stress, MSM::green_lagrange_strain,
73 tangent_operator_data);
74}
75
76template struct SolidMechanicsModel<2>;
77template struct SolidMechanicsModel<3>;
78} // namespace ConstitutiveRelations
79} // namespace ProcessLib::LargeDeformation
#define OGS_FATAL(...)
Definition Error.h:19
DeformationGradient deformation_gradient
BaseLib::StrongType< double, struct TemperatureTag > Temperature
MathLib::KelvinVector::KelvinVectorType< DisplacementDim > sigma
Definition StressData.h:14
MSM::OGSMFrontTangentOperatorBlocksView< DisplacementDim, MSM::ForcesGradsCombinations< boost::mp11::mp_list< MSM::GreenLagrangeStrain >, boost::mp11::mp_list< MSM::SecondPiolaKirchhoffStress >, boost::mp11::mp_list< MSM::Temperature > >::type > tangent_operator_blocks_view_
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