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 StrainData<DisplacementDim> const& eps_data,
21 PrevState<StrainData<DisplacementDim>> const& eps_data_prev,
23 PrevState<StressData<DisplacementDim>> const& stress_data_prev,
24 StressData<DisplacementDim>& stress_data,
26 FreeEnergyDensityData& free_energy_density_data) 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 variables.mechanical_strain = eps_data.eps;
36
37 // external state variables
38 variables.temperature = *temperature;
39 }
40
41 // previous state
42 MPL::VariableArray variables_prev;
43 {
44 // thermodynamic forces
45 variables_prev.stress = stress_data_prev->sigma;
46 variables_prev.mechanical_strain = eps_data_prev->eps;
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 std::tie(stress_data.sigma, mat_state.material_state_variables,
62 current_stateless.stiffness_tensor) = std::move(*solution);
63
64 free_energy_density_data.free_energy_density =
65 solid_material_.computeFreeEnergyDensity(
66 x_t.t, x_t.x, x_t.dt, eps_data.eps, stress_data.sigma,
67 *mat_state.material_state_variables);
68}
69
70template struct SolidMechanicsModel<2>;
71template struct SolidMechanicsModel<3>;
72} // namespace ConstitutiveRelations
73} // namespace ProcessLib::SmallDeformation
#define OGS_FATAL(...)
Definition Error.h:26
Represents a previous state of type T.
Definition Base.h:21
ParameterLib::SpatialPosition x
Definition Base.h:74
MathLib::KelvinVector::KelvinVectorType< DisplacementDim > eps
Definition StrainData.h:20
MathLib::KelvinVector::KelvinVectorType< DisplacementDim > sigma
Definition StressData.h:20
void eval(SpaceTimeData const &x_t, Temperature const &temperature, StrainData< DisplacementDim > const &eps_data, PrevState< StrainData< DisplacementDim > > const &eps_data_prev, MaterialStateData< DisplacementDim > &mat_state, PrevState< StressData< DisplacementDim > > const &stress_data_prev, StressData< DisplacementDim > &stress_data, SolidMechanicsDataStateless< DisplacementDim > &current_stateless, FreeEnergyDensityData &free_energy_density_data) const