CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

Pasing Pointers to functions solve and linearInterpolate

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   July 7, 2011, 09:05
Default Pasing Pointers to functions solve and linearInterpolate
Join Date: Mar 2009
Posts: 50
Rep Power: 10
arkangel is on a distinguished road
Dear All,

I don't think this was asked before. I am using another pakage to link against the OpenFOAM lib , I decided that the best way would be to use a pointer to the fields as global variables. so far all seems to be working well but I think (i hope I am wrong) I reach a deadlock

volScalarField *pT;
Time *pRT ;

//Function 1
void Init(){
    pT=new Foam::volScalarField
// This woks so far perfectly  i e: pT->internalField, pMesh->C(), etc

// Function 2
void solveEQ(){
  while (pRT->loop())
                fvm::laplacian(1.0, *pT)  //DOES NOT WORK
I tried with the LaplacianFoam and I got this:

finiteVolume/lnInclude/fvmLaplacian.C:185: error: in passing argument 2 of ‘Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::laplacian(const Foam::dimensioned<Type2>&, Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) [with Type = double, GType = double]

So the Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>& thinks that *pT is other type. In fact is volScalarField (or VolVectorField if i have to use vec field)

The same is
    linearInterpolate((*pT)) & pMesh->Sf()
error: no matching function for call to ‘linearInterpolate(Foam::tmp<Foam::Field<Foam::Ten sor<double> > >)’

Is there A way to force laplacian (or other operator) to accept my syntax

Thanks for you Help
arkangel is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

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