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

Iterate through all scalars of a volScalarField

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 14, 2014, 11:00
Default Iterate through all scalars of a volScalarField
  #1
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
hi,

I want to iterate through all elements (scalars) of a given volScalarField and thought of something like this:

Code:
forAllIter (volScalarField, phase.Droplets(), iter) //Droplets() returns a volScalarField of 
{                                                                    //object phase

iter() = properties.lookup("valueList1").Element1();

}
Two Quesitons:

1. Will this generally work?

2. When doing "properties.lookup("valueList1")" I need a method to extract the first Element of the list "valueList1" -> in the code above I wrote "Element1()" . How can I access the different elements of the list?

greetings
maybee

Last edited by maybee; February 15, 2014 at 04:49.
maybee 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
[openSmoke] libOpenSMOKE Tobi OpenFOAM Community Contributions 562 January 25, 2023 10:21
if-loop, volScalarField comparison volker OpenFOAM 7 March 6, 2020 21:03
How to output user-defined volScalarField that paraFoam can read? keepfit OpenFOAM Programming & Development 5 February 7, 2014 08:50
writing execFlowFunctionObjects immortality OpenFOAM Post-Processing 30 September 15, 2013 07:16
dimensionedScalar + volScalarField is evaluated elementwisely ? tianyikillua OpenFOAM Programming & Development 1 March 30, 2012 04:12


All times are GMT -4. The time now is 20:35.