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

position of iterator?

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   February 17, 2014, 16:16
Default position of iterator?
  #1
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
hi,

when using something like

Code:
forAllIter(PtrDictionary<phaseModel>, phases_, iter)  
{ 
phaseModel& phase = iter();
.
.
.
}
is it possible to get the actual position/index of iterator "iter" (which pointer is the iterator refering to at the moment)?

Quote:
Additionally:

If I define a dictionary like

Code:
const dictionary& subDict_Droplets;
subDict_Droplets = properties.subDict("currentValue");
can I create an iterator for the dictionary, set this iterator to a specific position of the dictionary (the position I would get from the first iterator if possible -> see code snippet 1) and get the content of the dictionary at that position?
-> Ok, I guess I solved the second part more efficiently by using the datatype "list<dimensionedScalar>" instead of "dictionary". The elements of datatype "list<dimensionedScalar>" should be accessable like a vector (->array) right?


greetings
maybee

Last edited by maybee; February 19, 2014 at 05:38.
maybee is offline   Reply With Quote

 


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
[OpenFOAM] an error in Calculator's equation immortality ParaView 12 June 29, 2021 00:10
Force dependent on particle position jranita OpenFOAM Programming & Development 1 August 23, 2011 19:44
how to read in a position file jiejie OpenFOAM 0 May 23, 2011 04:38
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 01:29
Combustion Convergence problems Art Stretton Phoenics 5 April 2, 2002 05:59


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