OGS
VectorizedTensor.cpp
Go to the documentation of this file.
1
10#include "VectorizedTensor.h"
11
13{
14
15bool isTensorConvertibleTo1d(Eigen::Matrix3d const& tensor)
16{
17 return (tensor(0, 1) == 0. && tensor(1, 0) == 0. && //
18 tensor(0, 2) == 0. && tensor(2, 0) == 0. && //
19 tensor(1, 2) == 0. && tensor(2, 1) == 0.);
20}
21
22bool isTensorConvertibleTo2d(Eigen::Matrix3d const& tensor)
23{
24 return (tensor(0, 2) == 0. && tensor(1, 2) == 0. && //
25 tensor(2, 0) == 0. && tensor(2, 1) == 0.);
26}
27
28} // namespace MathLib::VectorizedTensor
bool isTensorConvertibleTo2d(Eigen::Matrix3d const &tensor)
bool isTensorConvertibleTo1d(Eigen::Matrix3d const &tensor)
Only a diagonal tensor can be converted to a 1d vectorized tensor.