|
[Sponsors] |
May 17, 2011, 15:17 |
Quad precision?
|
#1 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
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.. |
|
May 17, 2011, 15:27 |
|
#2 |
Senior Member
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25 |
Are you referring to numerical precision, or something like fourth-order accuracy?
|
|
May 17, 2011, 15:49 |
|
#3 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
Need more digits! I mean using "long double", or __float128.
|
|
May 17, 2011, 15:54 |
|
#4 |
Senior Member
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25 |
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. |
|
May 17, 2011, 16:36 |
|
#5 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Switch from single precision to double precision | kk81 | OpenFOAM Bugs | 0 | March 11, 2010 07:14 |
Number of elements x double precision | matheusguzella | ANSYS Meshing & Geometry | 2 | October 7, 2009 11:15 |
Parallel computing quad core | Prad | Main CFD Forum | 13 | February 9, 2009 15:28 |
what's wrong about my code for 2d burgers equation | morxio | Main CFD Forum | 3 | April 27, 2007 11:38 |
double precision assigning in FRTRAN | R.A.Khurram | Main CFD Forum | 12 | October 2, 2001 12:00 |