OGS
VectorizedTensor.cpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2
// SPDX-License-Identifier: BSD-3-Clause
3
4
#include "
VectorizedTensor.h
"
5
6
namespace
MathLib::VectorizedTensor
7
{
8
9
bool
isTensorConvertibleTo1d
(Eigen::Matrix3d
const
& tensor)
10
{
11
return
(tensor(0, 1) == 0. && tensor(1, 0) == 0. &&
//
12
tensor(0, 2) == 0. && tensor(2, 0) == 0. &&
//
13
tensor(1, 2) == 0. && tensor(2, 1) == 0.);
14
}
15
16
bool
isTensorConvertibleTo2d
(Eigen::Matrix3d
const
& tensor)
17
{
18
return
(tensor(0, 2) == 0. && tensor(1, 2) == 0. &&
//
19
tensor(2, 0) == 0. && tensor(2, 1) == 0.);
20
}
21
22
}
// namespace MathLib::VectorizedTensor
VectorizedTensor.h
MathLib::VectorizedTensor
Definition
VectorizedTensor.cpp:7
MathLib::VectorizedTensor::isTensorConvertibleTo2d
bool isTensorConvertibleTo2d(Eigen::Matrix3d const &tensor)
Definition
VectorizedTensor.cpp:16
MathLib::VectorizedTensor::isTensorConvertibleTo1d
bool isTensorConvertibleTo1d(Eigen::Matrix3d const &tensor)
Only a diagonal tensor can be converted to a 1d vectorized tensor.
Definition
VectorizedTensor.cpp:9
MathLib
VectorizedTensor.cpp
Generated by
1.14.0