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

pow() function not work.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 7, 2014, 23:31
Default pow() function not work.
  #1
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
Hi guys,

Code:
b[0] = pow(alpha[1]*alpha[2],2);
      b[1] = pow(alpha[3]*alpha[4],2.0);
Code:
C.C: In function ‘int main(int, char**)’:
C.C:90:25: error: call of overloaded ‘pow(double&, double)’ is ambiguous
alpha and b is array, the first one works but the second doesnot. Actually I wanna it to be b[1] = pow(alpha[3]*alpha[4],0.5);

How should I do. Thanks.
sharonyue is offline   Reply With Quote

Old   May 8, 2014, 02:52
Default
  #2
Senior Member
 
Mohammad Shakil Ahmmed
Join Date: Oct 2012
Location: AUS
Posts: 137
Rep Power: 14
ahmmedshakil is on a distinguished road
Have you give a try with : foam:ow(alpha[1]*alpha[2],scalar(2))
ahmmedshakil is offline   Reply With Quote

Old   May 8, 2014, 21:24
Default
  #3
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
Quote:
Originally Posted by ahmmedshakil View Post
Have you give a try with : foam:ow(alpha[1]*alpha[2],scalar(2))
Yeah, it is solved! Thanks!
sharonyue 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
[swak4Foam] installation problem with version 0.2.3 Claudio87 OpenFOAM Community Contributions 9 May 8, 2013 10:20
Fluent otimization: how objective function work laxwendrofzx9r Fluent UDF and Scheme Programming 0 August 13, 2012 07:49
Fluent otimization: how objective function work laxwendrofzx9r FLUENT 0 August 13, 2012 07:48
<unresolved overloaded function type> - How to work with that bastil OpenFOAM Running, Solving & CFD 1 April 14, 2010 03:57
OpenFoam 14 installation problem gfcoppola OpenFOAM Installation 20 November 2, 2007 13:38


All times are GMT -4. The time now is 18:28.