CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   error: 'Foam::T' does not have class type (

Raymond.Leoi February 20, 2012 20: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 03:36


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



wyldckat February 21, 2012 16: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,

kathrin_kissling February 22, 2012 03:22

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



wyldckat February 22, 2012 04: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,

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