Work-around for strange floating point exception; probably optimisation failure
This commit is contained in:
parent
7dca0eb9e4
commit
0aa01c3dc7
1 changed files with 8 additions and 4 deletions
|
@ -191,12 +191,16 @@ void regionCoupleFvPatchField<Type>::evaluate
|
||||||
scalar mOwn = magFOwn[faceI];
|
scalar mOwn = magFOwn[faceI];
|
||||||
scalar mNei = magFNei[faceI];
|
scalar mNei = magFNei[faceI];
|
||||||
|
|
||||||
scalar den = mOwn - mNei;
|
scalar den1 = mOwn + mNei;
|
||||||
|
scalar den2 = mOwn - mNei;
|
||||||
|
|
||||||
if (mag(den) > SMALL)
|
// Strange optimisation check: floating point failure if only
|
||||||
|
// checking for den2. den1 check should not be needed
|
||||||
|
// HJ, 24/Aug/2011
|
||||||
|
if (mag(den1) > SMALL && mag(den2) > SMALL)
|
||||||
{
|
{
|
||||||
scalar mean = 2.0*mOwn*mNei/(mOwn + mNei);
|
scalar mean = 2.0*mOwn*mNei/den1;
|
||||||
weights[faceI] = (mean - mNei)/den;
|
weights[faceI] = (mean - mNei)/den2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Reference in a new issue