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

PtrList and List

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 1, 2013, 22:44
Default PtrList and List
  #1
New Member
 
Geon-Hong Kim
Join Date: Feb 2010
Location: Ulsan, Republic of Korea
Posts: 27
Rep Power: 7
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.
Geon-Hong is offline   Reply With Quote

Old   October 6, 2013, 14:36
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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
wyldckat is offline   Reply With Quote

Reply

Tags
data, list, openfoam, ptrlist

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


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