CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

Problem with log(scalar) operator

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   June 17, 2010, 20:41
Default Problem with log(scalar) operator
Join Date: Jun 2009
Location: Montreal
Posts: 65
Rep Power: 10
Pascal_doran is on a distinguished road
Hi all,

I try to use the log(scalar) operation in pre processing utility but I have the following error message:

~/OpenFOAM/ag74290-1.6.x/applications/utilities/preProcessing/vit_cond_init_4t_rand$ wmake
SOURCE=vit_cond_init_4t_rand.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-40 -I/home/ag74290/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/ag74290/OpenFOAM/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude -I/home/ag74290/OpenFOAM/OpenFOAM-1.6.x/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/vit_cond_init_4t_rand.o
vit_cond_init_4t_rand.C: In function ‘int main(int, char**)’:
vit_cond_init_4t_rand.C:108: error: call of overloaded ‘log(Foam::scalar&)’ is ambiguous
/usr/include/bits/mathcalls.h:110: note: candidates are: double log(double)
/home/ag74290/OpenFOAM/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude/dimensionedScalar.H:74: note:                 Foam::dimensionedScalar Foam::log(const Foam::dimensionedScalar&)
/home/ag74290/OpenFOAM/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude/Scalar.H:236: note:                 Foam::doubleScalar Foam::log(Foam::doubleScalar)
/home/ag74290/OpenFOAM/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude/Scalar.H:236: note:                 Foam::floatScalar Foam::log(Foam::floatScalar)
make: *** [Make/linux64GccDPOpt/vit_cond_init_4t_rand.o] Error 1
I can use it in simple C++ code but not in OpenFOAM 1.6.x
Any advice?

Pascal_doran is offline   Reply With Quote

Old   June 18, 2010, 01:01
Senior Member
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 253
Rep Power: 14
MartinB will become famous soon enough
Hello Pascal,

you may try it this way:

scalar logTest = Foam::log(scalar(42));

MartinB is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Incoherent problem table in hollow-fiber spinning Gianni FLUENT 0 April 5, 2008 10:33
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
problem with using colocated code Jack Main CFD Forum 0 December 15, 2002 01:15

All times are GMT -4. The time now is 05:32.