OGS
MathLib::KelvinVector Namespace Reference

Detailed Description

The invariants and the Kelving mapping are explained in detail in the article "On Advantages of the Kelvin Mapping in Finite Element Implementations of Deformation Processes" [24].

Namespaces

 KelvinVector_detail
 

Classes

struct  Invariants
 

Typedefs

template<int DisplacementDim>
using KelvinVectorType = Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor >
 
template<int DisplacementDim>
using KelvinMatrixType = Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), kelvin_vector_dimensions(DisplacementDim), Eigen::RowMajor >
 

Functions

template<>
Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > inverse (Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &v)
 
template<>
Eigen::Matrix< double, 6, 1, Eigen::ColMajor, 6, 1 > inverse (Eigen::Matrix< double, 6, 1, Eigen::ColMajor, 6, 1 > const &v)
 
template<>
Eigen::Matrix< double, 3, 3 > kelvinVectorToTensor (Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &v)
 
template<>
Eigen::Matrix< double, 3, 3 > kelvinVectorToTensor (Eigen::Matrix< double, 6, 1, Eigen::ColMajor, 6, 1 > const &v)
 
template<>
Eigen::Matrix< double, 3, 3 > kelvinVectorToTensor (Eigen::Matrix< double, Eigen::Dynamic, 1, Eigen::ColMajor, Eigen::Dynamic, 1 > const &v)
 
template<>
KelvinVectorType< 2 > tensorToKelvin< 2 > (Eigen::Matrix< double, 3, 3 > const &m)
 
template<>
KelvinVectorType< 3 > tensorToKelvin< 3 > (Eigen::Matrix< double, 3, 3 > const &m)
 
template<>
Eigen::Matrix< double, 4, 1 > kelvinVectorToSymmetricTensor (Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &v)
 
template<>
Eigen::Matrix< double, 6, 1 > kelvinVectorToSymmetricTensor (Eigen::Matrix< double, 6, 1, Eigen::ColMajor, 6, 1 > const &v)
 
template<>
Eigen::Matrix< double, Eigen::Dynamic, 1, Eigen::ColMajor, Eigen::Dynamic, 1 > kelvinVectorToSymmetricTensor (Eigen::Matrix< double, Eigen::Dynamic, 1, Eigen::ColMajor, Eigen::Dynamic, 1 > const &v)
 
template<>
Eigen::Matrix< double, 2, 4 > liftVectorToKelvin< 2 > (Eigen::Matrix< double, 2, 1 > const &v)
 
template<>
Eigen::Matrix< double, 3, 6 > liftVectorToKelvin< 3 > (Eigen::Matrix< double, 3, 1 > const &v)
 
template<>
Eigen::Matrix< double, 2, 1 > reduceKelvinToVector< 2 > (Eigen::Matrix< double, 2, 4 > const &m)
 
template<>
Eigen::Matrix< double, 3, 1 > reduceKelvinToVector< 3 > (Eigen::Matrix< double, 3, 6 > const &m)
 
template<>
KelvinMatrixType< 2 > fourthOrderRotationMatrix< 2 > (Eigen::Matrix< double, 2, 2, Eigen::ColMajor, 2, 2 > const &transformation)
 
template<>
KelvinMatrixType< 3 > fourthOrderRotationMatrix< 3 > (Eigen::Matrix< double, 3, 3, Eigen::ColMajor, 3, 3 > const &transformation)
 
constexpr int kelvin_vector_dimensions (int const displacement_dim)
 Kelvin vector dimensions for given displacement dimension. More...
 
template<int KelvinVectorSize>
Eigen::Matrix< double, KelvinVectorSize, 1, Eigen::ColMajor, KelvinVectorSize, 1 > inverse (Eigen::Matrix< double, KelvinVectorSize, 1, Eigen::ColMajor, KelvinVectorSize, 1 > const &v)
 
template<int KelvinVectorSize>
Eigen::Matrix< double, 3, 3 > kelvinVectorToTensor (Eigen::Matrix< double, KelvinVectorSize, 1, Eigen::ColMajor, KelvinVectorSize, 1 > const &v)
 
template<int DisplacementDim>
KelvinVectorType< DisplacementDim > tensorToKelvin (Eigen::Matrix< double, 3, 3 > const &m)
 
template<int KelvinVectorSize>
Eigen::Matrix< double, KelvinVectorSize, 1, Eigen::ColMajor, KelvinVectorSize, 1 > kelvinVectorToSymmetricTensor (Eigen::Matrix< double, KelvinVectorSize, 1, Eigen::ColMajor, KelvinVectorSize, 1 > const &v)
 
