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

Compiling OpenFOAM 12 in Single Precision

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 21, 2006, 06:24
Default Hi! I have to use the splitMe
  #1
Senior Member
 
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18
fra76 is on a distinguished road
Hi!
I have to use the splitMesh utility, which doesn't work at all on OpenFOAM 1.3.
Because of the size of the mesh I have to split (is a .msh file with lots of internal faces that are walls), I'd be glad to compile OpenFOAM 1.2 in single precision (SP) mode, as I've seen it is allowed in version 1.3.
Is there a way to do this?
fra76 is offline   Reply With Quote

Old   April 21, 2006, 10:07
Default Hello Francesco, 1: you can
  #2
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22
mbeaudoin will become famous soon enough
Hello Francesco,

1: you can dowload a pre-compiled single-precision version of OpenFOAM from the OpenCFD Web site.

2: If you really need to recompile OpenFOAM, you first need to change the environment variable WM_PRECISION_OPTION from the default value DP to SP.

Just look-up the definition of the variable WM_PRECISION_OPTION in the file
$HOME/OpenFOAM/OpenFOAM-1.3/.OpenFOAM-1.3/bashrc (or the cshrc file in the same directory)

Once the modification is done, don't forget to source your environment by doing the following command:

# for bash
. $HOME/OpenFOAM/OpenFOAM-1.3/.OpenFOAM-1.3/bashrc

or

#for csh
source $HOME/OpenFOAM/OpenFOAM-1.3/.OpenFOAM-1.3/cshrc

(By the way, you need to do this modification as well if you want to use the pre-compiled single-precision version of OpenFOAM...)

Then, simply recompile OpenFOAM.

I plan to do the same recompilation in a very short while, so if in the process of recompiling I discover some "gotchas", I'll post them here. For example, there might be problems with paraFoam/paraView compiled in double precision and the dynamic library libPVFoamReader.so compiled in single precision.

I plan to add a little section to the Wiki Howto describing the recompilation process in single precision for OpenFOAM 1.3.
http://openfoamwiki.net/index.php/Howto_compile_O penFOAM

Good luck!

Martin
mbeaudoin is offline   Reply With Quote

Old   April 21, 2006, 10:29
Default Thanks Martin, but I need to b
  #3
Senior Member
 
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18
fra76 is on a distinguished road
Thanks Martin, but I need to build OpenFOAM 1.2 in SP mode.
I have already compiled OF 1.3 in SP and Debug mode, on Fedora Core 5 x86_64, but I don't know if I can do the same with OF 1.2

Francesco
fra76 is offline   Reply With Quote

Old   April 21, 2006, 11:24
Default Francesco: AFAIK 1.2 doesn't
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Francesco:
AFAIK 1.2 doesn't support SP outOfTheBox. You might try to go to scalar.H and change

typedef double scalar;

to

typedef float scalar;

and recompile EVERYTHING. But I've never tried that and therefor can'T tell you if it will work
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   April 21, 2006, 12:58
Default Bummer.. I should have read yo
  #5
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22
mbeaudoin will become famous soon enough
Bummer.. I should have read your message less quickly...

Sorry for introducing noise in the mailing list, I will try to behave for now on...

Bernhard suggestion is probably the best solution, but I have never tried it myself as well.

Good luck!

Martin
mbeaudoin is offline   Reply With Quote

Old   April 21, 2006, 13:05
Default Perhaps my problems with split
  #6
Senior Member
 
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18
fra76 is on a distinguished road
Perhaps my problems with splitMesh are resolved, so I'd not need to build OF 1.2 in single precision...
I hope so!
Francesco
fra76 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
Single v.s. double precision Confused CFX 15 November 10, 2016 05:42
Is there an option for single precisiondouble precision in OpenFOAM hsieh OpenFOAM Running, Solving & CFD 5 April 13, 2015 15:37
Compiling 15dev and 15x in single precision bastil OpenFOAM Installation 0 February 5, 2009 05:34
Compiling 15dev and 15x in single precision bastil OpenFOAM Installation 0 February 5, 2009 05:03
OpenFOAM Double precision vs Single Precision alexandrepereira OpenFOAM Running, Solving & CFD 1 June 11, 2008 15:30


All times are GMT -4. The time now is 15:55.