Solution diverging on using double precision
Hi,
I have an incompressible Navier Stokes code that was working fine as long as I was using single precision. When I converted to double precision, the residues are very high. Why is this happening? Thanks! Qrie |
A bug in your code?
Sometimes issues like the following may occur if (xx == 0.0) { then do something } Under single precision this might work but double does not if xx is very small but not equal to 0.0, for example xx=1.0e-12. Single precision would round value to zero. Error tolerances should be used. if (abs(xx) < 1.0e-8) { then do something } |
That helps! Thank you! :)
|
All times are GMT -4. The time now is 01:04. |