template<typename Derived >
Eigen::Matrix< double, Eigen::MatrixBase< Derived >::RowsAtCompileTime, 1 > symmetricTensorToKelvinVector (Eigen::MatrixBase< Derived > const &v)
 
template<int DisplacementDim>
KelvinVectorType< DisplacementDim > symmetricTensorToKelvinVector (std::vector< double > const &values)
 
template<int DisplacementDim>
Eigen::Matrix< double, DisplacementDim, kelvin_vector_dimensions(DisplacementDim)> liftVectorToKelvin (Eigen::Matrix< double, DisplacementDim, 1 > const &v)
 
template<int DisplacementDim>
Eigen::Matrix< double, DisplacementDim, 1 > reduceKelvinToVector (Eigen::Matrix< double, DisplacementDim, kelvin_vector_dimensions(DisplacementDim)> const &m)
 
template<int DisplacementDim>
KelvinMatrixType< DisplacementDim > fourthOrderRotationMatrix (Eigen::Matrix< double, DisplacementDim, DisplacementDim, Eigen::ColMajor, DisplacementDim, DisplacementDim > const &transformation)
 

Typedef Documentation

◆ KelvinMatrixType

template<int DisplacementDim>
using MathLib::KelvinVector::KelvinMatrixType = typedef Eigen::Matrix<double, kelvin_vector_dimensions(DisplacementDim), kelvin_vector_dimensions(DisplacementDim), Eigen::RowMajor>

Kelvin matrix type for given displacement dimension.

Note
The Eigen matrix is always a fixed size vector in contrast to a shape matrix policy types like BMatrixPolicyType::KelvinMatrixType.

Definition at line 54 of file KelvinVector.h.

◆ KelvinVectorType

template<int DisplacementDim>
using MathLib::KelvinVector::KelvinVectorType = typedef Eigen::Matrix<double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor>

Kelvin vector type for given displacement dimension.

Note
The Eigen vector is always a fixed size vector in contrast to a shape matrix policy types like BMatrixPolicyType::KelvinVectorType.

Definition at line 46 of file KelvinVector.h.

Function Documentation

◆ fourthOrderRotationMatrix()

template<int DisplacementDim>
KelvinMatrixType<DisplacementDim> MathLib::KelvinVector::fourthOrderRotationMatrix ( Eigen::Matrix< double, DisplacementDim, DisplacementDim, Eigen::ColMajor, DisplacementDim, DisplacementDim > const &  transformation)

Rotation tensor for Kelvin mapped vectors and tensors. It is meant to be used for rotation of stress/strain tensors epsilon:Q and tangent stiffness tensors Q*C*Q^t. 2D and 3D implementations available.

Referenced by MaterialLib::Solids::LinearElasticOrthotropic< DisplacementDim >::getElasticTensor(), and MaterialLib::Solids::MFront::MFront< DisplacementDim >::integrateStress().

◆ fourthOrderRotationMatrix< 2 >()

template<>
KelvinMatrixType<2> MathLib::KelvinVector::fourthOrderRotationMatrix< 2 > ( Eigen::Matrix< double, 2, 2, Eigen::ColMajor, 2, 2 > const &  transformation)

Definition at line 162 of file KelvinVector.cpp.

243 {
244  // 1-based index access for convenience.
245  auto Q = [&](int const i, int const j)
246  { return transformation(i - 1, j - 1); };
247 
249  R << Q(1, 1) * Q(1, 1), Q(1, 2) * Q(1, 2), 0,
250  std::sqrt(2) * Q(1, 1) * Q(1, 2), Q(2, 1) * Q(2, 1), Q(2, 2) * Q(2, 2),
251  0, std::sqrt(2) * Q(2, 1) * Q(2, 2), 0, 0, 1, 0,
252  std::sqrt(2) * Q(1, 1) * Q(2, 1), std::sqrt(2) * Q(1, 2) * Q(2, 2), 0,
253  Q(1, 1) * Q(2, 2) + Q(1, 2) * Q(2, 1);
254  return R;
255 }
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), kelvin_vector_dimensions(DisplacementDim), Eigen::RowMajor > KelvinMatrixType
Definition: KelvinVector.h:56

References OGS_FATAL, and MathLib::v.

◆ fourthOrderRotationMatrix< 3 >()

