CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Error search (http://www.cfd-online.com/Forums/openfoam-programming-development/88912-error-search.html)

linch May 30, 2011 10:20

Error search
 
Hello all,

on one hand I have following fields (in createFields:H):
Code:

    int xN2Points;
    int hPoints;
    Field <scalar> xN2Table(xN2Points,scalar(0.0));
    Field <scalar> hTable(hPoints,scalar(0.0));
    Field <scalarField> rhoTable(hPoints,scalarField(xN2Points,scalar(0.0)));
    volScalarField xN2;
    volScalarField h;
    volScalarField rho;

on the other hand I have a following function (in interpolationLookUp.H).
Code:

void bilinInterp(Field<scalar> &X1, Field<scalar> &X2, Field<scalarField> &Y, volScalarField& X1i, volScalarField& X2i, volScalarField& Yi)
As I try to put them together (in createFields.H),
Code:

bilinInterp(&xN2Table, &hTable, &rhoTable,  &xN2, &h, &rho);
I get a type missmatch error for createFields:H:
Quote:

createFields.H:213: error: invalid initialization of non-const reference of type ‘Foam::Field<double>&’ from a temporary of type ‘Foam::Field<double>*’
and for interpolationLookUp.H:
Quote:

interpolationLookUp.H:1: error: in passing argument 1 of ‘void bilinInterp(Foam::Field<double>&, Foam::Field<double>&, Foam::Field<Foam::Field<double> >&, Foam::volScalarField&, Foam::volScalarField&, Foam::volScalarField&)’
Could somebody please help me to find out what I am doing wrong?

marupio May 30, 2011 12:53

You are passing by reference. Try getting rid of the "&" characters in the function call... but leave them in the prototype.

Code:

bilinInterp(xN2Table, hTable, rhoTable,  xN2, h, rho);

linch June 1, 2011 06:53

Thanks David.


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