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

tmp< T >

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 15, 2010, 00:58
Default tmp< T >
  #1
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 9
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, 04:07
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
See tmp - stands for 'true macro pain'?
akidess is offline   Reply With Quote

Old   July 15, 2010, 07:45
Default Thanks
  #3
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 9
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, 01:24
Default difference between tmp<T> and &T
  #4
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 9
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, 10:58
Default
  #5
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 397
Rep Power: 12
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, 20:37
Default Thanks
  #6
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 9
ata is on a distinguished road
Hi David
Thank you very much
Best regards

Ata
ata is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
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 12:46
Geometry > Netgen > OpenFOAM ericnutsch Open Source Meshers: Gmsh, Netgen, CGNS, ... 9 February 22, 2010 08:39
Cyclic Boundaries -> Match Option -> Arbitrary Derek CD-adapco 1 August 4, 2004 22: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 03:23.