template<>
KelvinMatrixType<3> MathLib::KelvinVector::fourthOrderRotationMatrix< 3 > ( Eigen::Matrix< double, 3, 3, Eigen::ColMajor, 3, 3 > const &  transformation)

Definition at line 162 of file KelvinVector.cpp.

260 {
261  // 1-based index access for convenience.
262  auto Q = [&](int const i, int const j)
263  { return transformation(i - 1, j - 1); };
264 
266  R << Q(1, 1) * Q(1, 1), Q(1, 2) * Q(1, 2), Q(1, 3) * Q(1, 3),
267  std::sqrt(2) * Q(1, 1) * Q(1, 2), std::sqrt(2) * Q(1, 2) * Q(1, 3),
268  std::sqrt(2) * Q(1, 1) * Q(1, 3), Q(2, 1) * Q(2, 1), Q(2, 2) * Q(2, 2),
269  Q(2, 3) * Q(2, 3), std::sqrt(2) * Q(2, 1) * Q(2, 2),
270  std::sqrt(2) * Q(2, 2) * Q(2, 3), std::sqrt(2) * Q(2, 1) * Q(2, 3),
271  Q(3, 1) * Q(3, 1), Q(3, 2) * Q(3, 2), Q(3, 3) * Q(3, 3),
272  std::sqrt(2) * Q(3, 1) * Q(3, 2), std::sqrt(2) * Q(3, 2) * Q(3, 3),
273  std::sqrt(2) * Q(3, 1) * Q(3, 3), std::sqrt(2) * Q(1, 1) * Q(2, 1),
274  std::sqrt(2) * Q(1, 2) * Q(2, 2), std::sqrt(2) * Q(1, 3) * Q(2, 3),
275  Q(1, 1) * Q(2, 2) + Q(1, 2) * Q(2, 1),
276  Q(1, 2) * Q(2, 3) + Q(1, 3) * Q(2, 2),
277  Q(1, 1) * Q(2, 3) + Q(1, 3) * Q(2, 1), std::sqrt(2) * Q(2, 1) * Q(3, 1),
278  std::sqrt(2) * Q(2, 2) * Q(3, 2), std::sqrt(2) * Q(2, 3) * Q(3, 3),
279  Q(2, 1) * Q(3, 2) + Q(2, 2) * Q(3, 1),
280  Q(2, 2) * Q(3, 3) + Q(2, 3) * Q(3, 2),
281  Q(2, 1) * Q(3, 3) + Q(2, 3) * Q(3, 1), std::sqrt(2) * Q(1, 1) * Q(3, 1),
282  std::sqrt(2) * Q(1, 2) * Q(3, 2), std::sqrt(2) * Q(1, 3) * Q(3, 3),
283  Q(1, 1) * Q(3, 2) + Q(1, 2) * Q(3, 1),
284  Q(1, 2) * Q(3, 3) + Q(1, 3) * Q(3, 2),
285  Q(1, 1) * Q(3, 3) + Q(1, 3) * Q(3, 1);
286  return R;
287 }

◆ inverse() [1/3]

template<>
Eigen::Matrix<double, 4, 1, Eigen::ColMajor, 4, 1> MathLib::KelvinVector::inverse ( Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &  v)

Definition at line 34 of file KelvinVector.cpp.

36 {
37  assert(Invariants<4>::determinant(v) != 0);
38 
39  Eigen::Matrix<double, 4, 1, Eigen::ColMajor, 4, 1> inv;
40  inv(0) = v(1) * v(2);
41  inv(1) = v(0) * v(2);
42  inv(2) = v(0) * v(1) - v(3) * v(3) / 2.;
43  inv(3) = -v(3) * v(2);
44  return inv / Invariants<4>::determinant(v);
45 }
static const double v

References MathLib::KelvinVector::Invariants< KelvinVectorSize >::determinant(), and MathLib::v.

Referenced by MaterialLib::Solids::Ehlers::calculatePlasticJacobian(), and MaterialLib::Solids::Ehlers::calculatePlasticResidual().

◆ inverse() [2/3]

template<>
Eigen::Matrix<double, 6, 1, Eigen::ColMajor, 6, 1> MathLib::KelvinVector::inverse ( Eigen::Matrix< double, 6, 1, Eigen::ColMajor, 6, 1 > const &  v)

Definition at line 48 of file KelvinVector.cpp.

