|
[Sponsors] |
March 5, 2014, 07:35 |
Possible bug in OpenFoam Interpolation class
|
#1 |
New Member
Matteo
Join Date: Sep 2013
Location: Milan, Italy
Posts: 9
Rep Power: 13 |
Hello everybody,
I'm currrently using the class interpolationCellPoint, but I experienced a strange behaviour in its usage. I'm using this class in two different ways: - the first, I declare an object Uinter of class interpolationCellPoint in the header file of my custom class: Code:
#include "interpolationCellPoint.H" // need by Uinter namespace Foam { class myClass { public: ...some objects... interpolationCellPoint<vector> Uinter; vector velInterp(point &iVelPoint,label &iVelCell); private: ... } } Code:
#include "myClass.h" namespace Foam { defineTypeNameAndDebug(myClass, 1); // Default Constructor myClass::myClass(const volVectorField& U): ...some definitions... // Set the pointer to the velocity field U_(U), // Uinter construction Uinter(U), ...other definitions... {} } Code:
#include "myClass.h" namespace Foam { vector myClass::velInterp(point &iVelPoint,label &iVelCell) { V=Uinter.interpolate(iVelPoint, iVelCell); return(V); } } - the second, I declare and define the variable Uinter of class intersectioCellPoint directly inside the velInterp function, so it is no more a myClass public member, but it borns and dies directly inside the function: Code:
#include "myClass.h" namespace Foam { vector myClass::velInterp(point &iVelPoint,label &iVelCell) { interpolationCellPoint<vector> Uinter(U_); V=Uinter.interpolate(iVelPoint, iVelCell); return(V); } } I can't figure out the reason for this discrepancy in the results. Is it my fault or have I found a bug? Last edited by MMC15; March 5, 2014 at 10:50. |
|
March 6, 2014, 06:08 |
|
#2 |
New Member
Matteo
Join Date: Sep 2013
Location: Milan, Italy
Posts: 9
Rep Power: 13 |
I forgot to mention that I'm using openfoam 2.2.2.
|
|
March 23, 2014, 13:55 |
|
#3 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Matteo,
Without a complete test case (case + application source code) for easily+quickly testing this, it's very hard for anyone to be able to answer to your question(s), without taking several hours to set-up an identical code structure and test case. Best regards, Bruno
__________________
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM class to represent initial boundary conditions | sanatan | OpenFOAM Programming & Development | 1 | March 20, 2011 10:16 |
bubbleFoam validation case | balkrishna | OpenFOAM Running, Solving & CFD | 24 | August 30, 2010 05:37 |
Surface interpolation schemes and parallelization | jutta | OpenFOAM Running, Solving & CFD | 0 | February 25, 2010 15:32 |
Cumulative patch for OpenFOAM 141 January 3rd 2007 | msrinath80 | OpenFOAM Bugs | 6 | January 4, 2008 11:12 |
OpenFOAM 14 stock version parallel bug | msrinath80 | OpenFOAM Bugs | 2 | May 30, 2007 15:47 |