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

OpenFOAM-1.5-dev svn revision 1438: libOpenFOAM does not compile in SP

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 14, 2009, 12:02
Exclamation OpenFOAM-1.5-dev svn revision 1438: libOpenFOAM does not compile in SP
  #1
4xF
New Member
 
Frank Albina
Join Date: Mar 2009
Location: Switzerland
Posts: 14
Rep Power: 17
4xF is on a distinguished road
Send a message via Skype™ to 4xF
Hi all!

I came across this showstopper yesterday while trying to compile the svn rev. #1438 of the OpenFoam-1.5-dev repository. While compile in DP works fine, compiling in SP (single precision) produces the following output:

wmake libso OpenFoam
[...]
interpolations/RBFInterpolation/RBFFunctions/W2/W2.C: In member function ‘virtual Foam::tmp<Foam::Field<float> > Foam::W2::weights(const Foam::vectorField&, const Foam::vector&) const’:
interpolations/RBFInterpolation/RBFFunctions/W2/W2.C:68: error: no matching function for call to ‘max(Foam::tmp<Foam::Field<float> >, double)’
lnInclude/label.H:190: note: candidates are: char Foam::max(char, char)
lnInclude/label.H:191: note: short int Foam::max(short int, short int)
lnInclude/label.H:192: note: int Foam::max(int, int)
lnInclude/label.H:193: note: long int Foam::max(long int, long int)
lnInclude/label.H:194: note: long long int Foam::max(long long int, long long int)
lnInclude/label.H:196: note: unsigned char Foam::max(unsigned char, unsigned char)
lnInclude/label.H:197: note: short unsigned int Foam::max(short unsigned int, short unsigned int)
lnInclude/label.H:198: note: unsigned int Foam::max(unsigned int, unsigned int)
lnInclude/label.H:199: note: long unsigned int Foam::max(long unsigned int, long unsigned int)
lnInclude/label.H:200: note: long long unsigned int Foam::max(long long unsigned int, long long unsigned int)
lnInclude/label.H:202: note: long int Foam::max(int, long int)
lnInclude/label.H:203: note: long long int Foam::max(int, long long int)
lnInclude/label.H:204: note: long long int Foam::max(long long int, int)
lnInclude/doubleFloat.H:92: note: double Foam::max(double, double)
lnInclude/doubleFloat.H:93: note: double Foam::max(double, float)
lnInclude/doubleFloat.H:94: note: double Foam::max(float, double)
lnInclude/doubleFloat.H:95: note: float Foam::max(float, float)
lnInclude/doubleFloat.H:96: note: double Foam::max(double, int)
lnInclude/doubleFloat.H:97: note: double Foam::max(int, double)
lnInclude/doubleFloat.H:98: note: double Foam::max(double, long int)
lnInclude/doubleFloat.H:99: note: double Foam::max(long int, double)
lnInclude/doubleFloat.H:100: note: float Foam::max(float, int)
lnInclude/doubleFloat.H:101: note: float Foam::max(int, float)
lnInclude/doubleFloat.H:102: note: float Foam::max(float, long int)
lnInclude/doubleFloat.H:103: note: float Foam::max(long int, float)
make: *** [Make/linux64GccSPOpt/W2.o] Error 1
make: *** Waiting for unfinished jobs....

Culprit is obviously src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/W2/W2.C using a Foam::max function for a single precision scalar field which has not been declared. I would fix it by myself, but I have no idea where to start.

Anyone want to try? Enlighten me...
4xF is offline   Reply With Quote

Old   October 14, 2009, 12:20
Thumbs up Fixed!
  #2
4xF
New Member
 
Frank Albina
Join Date: Mar 2009
Location: Switzerland
Posts: 14
Rep Power: 17
4xF is on a distinguished road
Send a message via Skype™ to 4xF
This is an issue raised by Henry in this thread:
http://www.cfd-online.com/Forums/ope...on-issues.html

So the fix is to replace on line #68 in the file
src/OpenFOAM/interpolations/RBFInterpolation/RBFFunctions/W2/W2.C :

Foam::max(pow4(1 - (dist/radius_)), 0.0)
by
Foam::max(pow4(1 - (dist/radius_)), scalar(0.0))

Can anyone commit the fix to the svn repo?

Thanx.
4xF is offline   Reply With Quote

Old   October 15, 2009, 06:15
Default Additional source files to be modified
  #3
4xF
New Member
 
Frank Albina
Join Date: Mar 2009
Location: Switzerland
Posts: 14
Rep Power: 17
4xF is on a distinguished road
Send a message via Skype™ to 4xF
In 1.5-dev, the following source files need to be also modified in order to be able to compile in single precision:

  • applications/solvers/newStressAnalysis/newContactStressFoam/contactPatchPair.C
  • applications/solvers/multiphase/barotropicCavitatingFoam/rhoEqn.H
  • src/finiteArea/finiteArea/fam/famSup.C
In all these files min([...],0.0) and max([...],0.0) need to be replaced by:
min([...], scalar(0.0)) and max([...], scalar(0.0)) respectively.
4xF is offline   Reply With Quote

Old   October 16, 2009, 05:35
Default
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
My fault: thank you, I'll check it in now.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Reply

Tags
1.5-dev, libopenfoam, rev.1438, single precision


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
OpenFOAM 1.5 installation on OpenSUSE 11.0 bigphil OpenFOAM Installation 16 April 29, 2009 06:28
Problem installing OpenFOAM 1.5 installation on RHEL 4. vwsj84 OpenFOAM Installation 4 April 23, 2009 04:48
Can someone PLEASE document the development version installation bernd OpenFOAM Installation 76 November 14, 2008 21:51
OpenFOAM Version 1.5 Released OpenFOAM discussion board administrator OpenFOAM Announcements from ESI-OpenCFD 0 July 14, 2008 18:22
OpenFOAM Debian packaging current status problems and TODOs oseen OpenFOAM Installation 9 August 26, 2007 13:50


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