OGS
IntegrationPointData.h
Go to the documentation of this file.
1
11#pragma once
12
13#include <memory>
14
19
20namespace ProcessLib
21{
22namespace RichardsMechanics
23{
24template <typename BMatricesType, typename ShapeMatrixTypeDisplacement,
25 typename ShapeMatricesTypePressure, int DisplacementDim, int NPoints>
27{
28 typename ShapeMatrixTypeDisplacement::NodalRowVectorType N_u;
29 typename ShapeMatrixTypeDisplacement::GlobalDimNodalMatrixType dNdx_u;
30
31 typename ShapeMatricesTypePressure::NodalRowVectorType N_p;
32 typename ShapeMatricesTypePressure::GlobalDimNodalMatrixType dNdx_p;
33
34 double integration_weight = std::numeric_limits<double>::quiet_NaN();
35
36 MathLib::KelvinVector::
37 KelvinMatrixType<DisplacementDim> static computeElasticTangentStiffness(
38 double const t,
39 ParameterLib::SpatialPosition const& x_position,
40 double const dt,
41 double const temperature,
43 solid_material,
45 MaterialStateVariables const& material_state_variables)
46 {
47 namespace MPL = MaterialPropertyLib;
48
49 MPL::VariableArray variable_array;
50 MPL::VariableArray variable_array_prev;
51
53
54 variable_array.stress.emplace<KV>(KV::Zero());
55 variable_array.mechanical_strain.emplace<KV>(KV::Zero());
56 variable_array.temperature = temperature;
57
58 variable_array_prev.stress.emplace<KV>(KV::Zero());
59 variable_array_prev.mechanical_strain.emplace<KV>(KV::Zero());
60 variable_array_prev.temperature = temperature;
61
62 auto&& solution = solid_material.integrateStress(
63 variable_array_prev, variable_array, t, x_position, dt,
64 material_state_variables);
65
66 if (!solution)
67 {
68 OGS_FATAL("Computation of elastic tangent stiffness failed.");
69 }
70
72 std::move(std::get<2>(*solution));
73
74 return C;
75 }
76
77 static typename BMatricesType::KelvinMatrixType updateConstitutiveRelation(
78 MaterialPropertyLib::VariableArray const& variable_array,
79 double const t,
80 ParameterLib::SpatialPosition const& x_position,
81 double const dt,
82 double const temperature,
84 ConstitutiveStress_StrainTemperature::EffectiveStressData<
85 DisplacementDim>& sigma_eff,
86 PrevState<ProcessLib::ThermoRichardsMechanics::
87 ConstitutiveStress_StrainTemperature::EffectiveStressData<
88 DisplacementDim>> const& sigma_eff_prev,
89 ProcessLib::ThermoRichardsMechanics::
90 ConstitutiveStress_StrainTemperature::MechanicalStrainData<
91 DisplacementDim> const&
92 /*eps_m*/,
94 ProcessLib::ThermoRichardsMechanics::
95 ConstitutiveStress_StrainTemperature::MechanicalStrainData<
96 DisplacementDim>> const& eps_m_prev,
97 MaterialLib::Solids::MechanicsBase<DisplacementDim> const&
98 solid_material,
99 std::unique_ptr<typename MaterialLib::Solids::MechanicsBase<
100 DisplacementDim>::MaterialStateVariables>& material_state_variables)
101 {
102 MaterialPropertyLib::VariableArray variable_array_prev;
103 variable_array_prev.stress = sigma_eff_prev->sigma_eff;
104 variable_array_prev.mechanical_strain
106 eps_m_prev->eps_m);
107 variable_array_prev.temperature = temperature;
108
109 auto&& solution = solid_material.integrateStress(
110 variable_array_prev, variable_array, t, x_position, dt,
111 *material_state_variables);
112
113 if (!solution)
114 {
115 OGS_FATAL("Computation of local constitutive relation failed.");
116 }
117
119 std::tie(sigma_eff.sigma_eff, material_state_variables, C) =
120 std::move(*solution);
121
122 return C;
123 }
124
126};
127
128} // namespace RichardsMechanics
129} // namespace ProcessLib
#define OGS_FATAL(...)
Definition Error.h:26
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), kelvin_vector_dimensions(DisplacementDim), Eigen::RowMajor > KelvinMatrixType
virtual std::optional< std::tuple< KelvinVector, std::unique_ptr< MaterialStateVariables >, KelvinMatrix > > integrateStress(MaterialPropertyLib::VariableArray const &variable_array_prev, MaterialPropertyLib::VariableArray const &variable_array, double const t, ParameterLib::SpatialPosition const &x, double const dt, MaterialStateVariables const &material_state_variables) const =0
Represents a previous state of type T.
Definition Base.h:21
ShapeMatrixTypeDisplacement::NodalRowVectorType N_u
ShapeMatricesTypePressure::GlobalDimNodalMatrixType dNdx_p
ShapeMatrixTypeDisplacement::GlobalDimNodalMatrixType dNdx_u
ShapeMatricesTypePressure::NodalRowVectorType N_p
static MathLib::KelvinVector::KelvinMatrixType< DisplacementDim > computeElasticTangentStiffness(double const t, ParameterLib::SpatialPosition const &x_position, double const dt, double const temperature, MaterialLib::Solids::MechanicsBase< DisplacementDim > const &solid_material, typename MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables const &material_state_variables)
static BMatricesType::KelvinMatrixType updateConstitutiveRelation(MaterialPropertyLib::VariableArray const &variable_array, double const t, ParameterLib::SpatialPosition const &x_position, double const dt, double const temperature, ProcessLib::ThermoRichardsMechanics::ConstitutiveStress_StrainTemperature::EffectiveStressData< DisplacementDim > &sigma_eff, PrevState< ProcessLib::ThermoRichardsMechanics::ConstitutiveStress_StrainTemperature::EffectiveStressData< DisplacementDim > > const &sigma_eff_prev, ProcessLib::ThermoRichardsMechanics::ConstitutiveStress_StrainTemperature::MechanicalStrainData< DisplacementDim > const &, PrevState< ProcessLib::ThermoRichardsMechanics::ConstitutiveStress_StrainTemperature::MechanicalStrainData< DisplacementDim > > const &eps_m_prev, MaterialLib::Solids::MechanicsBase< DisplacementDim > const &solid_material, std::unique_ptr< typename MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables > &material_state_variables)