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

Error search

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 30, 2011, 10:20
Default Error search
  #1
Senior Member
 
Illya Shevchuk
Join Date: Aug 2009
Location: Darmstadt, Germany
Posts: 176
Rep Power: 16
linch is on a distinguished road
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?
linch is offline   Reply With Quote

Old   May 30, 2011, 12:53
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22
marupio is on a distinguished road
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);
marupio is offline   Reply With Quote

Old   June 1, 2011, 06:53
Default
  #3
Senior Member
 
Illya Shevchuk
Join Date: Aug 2009
Location: Darmstadt, Germany
Posts: 176
Rep Power: 16
linch is on a distinguished road
Thanks David.
linch 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



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