50 {
51  assert(Invariants<6>::determinant(v) != 0);
52 
53  Eigen::Matrix<double, 6, 1, Eigen::ColMajor, 6, 1> inv;
54  inv(0) = v(1) * v(2) - v(4) * v(4) / 2.;
55  inv(1) = v(0) * v(2) - v(5) * v(5) / 2.;
56  inv(2) = v(0) * v(1) - v(3) * v(3) / 2.;
57  inv(3) = v(4) * v(5) / std::sqrt(2.) - v(3) * v(2);
58  inv(4) = v(3) * v(5) / std::sqrt(2.) - v(4) * v(0);
59  inv(5) = v(4) * v(3) / std::sqrt(2.) - v(1) * v(5);
60  return inv / Invariants<6>::determinant(v);
61 }

References MathLib::KelvinVector::Invariants< KelvinVectorSize >::determinant(), and MathLib::v.

◆ inverse() [3/3]

template<int KelvinVectorSize>
Eigen::Matrix<double, KelvinVectorSize, 1, Eigen::ColMajor, KelvinVectorSize, 1> MathLib::KelvinVector::inverse ( Eigen::Matrix< double, KelvinVectorSize, 1, Eigen::ColMajor, KelvinVectorSize, 1 > const &  v)

Inverse of a matrix in Kelvin vector representation. There are only implementations for the Kelvin vector size 4 and 6.

◆ kelvin_vector_dimensions()

constexpr int MathLib::KelvinVector::kelvin_vector_dimensions ( int const  displacement_dim)
constexpr

Kelvin vector dimensions for given displacement dimension.

Definition at line 23 of file KelvinVector.h.

24 {
25  if (displacement_dim == 2)
26  {
27  return 4;
28  }
29  else if (displacement_dim == 3)
30  {
31  return 6;
32  }
33  OGS_FATAL(
34  "Cannot convert displacement dimension {} to kelvin vector dimension.",
35  displacement_dim);
36 }
#define OGS_FATAL(...)
Definition: Error.h:26

References OGS_FATAL.

