# Basic question about forAll loop and volVectorField

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

 January 9, 2014, 23:14 Basic question about forAll loop and volVectorField #1 Member   Tayo Join Date: Aug 2012 Location: FL Posts: 94 Rep Power: 4 Hello all, Pls I have two basic questions. 1.) What's the difference between the forAll loops below i.e. what's the effect of using the variable "A" with the index "celli"? Code: ```forAll (A,celli) { if (A <= 1.0) { Talpha[A[celli]] = x[A[celli]]*y[A[celli]]; ....``` compared to solving as Code: ` Talpha[celli] = x[celli]*y[celli];` 2.) Given a surfaceVectorField, how can I transform it into a volVectorField? I've tried using fvc::reconstruct() but it makes my case blow up, guess it's only ideal for scalar field. Thanks in advance for your help

 January 10, 2014, 02:23 #2 Senior Member   Nima Sam Join Date: Sep 2009 Location: Tehran, Iran Posts: 1,123 Blog Entries: 1 Rep Power: 14 1- A is array so A[celli] returns the value of A in the celli, for example celli is 1 but the value of A[celli] is 10, then T[A[celli]] equals T[10] and T[celli] equals T[1] 2- you can use forexample: surfaceSum, there are several else in programmer guide __________________ Training Course on OpenFOAM at (http://www.isme.ir/) My Weblog (http://openfoam.blogfa.com/)

 January 10, 2014, 02:56 #3 Member   Tayo Join Date: Aug 2012 Location: FL Posts: 94 Rep Power: 4 Thanks for your quick response

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

All times are GMT -4. The time now is 18:14.