CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Quad precision?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 17, 2011, 15:17
Default Quad precision?
  #1
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22
marupio is on a distinguished road
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..
marupio is offline   Reply With Quote

Old   May 17, 2011, 15:27
Default
  #2
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
Are you referring to numerical precision, or something like fourth-order accuracy?
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   May 17, 2011, 15:49
Default
  #3
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22
marupio is on a distinguished road
Need more digits! I mean using "long double", or __float128.
marupio is offline   Reply With Quote

Old   May 17, 2011, 15:54
Default
  #4
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
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.
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   May 17, 2011, 16:36
Default
  #5
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22
marupio is on a distinguished road
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
marupio is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 04:35.