lanl / LaGriT

Los Alamos Grid Toolbox (LaGriT) is a library of user callable tools that provide mesh generation, mesh optimization and dynamic mesh maintenance in two and three dimensions.
https://lanl.github.io/LaGriT/
Other
116 stars 48 forks source link

Precision differences in test/level01/pflotran_stor #252

Open millerta opened 6 months ago

millerta commented 6 months ago

New mac compilers handle floats differently resulting in precision differences for very small values. This caused one of the tests to fail and it was commented out for level01 tests and moved to test/level03/stor_precision_diff

For "degenerate" cases with 4 vertices on circumscribed circle, you can put the diagonal edge of the rectangle on either diagonal and round off may be the deciding factor. Different connection of degenerate case is still correct/Delaunay.

Possible fixes: change test to avoid square, make vertical length shorter than horiz or perhaps there is a flag fix for the mac compiler

NOTE files written without zero coefs are the same: output_mac/out_hex_3x4.uge output_linux/out_hex_3x4.uge

linux and new mac:

<  -4.166666666667E-02 -1.515940605973E-17
---
>  -4.166666666667E-02 -4.618806972100E-17 -1.671098990551E-17
millerta commented 5 months ago

Note the macports compilers do not have this issue. The stor test results are the same on mac and linux. Compiled with sonoma on mac laptop: export CC=/opt/local/bin/gcc-mp-12 export CXX=/opt/local/bin/g++-mp-12 export FC=/opt/local/bin/gfortran-mp-12

Issue Example in test/level03/stor_precision_diff