OGS
FormKelvinVector.cpp
Go to the documentation of this file.
1
12#include "FormKelvinVector.h"
13
14#include "BaseLib/Error.h"
15
16namespace MaterialPropertyLib
17{
18static constexpr const char error_info[] =
19 "The conversion to a Kelvin vector of correct dimensionality is ambiguous."
20 "Please use a scalar number for isotropic properties, a three element "
21 "array or a 3 x 3 matrix for anisotropic properties.";
22
23template <int GlobalDim>
25{
27 double const& value) const
28 {
31 result.template head<3>() = Eigen::Vector3d::Constant(value);
32 return result;
33 }
34
36 Eigen::Matrix<double, 2, 1> const& /*values*/) const
37 {
39 }
40
42 Eigen::Matrix<double, 3, 1> const& values) const
43 {
46 result.template head<3>() = values;
47 return result;
48 }
49
51 Eigen::Matrix<double, 2, 2> const& /*values*/) const
52 {
54 }
55
57 Eigen::Matrix<double, 3, 3> const& values) const
58 {
60 }
61
63 Eigen::Matrix<double, 4, 1> const& /*values*/) const
64 {
66 }
67
69 Eigen::Matrix<double, 6, 1> const& /*values*/) const
70 {
72 }
73
75 Eigen::MatrixXd const& /*values*/) const
76 {
78 }
79};
80
81template <int GlobalDim>
87
90
93
94} // namespace MaterialPropertyLib
#define OGS_FATAL(...)
Definition Error.h:26
MathLib::KelvinVector::KelvinVectorType< GlobalDim > formKelvinVector(MaterialPropertyLib::PropertyDataType const &values)
A function to form a Kelvin vector from strain or stress alike property like thermal expansivity for ...
template MathLib::KelvinVector::KelvinVectorType< 2 > formKelvinVector< 2 >(MaterialPropertyLib::PropertyDataType const &values)
template MathLib::KelvinVector::KelvinVectorType< 3 > formKelvinVector< 3 >(MaterialPropertyLib::PropertyDataType const &values)
static constexpr const char error_info[]
std::variant< double, Eigen::Matrix< double, 2, 1 >, Eigen::Matrix< double, 3, 1 >, Eigen::Matrix< double, 2, 2 >, Eigen::Matrix< double, 3, 3 >, Eigen::Matrix< double, 4, 1 >, Eigen::Matrix< double, 6, 1 >, Eigen::MatrixXd > PropertyDataType
Definition Property.h:31
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
KelvinVectorType< DisplacementDim > tensorToKelvin(Eigen::Matrix< double, 3, 3 > const &m)
MathLib::KelvinVector::KelvinVectorType< GlobalDim > operator()(Eigen::Matrix< double, 4, 1 > const &) const
MathLib::KelvinVector::KelvinVectorType< GlobalDim > operator()(double const &value) const
MathLib::KelvinVector::KelvinVectorType< GlobalDim > operator()(Eigen::Matrix< double, 2, 1 > const &) const
MathLib::KelvinVector::KelvinVectorType< GlobalDim > operator()(Eigen::Matrix< double, 3, 1 > const &values) const
MathLib::KelvinVector::KelvinVectorType< GlobalDim > operator()(Eigen::Matrix< double, 6, 1 > const &) const
MathLib::KelvinVector::KelvinVectorType< GlobalDim > operator()(Eigen::Matrix< double, 2, 2 > const &) const
MathLib::KelvinVector::KelvinVectorType< GlobalDim > operator()(Eigen::Matrix< double, 3, 3 > const &values) const
MathLib::KelvinVector::KelvinVectorType< GlobalDim > operator()(Eigen::MatrixXd const &) const