globalIndexAndTransform: Correction to handle rotation around a non-zero centre

This commit is contained in:
Will Bainbridge
2020-01-27 17:06:39 +00:00
parent 55b982eeea
commit 6e32ca010a

View File

@ -96,8 +96,10 @@ Foam::label Foam::globalIndexAndTransform::matchTransform
{ {
// Test the inverse transform differences too // Test the inverse transform differences too
const transformer testInvTransform = inv(testTransform);
vectorDiff = vectorDiff =
mag(refTransform.t() + testTransform.t()) mag(refTransform.t() - testInvTransform.t())
/(maxVectorMag + vSmall) /(maxVectorMag + vSmall)
/tolerance; /tolerance;
@ -106,7 +108,7 @@ Foam::label Foam::globalIndexAndTransform::matchTransform
if (refTransform.transforms() || testTransform.transforms()) if (refTransform.transforms() || testTransform.transforms())
{ {
tensorDiff = tensorDiff =
mag(refTransform.T() - testTransform.T().T()) mag(refTransform.T() - testInvTransform.T())
/sqrt(3.0) /sqrt(3.0)
/tolerance; /tolerance;
} }