OGS
MaterialPropertyLib::FormEigenTensor< GlobalDim > Struct Template Reference

Detailed Description

template<int GlobalDim>
struct MaterialPropertyLib::FormEigenTensor< GlobalDim >

Definition at line 19 of file FormEigenTensor.cpp.

Public Member Functions

Eigen::Matrix< double, GlobalDim, GlobalDim > operator() (double const &value) const
 
Eigen::Matrix< double, GlobalDim, GlobalDim > operator() (Eigen::Vector2d const &values) const
 
Eigen::Matrix< double, GlobalDim, GlobalDim > operator() (Eigen::Vector3d const &values) const
 
Eigen::Matrix< double, GlobalDim, GlobalDim > operator() (Eigen::Matrix< double, 2, 2 > const &values) const
 
Eigen::Matrix< double, GlobalDim, GlobalDim > operator() (Eigen::Matrix< double, 3, 3 > const &values) const
 
Eigen::Matrix< double, GlobalDim, GlobalDim > operator() (Eigen::Matrix< double, 4, 1 > const &values) const
 
Eigen::Matrix< double, GlobalDim, GlobalDim > operator() (Eigen::Matrix< double, 6, 1 > const &values) const
 
Eigen::Matrix< double, GlobalDim, GlobalDim > operator() (Eigen::MatrixXd const &values) const
 

Member Function Documentation

◆ operator()() [1/8]

template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, GlobalDim > MaterialPropertyLib::FormEigenTensor< GlobalDim >::operator() ( double const & value) const
inline

Definition at line 21 of file FormEigenTensor.cpp.

23 {
24 return Eigen::Matrix<double, GlobalDim, GlobalDim>::Identity() * value;
25 }

◆ operator()() [2/8]

template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, GlobalDim > MaterialPropertyLib::FormEigenTensor< GlobalDim >::operator() ( Eigen::Matrix< double, 2, 2 > const & values) const
inline

Definition at line 49 of file FormEigenTensor.cpp.

51 {
52 if constexpr (GlobalDim == 2)
53 {
54 return values;
55 }
56 OGS_FATAL("Cannot convert a 2d tensor to {:d}x{:d} matrix", GlobalDim,
57 GlobalDim);
58 }
#define OGS_FATAL(...)
Definition Error.h:26

References OGS_FATAL.

◆ operator()() [3/8]

template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, GlobalDim > MaterialPropertyLib::FormEigenTensor< GlobalDim >::operator() ( Eigen::Matrix< double, 3, 3 > const & values) const
inline

Definition at line 59 of file FormEigenTensor.cpp.

61 {
62 if constexpr (GlobalDim == 3)
63 {
64 return values;
65 }
66 OGS_FATAL("Cannot convert a 3d tensor to {:d}x{:d} matrix", GlobalDim,
67 GlobalDim);
68 }

References OGS_FATAL.

◆ operator()() [4/8]

template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, GlobalDim > MaterialPropertyLib::FormEigenTensor< GlobalDim >::operator() ( Eigen::Matrix< double, 4, 1 > const & values) const
inline

Definition at line 70 of file FormEigenTensor.cpp.

72 {
73 Eigen::Matrix<double, GlobalDim, GlobalDim> result;
74 if constexpr (GlobalDim == 2)
75 { // skip the z-direction in this case
76 result << values[0], values[3], values[3], values[1];
77 }
78 if constexpr (GlobalDim == 3)
79 {
80 result << values[0], values[3], 0, values[3], values[1], 0, 0, 0,
81 values[2];
82 }
83 return result;
84 }

◆ operator()() [5/8]

template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, GlobalDim > MaterialPropertyLib::FormEigenTensor< GlobalDim >::operator() ( Eigen::Matrix< double, 6, 1 > const & values) const
inline

Definition at line 86 of file FormEigenTensor.cpp.

88 {
89 if constexpr (GlobalDim == 3)
90 {
91 Eigen::Matrix<double, GlobalDim, GlobalDim> result;
92 result << values[0], values[3], values[5], values[3], values[1],
93 values[4], values[5], values[4], values[2];
94 return result;
95 }
96
97 OGS_FATAL("Cannot convert a symmetric 3d tensor to a {}x{} matrix",
98 GlobalDim, GlobalDim);
99 }

References OGS_FATAL.

◆ operator()() [6/8]

template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, GlobalDim > MaterialPropertyLib::FormEigenTensor< GlobalDim >::operator() ( Eigen::MatrixXd const & values) const
inline

Definition at line 101 of file FormEigenTensor.cpp.

103 {
104 if (GlobalDim == values.rows() && GlobalDim == values.cols())
105 {
106 return values;
107 }
108
109 OGS_FATAL("Cannot convert a dynamic {}x{} matrix to a {}x{} matrix",
110 values.rows(), values.cols(), GlobalDim, GlobalDim);
111 }

References OGS_FATAL.

◆ operator()() [7/8]

template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, GlobalDim > MaterialPropertyLib::FormEigenTensor< GlobalDim >::operator() ( Eigen::Vector2d const & values) const
inline

Definition at line 27 of file FormEigenTensor.cpp.

29 {
30 if constexpr (GlobalDim == 2)
31 {
32 return values.asDiagonal();
33 }
34 OGS_FATAL("Cannot convert 2d vector to {:d}x{:d} diagonal matrix.",
35 GlobalDim, GlobalDim);
36 }

References OGS_FATAL.

◆ operator()() [8/8]

template<int GlobalDim>
Eigen::Matrix< double, GlobalDim, GlobalDim > MaterialPropertyLib::FormEigenTensor< GlobalDim >::operator() ( Eigen::Vector3d const & values) const
inline

Definition at line 38 of file FormEigenTensor.cpp.

40 {
41 if constexpr (GlobalDim == 3)
42 {
43 return values.asDiagonal();
44 }
45 OGS_FATAL("Cannot convert 3d vector to {:d}x{:d} diagonal matrix.",
46 GlobalDim, GlobalDim);
47 }

References OGS_FATAL.


The documentation for this struct was generated from the following file: