CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Installation (
-   -   Compiling OpenFOAM 12 in Single Precision (

fra76 April 21, 2006 05:24

Hi! I have to use the splitMe
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?

mbeaudoin April 21, 2006 09:07

Hello Francesco, 1: you can
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


#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 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. penFOAM

Good luck!


fra76 April 21, 2006 09:29

Thanks Martin, but I need to b
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


gschaider April 21, 2006 10:24

Francesco: AFAIK 1.2 doesn't
AFAIK 1.2 doesn't support SP outOfTheBox. You might try to go to scalar.H and change

typedef double scalar;


typedef float scalar;

and recompile EVERYTHING. But I've never tried that and therefor can'T tell you if it will work

mbeaudoin April 21, 2006 11:58

Bummer.. I should have read yo
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!


fra76 April 21, 2006 12:05

Perhaps my problems with split
Perhaps my problems with splitMesh are resolved, so I'd not need to build OF 1.2 in single precision...
I hope so!

All times are GMT -4. The time now is 11:17.