Referenced by ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::HydroMechanicsLocalAssembler(), ProcessLib::RichardsMechanics::IntegrationPointData< BMatricesType, ShapeMatrixTypeDisplacement, ShapeMatricesTypePressure, DisplacementDim, NPoints >::IntegrationPointData(), ProcessLib::TH2M::IntegrationPointData< BMatricesType, ShapeMatrixTypeDisplacement, ShapeMatricesTypePressure, DisplacementDim, NPoints >::IntegrationPointData(), ProcessLib::ThermoHydroMechanics::IntegrationPointData< BMatricesType, ShapeMatrixTypeDisplacement, ShapeMatricesTypePressure, DisplacementDim, NPoints >::IntegrationPointData(), ProcessLib::ThermoRichardsMechanics::IntegrationPointData< BMatricesType, ShapeMatrixTypeDisplacement, ShapeMatricesTypePressure, DisplacementDim, NPoints >::IntegrationPointData(), ProcessLib::PhaseField::PhaseFieldLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::PhaseFieldLocalAssembler(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::SmallDeformationLocalAssembler(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrix< ShapeFunction, IntegrationMethod, DisplacementDim >::SmallDeformationLocalAssemblerMatrix(), ProcessLib::LIE::SmallDeformation::SmallDeformationLocalAssemblerMatrixNearFracture< ShapeFunction, IntegrationMethod, DisplacementDim >::SmallDeformationLocalAssemblerMatrixNearFracture(), ProcessLib::SmallDeformationNonlocal::SmallDeformationNonlocalLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::SmallDeformationNonlocalLocalAssembler(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::ThermoMechanicalPhaseFieldLocalAssembler(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::ThermoMechanicsLocalAssembler(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assemble(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assembleWithJacobianForDeformationEquations(), ProcessLib::ThermoMechanicalPhaseField::ThermoMechanicalPhaseFieldLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::assembleWithJacobianForHeatConductionEquations(), MaterialLib::Solids::Ehlers::calculateDResidualDEps(), MaterialLib::Solids::Phasefield::calculateIsotropicDegradedStress(), MaterialLib::Solids::Ehlers::calculatePlasticJacobian(), MaterialLib::Solids::Ehlers::calculatePlasticResidual(), MaterialLib::Solids::Phasefield::calculateVolDevDegradedStress(), ProcessLib::LinearBMatrix::computeBMatrix(), ProcessLib::RichardsMechanics::computeMicroPorosity(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::RichardsMechanics::createRichardsMechanicsProcess(), ProcessLib::SmallDeformation::createSmallDeformationProcess(), ProcessLib::TH2M::createTH2MProcess(), ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess(), ProcessLib::ThermoMechanics::createThermoMechanicsProcess(), ProcessLib::ThermoRichardsMechanics::createThermoRichardsMechanicsProcess(), MaterialLib::Solids::MFront::MFront< DisplacementDim >::getBulkModulus(), MaterialLib::Solids::LinearElasticOrthotropic< DisplacementDim >::getElasticTensor(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getEpsilon(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getEpsilon(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getEpsilon(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getEpsilon(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::getEpsilon(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::getEpsilon(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::getEpsilonMechanical(), ProcessLib::getIntegrationPointKelvinVectorData(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getIntPtSwellingStress(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::getIntPtSwellingStress(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getSigma(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getSigma(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getSigma(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::getSigma(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::getSigma(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getSwellingStress(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::getSwellingStress(), ProcessLib::HydroMechanics::HydroMechanicsProcess< DisplacementDim >::initializeConcreteProcess(), MaterialLib::Solids::Ehlers::SolidEhlers< DisplacementDim >::integrateStress(), MaterialLib::Solids::MFront::MFront< DisplacementDim >::integrateStress(), MaterialLib::Solids::Ehlers::predict_sigma(), ProcessLib::setIntegrationPointKelvinVectorData(), symmetricTensorToKelvinVector(), MaterialLib::Solids::Lubby2::tangentStiffnessA(), and ProcessLib::RichardsMechanics::updateSwellingStressAndVolumetricStrain().

◆ kelvinVectorToSymmetricTensor() [1/4]

template<>
Eigen::Matrix<double, 4, 1> MathLib::KelvinVector::kelvinVectorToSymmetricTensor ( Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &  v)

Definition at line 142 of file KelvinVector.cpp.

144 {
145  Eigen::Matrix<double, 4, 1> m;
146  m << v[0], v[1], v[2], v[3] / std::sqrt(2.);
147  return m;
148 }

References MathLib::v.

Referenced by ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assemble(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::assembleWithJacobian(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::assembleWithJacobianForPressureEquations(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::computeSecondaryVariableConcrete(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getEpsilon(), ProcessLib::getIntegrationPointKelvinVectorData(), MaterialLib::Solids::Ehlers::SolidEhlers< DisplacementDim >::getInternalVariables(), ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getIntPtDarcyVelocity(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getIntPtDarcyVelocity(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getIntPtDarcyVelocityGas(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getIntPtDarcyVelocityLiquid(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::getIntPtSwellingStress(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::getIntPtSwellingStress(), and ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::updateConstitutiveVariables().

◆ kelvinVectorToSymmetricTensor() [2/4]

template<>
Eigen::Matrix<double, 6, 1> MathLib::KelvinVector::kelvinVectorToSymmetricTensor ( Eigen::Matrix< double, 6, 1, Eigen::ColMajor, 6, 1 > const &  v)

Definition at line 151 of file KelvinVector.cpp.

153 {
154  Eigen::Matrix<double, 6, 1> m;
155  m << v[0], v[1], v[2], v[3] / std::sqrt(2.), v[4] / std::sqrt(2.),
156  v[5] / std::sqrt(2.);
157  return m;
158 }

References MathLib::v.

◆ kelvinVectorToSymmetricTensor() [3/4]

template<>
Eigen::Matrix<double, Eigen::Dynamic, 1, Eigen::ColMajor, Eigen::Dynamic, 1> MathLib::KelvinVector::kelvinVectorToSymmetricTensor ( Eigen::Matrix< double, Eigen::Dynamic, 1, Eigen::ColMajor, Eigen::Dynamic, 1 > const &  v)

Definition at line 162 of file KelvinVector.cpp.

168 {
169  if (v.size() == 4)
170  {
171  return kelvinVectorToSymmetricTensor<4>(v);
172  }
173  if (v.size() == 6)
174  {
175  return kelvinVectorToSymmetricTensor<6>(v);
176  }
177  OGS_FATAL(
178  "Kelvin vector to tensor conversion expected an input vector of size 4 "
179  "or 6, but a vector of size {:d} was given.",
180  v.size());
181 }

◆ kelvinVectorToSymmetricTensor() [4/4]

template<int KelvinVectorSize>
Eigen::Matrix<double, KelvinVectorSize, 1, Eigen::ColMajor, KelvinVectorSize, 1> MathLib::KelvinVector::kelvinVectorToSymmetricTensor ( Eigen::Matrix< double, KelvinVectorSize, 1, Eigen::ColMajor, KelvinVectorSize, 1 > const &  v)

Conversion of a Kelvin vector to a short vector representation of a symmetric 3x3 matrix.

In the 2D case the entries for the xx, yy, zz, and xy components are stored. In the 3D case the entries for the xx, yy, zz, xy, yz, and xz components in that particular order are stored.

This is opposite of the symmetricTensorToKelvinVector()

Only implementations for KelvinVectorSize 4 and 6, and dynamic size vectors are provided.

◆ kelvinVectorToTensor() [1/4]

◆ kelvinVectorToTensor() [2/4]

template<>
Eigen::Matrix<double, 3, 3> MathLib::KelvinVector::kelvinVectorToTensor ( Eigen::Matrix< double, 6, 1, Eigen::ColMajor, 6, 1 > const &  v)

Definition at line 74 of file KelvinVector.cpp.

76 {
77  Eigen::Matrix<double, 3, 3> m;
78  m << v[0], v[3] / std::sqrt(2.), v[5] / std::sqrt(2.), v[3] / std::sqrt(2.),
79  v[1], v[4] / std::sqrt(2.), v[5] / std::sqrt(2.), v[4] / std::sqrt(2.),
80  v[2];
81  return m;
82 }

References MathLib::v.

◆ kelvinVectorToTensor() [3/4]

template<>
Eigen::Matrix<double, 3, 3> MathLib::KelvinVector::kelvinVectorToTensor ( Eigen::Matrix< double, Eigen::Dynamic, 1, Eigen::ColMajor, Eigen::Dynamic, 1 > const &  v)

Definition at line 85 of file KelvinVector.cpp.

91 {
92  if (v.size() == 4)
93  {
94  Eigen::Matrix<double, 4, 1, Eigen::ColMajor, 4, 1> v4;
95  v4 << v[0], v[1], v[2], v[3];
96  return kelvinVectorToTensor(v4);
97  }
98  if (v.size() == 6)
99  {
100  Eigen::Matrix<double, 6, 1, Eigen::ColMajor, 6, 1> v6;
101  v6 << v[0], v[1], v[2], v[3], v[4], v[5];
102  return kelvinVectorToTensor(v6);
103  }
104  OGS_FATAL(
105  "Conversion of dynamic Kelvin vector of size {:d} to a tensor is not "
106  "possible. Kelvin vector must be of size 4 or 6.",
107  v.size());
108 }
Eigen::Matrix< double, 3, 3 > kelvinVectorToTensor(Eigen::Matrix< double, Eigen::Dynamic, 1, Eigen::ColMajor, Eigen::Dynamic, 1 > const &v)

References kelvinVectorToTensor(), OGS_FATAL, and MathLib::v.

◆ kelvinVectorToTensor() [4/4]

template<int KelvinVectorSize>
Eigen::Matrix<double, 3, 3> MathLib::KelvinVector::kelvinVectorToTensor ( Eigen::Matrix< double, KelvinVectorSize, 1, Eigen::ColMajor, KelvinVectorSize, 1 > const &  v)

Conversion of a Kelvin vector to a 3x3 matrix Only implementations for KelvinVectorSize 4 and 6 are provided.

◆ liftVectorToKelvin()

template<int DisplacementDim>
Eigen::Matrix<double, DisplacementDim, kelvin_vector_dimensions(DisplacementDim)> MathLib::KelvinVector::liftVectorToKelvin ( Eigen::Matrix< double, DisplacementDim, 1 > const &  v)

Lifting of a vector to a Kelvin matrix. \( a -> A\) s.t. \(k_{ij} a_{j} = A_[\alpha\beta} k_{\beta} \). Conversion for 2D -> 4D and 3D -> 6D are implemented.

◆ liftVectorToKelvin< 2 >()

template<>
Eigen::Matrix<double, 2, 4> MathLib::KelvinVector::liftVectorToKelvin< 2 > ( Eigen::Matrix< double, 2, 1 > const &  v)

Definition at line 162 of file KelvinVector.cpp.

186 {
187  Eigen::Matrix<double, 2, 4> m;
188  m << v[0], 0, 0, v[1] / std::sqrt(2.), 0, v[1], 0, v[0] / std::sqrt(2.);
189  return m;
190 }

◆ liftVectorToKelvin< 3 >()

template<>
Eigen::Matrix<double, 3, 6> MathLib::KelvinVector::liftVectorToKelvin< 3 > ( Eigen::Matrix< double, 3, 1 > const &  v)

Definition at line 162 of file KelvinVector.cpp.

195 {
196  Eigen::Matrix<double, 3, 6> m;
197  m << v[0], 0, 0, v[1] / std::sqrt(2.), 0, v[2] / std::sqrt(2.), 0, v[1], 0,
198  v[0] / std::sqrt(2.), v[2] / std::sqrt(2.), 0, 0, 0, v[2], 0,
199  v[1] / std::sqrt(2.), v[0] / std::sqrt(2.);
200  return m;
201 }

◆ reduceKelvinToVector()

template<int DisplacementDim>
Eigen::Matrix<double, DisplacementDim, 1> MathLib::KelvinVector::reduceKelvinToVector ( Eigen::Matrix< double, DisplacementDim, kelvin_vector_dimensions(DisplacementDim)> const &  m)

Reducing a Kelvin matrix to a vector. Conversion for 4D -> 2D and 6D -> 3D are implemented.

◆ reduceKelvinToVector< 2 >()

template<>
Eigen::Matrix<double, 2, 1> MathLib::KelvinVector::reduceKelvinToVector< 2 > ( Eigen::Matrix< double, 2, 4 > const &  m)

Definition at line 162 of file KelvinVector.cpp.

206 {
207  assert(m(0, 1) == 0);
208  assert(m(0, 2) == 0);
209  assert(m(1, 0) == 0);
210  assert(m(1, 2) == 0);
211  Eigen::Matrix<double, 2, 1> v;
212  v << m(0, 0), m(1, 1);
213  return v;
214 }

◆ reduceKelvinToVector< 3 >()

template<>
Eigen::Matrix<double, 3, 1> MathLib::KelvinVector::reduceKelvinToVector< 3 > ( Eigen::Matrix< double, 3, 6 > const &  m)

Definition at line 162 of file KelvinVector.cpp.

219 {
220  assert(m(0, 1) == 0);
221  assert(m(0, 2) == 0);
222  assert(m(0, 4) == 0);
223  assert(m(1, 0) == 0);
224  assert(m(1, 2) == 0);
225  assert(m(1, 5) == 0);
226  assert(m(2, 0) == 0);
227  assert(m(2, 1) == 0);
228  assert(m(2, 3) == 0);
229  assert(std::abs(m(0, 3) - m(2, 4)) <
230  std::numeric_limits<double>::epsilon());
231  assert(std::abs(m(0, 5) - m(1, 4)) <
232  std::numeric_limits<double>::epsilon());
233  assert(std::abs(m(1, 3) - m(2, 5)) <
234  std::numeric_limits<double>::epsilon());
235  Eigen::Matrix<double, 3, 1> v;
236  v << m(0, 0), m(1, 1), m(2, 2);
237  return v;
238 }

◆ symmetricTensorToKelvinVector() [1/2]

template<typename Derived >
Eigen::Matrix<double, Eigen::MatrixBase<Derived>::RowsAtCompileTime, 1> MathLib::KelvinVector::symmetricTensorToKelvinVector ( Eigen::MatrixBase< Derived > const &  v)

Conversion of a short vector representation of a symmetric 3x3 matrix to a Kelvin vector.

This is opposite of the kelvinVectorToSymmetricTensor()

Only implementations for KelvinVectorSize 4 and 6, and dynamic size vectors are provided.

Definition at line 170 of file KelvinVector.h.

171 {
172  static_assert(
173  (Eigen::MatrixBase<Derived>::ColsAtCompileTime == 1) ||
174  (Eigen::MatrixBase<Derived>::ColsAtCompileTime == Eigen::Dynamic),
175  "KelvinVector must be a column vector");
176  if (v.cols() != 1)
177  {
178  OGS_FATAL(
179  "KelvinVector must be a column vector, but input has {:d} columns.",
180  v.cols());
181  }
182 
183  Eigen::Matrix<double, Eigen::MatrixBase<Derived>::RowsAtCompileTime, 1>
184  result;
185  if (v.rows() == 4)
186  {
187  result.resize(4, 1);
188  result << v[0], v[1], v[2], v[3] * std::sqrt(2.);
189  }
190  else if (v.rows() == 6)
191  {
192  result.resize(6, 1);
193  result << v[0], v[1], v[2], v[3] * std::sqrt(2.), v[4] * std::sqrt(2.),
194  v[5] * std::sqrt(2.);
195  }
196  else
197  {
198  OGS_FATAL(
199  "Symmetric tensor to Kelvin vector conversion expected an input "
200  "vector of size 4 or 6, but a vector of size {:d} was given.",
201  v.size());
202  }
203  return result;
204 }

References OGS_FATAL, and MathLib::v.

Referenced by ProcessLib::HydroMechanics::HydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::SmallDeformation::SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::ThermoHydroMechanics::ThermoHydroMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::ThermoRichardsMechanics::ThermoRichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunction, IntegrationMethod, DisplacementDim >::initializeConcrete(), ProcessLib::setIntegrationPointKelvinVectorData(), and symmetricTensorToKelvinVector().

◆ symmetricTensorToKelvinVector() [2/2]

template<int DisplacementDim>
KelvinVectorType<DisplacementDim> MathLib::KelvinVector::symmetricTensorToKelvinVector ( std::vector< double > const &  values)

Conversion of a short vector representation of a symmetric 3x3 matrix to a Kelvin vector.

This overload takes a std::vector for the tensor values.

Definition at line 211 of file KelvinVector.h.

213 {
214  constexpr int kelvin_vector_size =
215  kelvin_vector_dimensions(DisplacementDim);
216 
217  if (values.size() != kelvin_vector_size)
218  {
219  OGS_FATAL(
220  "Symmetric tensor to Kelvin vector conversion expected an input "
221  "vector of size {:d}, but a vector of size {:d} was given.",
222  kelvin_vector_size, values.size());
223  }
224 
226  Eigen::Map<typename MathLib::KelvinVector::KelvinVectorType<
227  DisplacementDim> const>(
228  values.data(), kelvin_vector_dimensions(DisplacementDim), 1));
229 }
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
Definition: KelvinVector.h:48
KelvinVectorType< DisplacementDim > symmetricTensorToKelvinVector(std::vector< double > const &values)
Definition: KelvinVector.h:211
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.
Definition: KelvinVector.h:23

References kelvin_vector_dimensions(), OGS_FATAL, and symmetricTensorToKelvinVector().

◆ tensorToKelvin()

template<int DisplacementDim>
KelvinVectorType<DisplacementDim> MathLib::KelvinVector::tensorToKelvin ( Eigen::Matrix< double, 3, 3 > const &  m)

Conversion of a 3x3 matrix to a Kelvin vector. Only implementations for KelvinVectorSize 4 and 6 are provided.

Referenced by ProcessLib::TH2M::TH2MLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod, DisplacementDim >::updateConstitutiveVariables().

◆ tensorToKelvin< 2 >()

template<>
KelvinVectorType<2> MathLib::KelvinVector::tensorToKelvin< 2 > ( Eigen::Matrix< double, 3, 3 > const &  m)

Definition at line 85 of file KelvinVector.cpp.

112 {
113  assert(std::abs(m(0, 1) - m(1, 0)) <
114  std::numeric_limits<double>::epsilon());
115  assert(m(0, 2) == 0);
116  assert(m(1, 2) == 0);
117  assert(m(2, 0) == 0);
118  assert(m(2, 1) == 0);
119 
120  KelvinVectorType<2> v;
121  v << m(0, 0), m(1, 1), m(2, 2), m(0, 1) * std::sqrt(2.);
122  return v;
123 }

◆ tensorToKelvin< 3 >()

template<>
KelvinVectorType<3> MathLib::KelvinVector::tensorToKelvin< 3 > ( Eigen::Matrix< double, 3, 3 > const &  m)

Definition at line 85 of file KelvinVector.cpp.

127 {
128  assert(std::abs(m(0, 1) - m(1, 0)) <
129  std::numeric_limits<double>::epsilon());
130  assert(std::abs(m(1, 2) - m(2, 1)) <
131  std::numeric_limits<double>::epsilon());
132  assert(std::abs(m(0, 2) - m(2, 0)) <
133  std::numeric_limits<double>::epsilon());
134 
135  KelvinVectorType<3> v;
136  v << m(0, 0), m(1, 1), m(2, 2), m(0, 1) * std::sqrt(2.),
137  m(1, 2) * std::sqrt(2.), m(0, 2) * std::sqrt(2.);
138  return v;
139 }