Skip to content
Snippets Groups Projects
Commit b0cf16b9 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[ParL] Add orthogonality check of transformations

parent dfcd800e
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <limits> #include <limits>
#include <typeinfo> #include <typeinfo>
#include "MathLib/FormattingUtils.h"
#include "Parameter.h" #include "Parameter.h"
namespace ParameterLib namespace ParameterLib
...@@ -41,6 +42,18 @@ static void checkTransformationIsSON( ...@@ -41,6 +42,18 @@ static void checkTransformationIsSON(
"system bases", "system bases",
t.determinant(), tolerance); t.determinant(), tolerance);
} }
if (((t * t.transpose() - Eigen::Matrix<double, Dim, Dim>::Identity())
.array() > 2 * tolerance)
.any())
{
OGS_FATAL(
"The transformation is not orthogonal because the difference "
"A*A^T - I is:\n{}\nand at least one component deviates from zero "
"by more then '{:g}'.",
(t * t.transpose() - Eigen::Matrix<double, Dim, Dim>::Identity())
.eval(),
2 * tolerance);
}
} }
CoordinateSystem::CoordinateSystem(Parameter<double> const& unit_direction) CoordinateSystem::CoordinateSystem(Parameter<double> const& unit_direction)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment