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

Compilation error when using pow instead of sqr

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

LinkBack Thread Tools Search this Thread Display Modes
Old   September 10, 2022, 09:05
Default Compilation error when using pow instead of sqr
Horst van Gras
Join Date: Oct 2018
Posts: 44
Rep Power: 6
HorstvanGrass is on a distinguished road
I'm trying to compile my custom fieldAverage lib for extracting the skewness and curtosis in the statistics of fluid. For this I need to calculate the cubic of the difference between the actual flow and the mean flow.

However when I change sqr(X) to pow(X,3) I'm always getting an error
mismatched types ?double? and ?Foam::Vector<double>?
Even if I use pow(X,2) I get the same error... It seems that pow and sqr have different functions entries. How can I get rid of that?
HorstvanGrass is offline   Reply With Quote

Old   September 13, 2022, 14:43
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 241
Rep Power: 16
hk318i is on a distinguished road
It could be namespace conflict, try

@HIKassem |
hk318i is offline   Reply With Quote


fieldaverageitem, openfoam, pow, sqr

Thread Tools Search this Thread
Search this Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[] foam-extend-3.2 compilation on windows kirmaks OpenFOAM Installation 7 December 3, 2019 21:20
OpenFOAM 4.x: pow function cause floating point error doctorWho OpenFOAM Programming & Development 2 September 11, 2016 11:36
Compilation error for OpenFOAM-ext on Ubantu 10.04 32 bit Sargam05 OpenFOAM Installation 13 March 22, 2014 06:21
Compilation Error (V 1.7.1; Icc 12.1.0, OpenMPI 1.4.3) floydfan OpenFOAM Installation 7 December 20, 2011 06:56
Compilation Error.... Arnab Siemens 4 September 12, 2004 16:54

All times are GMT -4. The time now is 14:08.