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

call of overloaded ‘exp(double)’ is ambiguous

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 4 Post By chegdan
  • 1 Post By chegdan

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   August 24, 2016, 15:56
Default call of overloaded ‘exp(double)’ is ambiguous
  #1
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15
babakflame is on a distinguished road
Dear Fellows

I am trying to add a variable called rhoE into my createFields.H file and assign a value to it based on location in the grid.

I have added the following lines into my createFields.H file:

Code:
volScalarField yPos = mesh.C().component(vector::Y);
    volScalarField xPos = mesh.C().component(vector::X); 

    Info<< "Reading field electric density rhoE\n" << endl;
    volScalarField rhoE
    (
        IOobject
        (
            "rhoE",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );

    forAll(rhoE.internalField(), patchi)
    {
        if (xPos [patchi] < 10)
    {
        rhoE.internalField()[patchi]=exp(-yPos[patchi]);
    }
    else 
    {
        rhoE.internalField()[patchi]= 0;
    }
    }
However, after compiling my code, it gives the following error:

Code:
createFields.H: In function ‘int main(int, char**)’:
createFields.H:183:49: error: call of overloaded ‘exp(double)’ is ambiguous
createFields.H:183:49: note: candidates are:
In file included from /usr/include/math.h:69:0,
                 from /usr/include/c++/4.7/cmath:46,
Would somebody hint me how can I remove this error?
babakflame is offline   Reply With Quote

 


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
Any experts on FFTW? jinhua2015 Main CFD Forum 3 May 22, 2022 19:44
Compiling User Fortran with CFX 14.0 on Win64 Raijin Thunderkeg CFX 29 March 9, 2016 11:45
File format - binary? (plot3d) Joachim Main CFD Forum 15 January 14, 2015 18:21
writing link between two CGNS files t.teschner Main CFD Forum 1 February 4, 2014 10:26
2D CFD code using SIMPLE algorithm bfan Main CFD Forum 3 June 22, 2002 22:01


All times are GMT -4. The time now is 06:40.