mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-26 03:00:17 -06:00
fuzzycomparevtu.py: take the single precision floating point values into account
the vtu files use single precision floats, which has six digits. we say the value for pressure is equal if the first five digits are identical.
This commit is contained in:
parent
73b1fa0594
commit
2e92139577
@ -35,7 +35,7 @@ def isFuzzyEqual(vtkFile1, vtkFile2, absTol, relTol):
|
||||
if curFieldName.startswith("saturation") and abs(number1 - number2) > 1e-3:
|
||||
print 'Difference between %f and %f too large in data field "%s: %s"'%(number1,number2,curFieldName,abs(number1 - number2))
|
||||
return False
|
||||
elif curFieldName.startswith("pressure") and abs(number1 - number2) > 0.1:
|
||||
elif curFieldName.startswith("pressure") and abs(number1 - number2) > 0.1 and abs(number1 - number2) > 1e-5*abs(number1 + number2):
|
||||
print 'Difference between %f and %f too large in data field "%s: %s"'%(number1,number2,curFieldName,abs(number1 - number2))
|
||||
return False
|
||||
elif abs(number1 - number2) > absTol and number2 != 0 and abs(number1/number2 - 1) > relTol:
|
||||
|
Loading…
Reference in New Issue
Block a user