CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Quad precision? (https://www.cfd-online.com/Forums/openfoam-programming-development/88438-quad-precision.html)

marupio May 17, 2011 14:17

Quad precision?
 
How much trouble would it be to try implementing quad precision in OpenFOAM?

- Easy!
- Tough!
- Why would you want to try? The schemes are only "second order accurate", etc..

deepsterblue May 17, 2011 14:27

Are you referring to numerical precision, or something like fourth-order accuracy?

marupio May 17, 2011 14:49

Need more digits! I mean using "long double", or __float128.

deepsterblue May 17, 2011 14:54

I've implemented an arbitrary-precision data-type as a wrap-around to the GNU MPFR library. You should be able to use this as a drop-in replacement to the scalar class:

http://www.ecs.umass.edu/%7Esmenon/t...iPrecision.tgz

However, this is still emulation in software, so don't expect blazing performance.

marupio May 17, 2011 15:36

Thanks a lot, Sandeep!

I've downloaded it, and am in the process of figuring out how to use it. I'm guessing to use it in finiteVolume calculations, I need to define a new fvMatrix template specialization for a multiPrecisionScalar... fvMultiPrecisionScalar (basically identical to fvScalarMatrix).

Do you have any sample code that uses your multiPrecisionScalar class?

-Dave


All times are GMT -4. The time now is 08:40.