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

Problems with including "cmath"

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 6, 2014, 16:00
Default Problems with including "cmath"
  #1
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
hi,

I am using OpenFOAM with QtCreator. Currently I have to implement some Integralfunctions with several input parameters like:

Code:
class IntegralFunctionB
{
private:
    double x;
    double y;

public:
    IntegralFunctionB(double a, double b)
    {
        x = a;
        y = b;
    }

    double operator()(double d) const
    {
        return pow(y,4)*(6.4/d)*exp(-(4.5*pow(2.0*pow(d,3.0)-pow(x,3.0),2.0))/pow(x,2.0));
    }
};
I get the error:

Code:
/home/USER/SolverNEW/NEW/SourceTermIntegralFunctions/IntegralFunctionB.H:16: error: call of overloaded ‘pow(double&, const double&)’ is ambiguous
candidates are:
/usr/include/i386-linux-gnu/bits/mathcalls.h:155: double pow(double, double)
Therefore I've added the filepath to...

... the Make/options file:

Code:
-Iusr/include/i386-linux-gnu/bits
... the include file of the IDE (Qt Creator):

Code:
/usr/include/i386-linux-gnu/bits
For the include I tried

Code:
#include "mathcalls.h"
#include <mathcalls.h>
but when building my project I get the error:

Code:
/home/USER/SolverNEW/multiphaseEulerFoamNEW.C:46: error: mathcalls.h:
No such file or directory
Please note also that in "usr/include/i386-linux-gnu/bits" only root has full access, others are just authorised to "access files", but setting the permissions for other to "read and write" does not change the output.

How can I solve this problem since I need to use the "pow(double,double)" method?

EDIT:

If I use Foam:ow(....) the code compiles fine, but I ve only found some kind of Foam:ow(double,double) here:

https://github.com/OpenFOAM/OpenFOAM.../doubleFloat.H

Is this the method called when doing Foam:ow(...) and will it work for Foam:ow(double,double)?

Last edited by maybee; April 7, 2014 at 06:15.
maybee 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
[ICEM] Problems with coedge curves and surfaces tommymoose ANSYS Meshing & Geometry 6 December 1, 2020 12:12
[mesh manipulation] Problems with rotational cyclic boundaries TReviol OpenFOAM Meshing & Mesh Conversion 8 July 11, 2014 04:45
Needed Benchmark Problems for FSI Mechstud Main CFD Forum 4 July 26, 2011 13:13
Two-phase air water flow problems by activating Wall Lubrication Force challenger85 CFX 5 November 5, 2009 06:44
Help required to solve Hydraulic related problems aero CFX 0 October 30, 2006 12:00


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