mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Corrected non-orthogonal check for single-precision.
This commit is contained in:
@ -45,37 +45,20 @@ void Foam::coordinateRotation::calcTransform
|
|||||||
const axisOrder& order
|
const axisOrder& order
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const scalar orthogonalityError = 1.0e-8;
|
|
||||||
|
|
||||||
vector a = axis1 / mag(axis1);
|
vector a = axis1 / mag(axis1);
|
||||||
vector b = axis2;
|
vector b = axis2;
|
||||||
|
|
||||||
// Absorb minor nonorthogonality into axis2
|
// Absorb minor nonorthogonality into axis2
|
||||||
b = b - (b & a)*a;
|
b = b - (b & a)*a;
|
||||||
|
|
||||||
if (mag(b) < orthogonalityError)
|
if (mag(b) < SMALL)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn("coordinateRotation::calcTransform()")
|
||||||
(
|
|
||||||
"coordinateRotation::calcTransform()"
|
|
||||||
)
|
|
||||||
<< "axis1, axis2 appear co-linear: "
|
<< "axis1, axis2 appear co-linear: "
|
||||||
<< axis1 << ", " << axis2 << endl
|
<< axis1 << ", " << axis2 << endl
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
// this error check is probably no longer required
|
|
||||||
if (mag(a & b)/(mag(a)*mag(b)) >= orthogonalityError)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"coordinateRotation::calcTransform()"
|
|
||||||
)
|
|
||||||
<< "coordinate system nonorthogonality " << nl
|
|
||||||
<< "mag(axis1 & axis2) = " << mag(a & b)
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
b = b / mag(b);
|
b = b / mag(b);
|
||||||
vector c = a ^ b;
|
vector c = a ^ b;
|
||||||
|
|
||||||
@ -102,10 +85,7 @@ void Foam::coordinateRotation::calcTransform
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
FatalErrorIn
|
FatalErrorIn("coordinateRotation::calcTransform()")
|
||||||
(
|
|
||||||
"coordinateRotation::calcTransform()"
|
|
||||||
)
|
|
||||||
<< "programmer error" << endl
|
<< "programmer error" << endl
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
break;
|
break;
|
||||||
@ -241,4 +221,5 @@ void Foam::coordinateRotation::operator=(const dictionary& rhs)
|
|||||||
calcTransform(axis1, axis2, order);
|
calcTransform(axis1, axis2, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
Reference in New Issue
Block a user