OGS 6.1.0-1699-ge946d4c5f
IntegrationPointData.h
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include <memory>
13 
15 #include "MathLib/KelvinVector.h"
17 
18 namespace ProcessLib
19 {
20 namespace RichardsMechanics
21 {
22 template <typename BMatricesType, typename ShapeMatrixTypeDisplacement,
23  typename ShapeMatricesTypePressure, int DisplacementDim, int NPoints>
25 {
29  : solid_material(solid_material),
31  solid_material.createMaterialStateVariables())
32  {
33  // Initialize current time step values
34  static const int kelvin_vector_size =
36  DisplacementDim>::value;
37  sigma_eff.setZero(kelvin_vector_size);
38  eps.setZero(kelvin_vector_size);
39 
40  // Previous time step values are not initialized and are set later.
41  eps_prev.resize(kelvin_vector_size);
42  sigma_eff_prev.resize(kelvin_vector_size);
43  }
44 
45  typename ShapeMatrixTypeDisplacement::template MatrixType<
46  DisplacementDim, NPoints * DisplacementDim>
50 
51  typename ShapeMatrixTypeDisplacement::NodalRowVectorType N_u;
52  typename ShapeMatrixTypeDisplacement::GlobalDimNodalMatrixType dNdx_u;
53 
54  typename ShapeMatricesTypePressure::NodalRowVectorType N_p;
55  typename ShapeMatricesTypePressure::GlobalDimNodalMatrixType dNdx_p;
56 
57  double saturation;
58 
60  std::unique_ptr<typename MaterialLib::Solids::MechanicsBase<
61  DisplacementDim>::MaterialStateVariables>
64 
66  {
67  eps_prev = eps;
68  sigma_eff_prev = sigma_eff;
69  material_state_variables->pushBackState();
70  }
71 
72  template <typename DisplacementVectorType>
74  double const t,
75  SpatialPosition const& x_position,
76  double const dt,
77  DisplacementVectorType const& /*u*/,
78  double const temperature)
79  {
80  auto&& solution = solid_material.integrateStress(
81  t, x_position, dt, eps_prev, eps, sigma_eff_prev,
82  *material_state_variables, temperature);
83 
84  if (!solution)
85  OGS_FATAL("Computation of local constitutive relation failed.");
86 
88  std::tie(sigma_eff, material_state_variables, C) = std::move(*solution);
89 
90  return C;
91  }
92 
94 };
95 
96 } // namespace RichardsMechanics
97 } // namespace ProcessLib
std::unique_ptr< typename MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables > material_state_variables
Kelvin vector dimensions for given displacement dimension.
Definition: KelvinVector.h:23
ShapeMatrixTypeDisplacement::GlobalDimNodalMatrixType dNdx_u
ShapeMatricesTypePressure::GlobalDimNodalMatrixType dNdx_p
Eigen::Matrix< double, KelvinVectorDimensions< DisplacementDim >::value, KelvinVectorDimensions< DisplacementDim >::value, Eigen::RowMajor > KelvinMatrixType
Definition: KelvinVector.h:59
BMatricesType::KelvinMatrixType updateConstitutiveRelation(double const t, SpatialPosition const &x_position, double const dt, DisplacementVectorType const &, double const temperature)
ShapeMatricesTypePressure::NodalRowVectorType N_p
IntegrationPointData(MaterialLib::Solids::MechanicsBase< DisplacementDim > const &solid_material)
#define OGS_FATAL(fmt,...)
Definition: Error.h:71
boost::optional< std::tuple< KelvinVector, std::unique_ptr< MaterialStateVariables >, KelvinMatrix > > integrateStress(double const t, ProcessLib::SpatialPosition const &x, double const dt, Eigen::Matrix< double, Eigen::Dynamic, 1 > const &eps_prev, Eigen::Matrix< double, Eigen::Dynamic, 1 > const &eps, Eigen::Matrix< double, Eigen::Dynamic, 1 > const &sigma_prev, MaterialStateVariables const &material_state_variables, double const T) const
Definition: MechanicsBase.h:82
MaterialLib::Solids::MechanicsBase< DisplacementDim > const & solid_material
ShapeMatrixTypeDisplacement::NodalRowVectorType N_u
Eigen::Matrix< double, KelvinVectorDimensions< DisplacementDim >::value, 1, Eigen::ColMajor > KelvinVectorType
Definition: KelvinVector.h:49
ShapeMatrixTypeDisplacement::template MatrixType< DisplacementDim, NPoints *DisplacementDim > N_u_op