Definition at line 26 of file CoordinateSystem.h.
#include <CoordinateSystem.h>
|
| CoordinateSystem (Parameter< double > const &e0, Parameter< double > const &e1) |
|
| CoordinateSystem (Parameter< double > const &e0, Parameter< double > const &e1, Parameter< double > const &e2) |
|
template<int Dimension> |
Eigen::Matrix< double, Dimension, Dimension > | transformation (SpatialPosition const &pos) const |
|
Eigen::Matrix< double, 3, 3 > | transformation_3d (SpatialPosition const &pos) const |
|
template<int Dimension> |
Eigen::Matrix< double, Dimension, Dimension > | rotateTensor (std::vector< double > const &values, SpatialPosition const &pos) const |
|
template<int Dimension> |
Eigen::Matrix< double, Dimension, Dimension > | rotateDiagonalTensor (std::vector< double > const &values, SpatialPosition const &pos) const |
|
template<> |
Eigen::Matrix< double, 2, 2 > | transformation (SpatialPosition const &pos) const |
|
template<> |
Eigen::Matrix< double, 3, 3 > | transformation (SpatialPosition const &pos) const |
|
◆ CoordinateSystem() [1/2]
ParameterLib::CoordinateSystem::CoordinateSystem |
( |
Parameter< double > const & |
e0, |
|
|
Parameter< double > const & |
e1 |
|
) |
| |
Definition at line 25 of file CoordinateSystem.cpp.
27 :
_base{&e0, &e1,
nullptr}
28{
30 {
32 "The parameter types for the basis must be equal but they are "
33 "'{:s}' and '{:s}'.",
36 }
37 if (
_base[0]->isTimeDependent() ||
_base[1]->isTimeDependent())
38 {
39 OGS_FATAL(
"The parameters for the basis must not be time dependent.");
40 }
41 if (
_base[0]->getNumberOfGlobalComponents() != 2 ||
42 _base[1]->getNumberOfGlobalComponents() != 2)
43 {
44 OGS_FATAL(
"The parameters for the 2D basis must have two components.");
45 }
46}
std::array< Parameter< double > const *, 3 > _base
References _base, MaterialPropertyLib::name, and OGS_FATAL.
◆ CoordinateSystem() [2/2]
ParameterLib::CoordinateSystem::CoordinateSystem |
( |
Parameter< double > const & |
e0, |
|
|
Parameter< double > const & |
e1, |
|
|
Parameter< double > const & |
e2 |
|
) |
| |
Definition at line 48 of file CoordinateSystem.cpp.
51 :
_base{&e0, &e1, &e2}
52{
56 {
58 "The parameter types for the basis must be equal but they are "
59 "'{:s}', '{:s}', and '{:s}'.",
63 }
64 if (
_base[0]->isTimeDependent() ||
_base[1]->isTimeDependent(),
65 _base[2]->isTimeDependent())
66 {
67 OGS_FATAL(
"The parameters for the basis must not be time dependent.");
68 }
69 if (
_base[0]->getNumberOfGlobalComponents() != 3 ||
70 _base[1]->getNumberOfGlobalComponents() != 3 ||
71 _base[2]->getNumberOfGlobalComponents() != 3)
72 {
74 "The parameters for the 3D basis must have three components.");
75 }
76}
References _base, MaterialPropertyLib::name, and OGS_FATAL.
◆ rotateDiagonalTensor()
template<int Dimension>
template Eigen::Matrix< double, 3, 3 > ParameterLib::CoordinateSystem::rotateDiagonalTensor< 3 > |
( |
std::vector< double > const & |
values, |
|
|
SpatialPosition const & |
pos |
|
) |
| const |
Definition at line 166 of file CoordinateSystem.cpp.
168{
169 assert(values.size() == Dimension ||
170 "Input vector has wrong dimension; expected 2 or 3 entries.");
171 auto const tensor = Eigen::Map<Eigen::Matrix<double, Dimension, 1> const>(
172 values.data(), Dimension, 1);
173 auto const R = transformation<Dimension>(pos);
174 return R * tensor.asDiagonal() * R.transpose();
175}
◆ rotateTensor()
template<int Dimension>
template Eigen::Matrix< double, 3, 3 > ParameterLib::CoordinateSystem::rotateTensor< 3 > |
( |
std::vector< double > const & |
values, |
|
|
SpatialPosition const & |
pos |
|
) |
| const |
Definition at line 152 of file CoordinateSystem.cpp.
154{
155 assert(values.size() == Dimension * Dimension ||
156 "Input vector has wrong dimension; expected 4 or 9 entries.");
157 auto const tensor =
158 Eigen::Map<Eigen::Matrix<double, Dimension, Dimension> const>(
159 values.data(), Dimension, Dimension);
160 auto const R = transformation<Dimension>(pos);
161 return R * tensor * R.transpose();
162}
◆ transformation() [1/3]
template<>
Eigen::Matrix< double, 2, 2 > ParameterLib::CoordinateSystem::transformation |
( |
SpatialPosition const & |
pos | ) |
const |
Definition at line 48 of file CoordinateSystem.cpp.
81{
82 if (
_base[2] !=
nullptr)
83 {
85 "The coordinate system is 3D but a transformation for 2D case is "
86 "requested.");
87 }
88
89 auto e0 = (*
_base[0])(0 , pos);
90 auto e1 = (*
_base[1])(0 , pos);
91 Eigen::Matrix<double, 2, 2>
t;
92 t << e0[0], e1[0], e0[1], e1[1];
93
94#ifndef NDEBUG
96 {
98 }
99#endif
101}
static double const tolerance
static const char *const error_info
◆ transformation() [2/3]
template<>
Eigen::Matrix< double, 3, 3 > ParameterLib::CoordinateSystem::transformation |
( |
SpatialPosition const & |
pos | ) |
const |
Definition at line 48 of file CoordinateSystem.cpp.
106{
107 if (
_base[2] ==
nullptr)
108 {
110 "The coordinate system is 2D but a transformation for 3D case is "
111 "requested.");
112 }
113
114 auto e0 = (*
_base[0])(0 , pos);
115 auto e1 = (*
_base[1])(0 , pos);
116 auto e2 = (*
_base[2])(0 , pos);
117 Eigen::Matrix<double, 3, 3>
t;
118 t << e0[0], e1[0], e2[0], e0[1], e1[1], e2[1], e0[2], e1[2], e2[2];
119
120#ifndef NDEBUG
121 if (std::abs(
t.determinant() - 1) >
tolerance)
122 {
124 }
125#endif
127}
◆ transformation() [3/3]
template<int Dimension>
Eigen::Matrix< double, Dimension, Dimension > ParameterLib::CoordinateSystem::transformation |
( |
SpatialPosition const & |
pos | ) |
const |
◆ transformation_3d()
Eigen::Matrix< double, 3, 3 > ParameterLib::CoordinateSystem::transformation_3d |
( |
SpatialPosition const & |
pos | ) |
const |
Definition at line 129 of file CoordinateSystem.cpp.
131{
132 if (
_base[2] !=
nullptr)
133 {
134 return transformation<3>(pos);
135 }
136
137 auto e0 = (*
_base[0])(0 , pos);
138 auto e1 = (*
_base[1])(0 , pos);
139 Eigen::Matrix<double, 3, 3>
t = Eigen::Matrix<double, 3, 3>::Identity();
140 t.template topLeftCorner<2, 2>() << e0[0], e1[0], e0[1], e1[1];
141
142#ifndef NDEBUG
143 if (std::abs(
t.determinant() - 1) >
tolerance)
144 {
146 }
147#endif
149}
References _base, ParameterLib::error_info, OGS_FATAL, MathLib::t, and ParameterLib::tolerance.
Referenced by MaterialPropertyLib::SaturationDependentSwelling::dValue(), and MaterialPropertyLib::SaturationDependentSwelling::value().
◆ _base
std::array<Parameter<double> const*, 3> ParameterLib::CoordinateSystem::_base |
|
private |
The documentation for this struct was generated from the following files: