CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   error: 'Foam::T' does not have class type (https://www.cfd-online.com/Forums/openfoam/97579-error-foam-t-does-not-have-class-type.html)

Raymond.Leoi February 20, 2012 19:25

error: 'Foam::T' does not have class type
 
double ptr_temp[OF_nCells];
for (int i=0; i<OF_nCells; i++)
ptr_temp[i] = T.field()[i];

The above is working well in OpenFOAM 1.5. But it doesn't work in OF 1.7 and an error occurs as,
solver_data.H:8:18: error: 'Foam::T' does not have class type

any idea about this problem?

kathrin_kissling February 21, 2012 02:36

Hi,

can you give us a hint on how T is defined?

Thanks

Kathrin

wyldckat February 21, 2012 15:32

Greetings to all!

Indeed, more information would clearly make it easier to help! Usually there are two kinds of "T" on OpenFOAM applications:
  • Foam::T - this transposes a matrix.
  • ::T - this is the Temperature field defined on a solver.
Solution: don't expect the compiler to do voodoo ;) Because if it does do voodoo, then you're probably in a whole lot of trouble...

Best regards,
Bruno

kathrin_kissling February 22, 2012 02:22

Hi Bruno,
do you think it got mixed up?
T.field() instead of field.T()

possible....

Best
Kathrin

wyldckat February 22, 2012 03:36

Hi Kathrin,

I'm almost betting on it being that issue. I saw this problem a week or so ago, where we were basing ourselves on the discontinued Programmers Guide and came to the conclusion that "Foam::T" was a must on an equation, because the "T" field already existed.
Actually, I'm not even sure if "field.T()" still exists...

Best regards,
Bruno


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