CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   tmp< T > (https://www.cfd-online.com/Forums/openfoam/78191-tmp-t.html)

ata July 15, 2010 00:58

tmp< T >
 
Hi FOAMers
Can any one tell me "tmp< T >" class is for what?
It seems it is "A class for managing temporary objects." but can any one explain for me what is difference between
const GeometricField< Type, fvsPatchField, surfaceMesh >
and
const tmp< GeometricField< Type, fvsPatchField, surfaceMesh > >
Any help will be appreciated
Best regards

Ata

akidess July 15, 2010 04:07

See http://www.cfd-online.com/Forums/ope...acro-pain.html

ata July 15, 2010 07:45

Thanks
 
Hi Anton Kidess
Thank you very much
Best regards

Ata

ata July 17, 2010 01:24

difference between tmp<T> and &T
 
Hi Anton Kidess
So, would you please tell me what is difference between tmp<T> and passing a reference (&T)?
Thank you very much
Best regards

Ata

marupio July 17, 2010 10:58

tmp is used for returning *local variables* without copying. You can't pass a reference because the data it points to is going out of scope. There's an article on the wiki here:

http://openfoamwiki.net/index.php/OpenFOAM_guide/tmp

ata July 17, 2010 20:37

Thanks
 
Hi David
Thank you very much
Best regards

Ata


All times are GMT -4. The time now is 03:59.