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

Compilation error when using pow instead of sqr

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 10, 2022, 09:05
Default Compilation error when using pow instead of sqr
  #1
Member
 
Horst van Gras
Join Date: Oct 2018
Posts: 45
Rep Power: 8
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
Code:
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
Default
  #2
Senior Member
 
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18
hk318i is on a distinguished road
It could be namespace conflict, try

Code:
Foam::pow(x,3)
__________________
@HIKassem | HassanKassem.me
hk318i is offline   Reply With Quote

Reply

Tags
fieldaverageitem, openfoam, pow, sqr


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.org] 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 22:37.