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

PtrList and List

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By Geon-Hong
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 1, 2013, 22:44
Default PtrList and List
  #1
Member
 
Geon-Hong Kim
Join Date: Feb 2010
Location: Ulsan, Republic of Korea
Posts: 36
Rep Power: 16
Geon-Hong is on a distinguished road
Dear Foamers,

Recently I have peered the OpenFOAM source codes to understand the data structures used in it.

Meanwhile, a fundamental question has come up : "why does the OpenFOAM frequently use PtrList instead of List?"

I think it may not be the case of OpenFOAM only but also C++ language.

One thing that I can guess is that it can handle large data efficiently by using the pointers instead of objects directly. But I don't have any other idea of advantages of using PtrList over List.

Please somebody help me with this problem!

Thank you very much.

Best regards,
Geon-Hong.
hua1015 and fly_light like this.
Geon-Hong is offline   Reply With Quote

Old   October 6, 2013, 14:36
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Geon-Hong,
Quote:
Originally Posted by Geon-Hong View Post
One thing that I can guess is that it can handle large data efficiently by using the pointers instead of objects directly. But I don't have any other idea of advantages of using PtrList over List.
Yes, I would say that's pretty much the reason why.

In addition, OpenFOAM uses pointers a lot, so much that it has the "tmp" mechanism: http://openfoamwiki.net/index.php/OpenFOAM_guide/tmp

Best regards,
Bruno
fly_light likes this.
__________________
wyldckat is offline   Reply With Quote

Reply

Tags
data, list, openfoam, ptrlist


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
Read properties per component from an input file dictionary Cyp OpenFOAM Programming & Development 29 November 1, 2015 21:41
Pollutant dispersion in the environment alberto OpenFOAM Running, Solving & CFD 24 November 29, 2014 13:31
PtrList initialization problem mateusz_slowikowski OpenFOAM Running, Solving & CFD 8 March 19, 2012 14:32
PtrList error while trying to define an array of volScalarFields adhiraj OpenFOAM 2 February 15, 2012 17:26
C question kar OpenFOAM Running, Solving & CFD 26 May 20, 2008 06:05


All times are GMT -4. The time now is 11:50.