CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

tmp< T >

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 15, 2010, 01:58
Default tmp< T >
  #1
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18
ata is on a distinguished road
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
ata is offline   Reply With Quote

Old   July 15, 2010, 05:07
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
See http://www.cfd-online.com/Forums/ope...acro-pain.html
akidess is offline   Reply With Quote

Old   July 15, 2010, 08:45
Default Thanks
  #3
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18
ata is on a distinguished road
Hi Anton Kidess
Thank you very much
Best regards

Ata
ata is offline   Reply With Quote

Old   July 17, 2010, 02:24
Default difference between tmp<T> and &T
  #4
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18
ata is on a distinguished road
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
ata is offline   Reply With Quote

Old   July 17, 2010, 11:58
Default
  #5
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22
marupio is on a distinguished road
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
marupio is offline   Reply With Quote

Old   July 17, 2010, 21:37
Default Thanks
  #6
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18
ata is on a distinguished road
Hi David
Thank you very much
Best regards

Ata
ata is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
CAD -> gMsh -> enGrid -> OpenFOAM Problem AlGates OpenFOAM 7 August 6, 2010 13:46
[Netgen] Geometry > Netgen > OpenFOAM ericnutsch OpenFOAM Meshing & Mesh Conversion 9 February 22, 2010 08:39
Cyclic Boundaries -> Match Option -> Arbitrary Derek Siemens 1 August 4, 2004 23:06
convection......-> conduction......-> convection madasu FLUENT 3 November 24, 2002 02:15
Plot3d grids > Gambit > Fluent 5 David C FLUENT 1 February 16, 2001 17:29


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