CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Post-Processing

How to loop through all the field?

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 20, 2009, 05:21
Default How to loop through all the field?
  #1
New Member
 
Shui Pei
Join Date: Mar 2009
Posts: 20
Rep Power: 8
spwater is on a distinguished road
In fact I am trying th get the value of one internal face, I am a freshman so i try to write a program to loop and to choose. Is there any method or utilities to do so? And is there any function to loop through all the field, not only the boundary. Thank you very much.
spwater is offline   Reply With Quote

Old   March 20, 2009, 05:38
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,608
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
Hi Shui Pei

You need to elaborate significantly on your question, because it is not entirely clear what you are trying to achieve.

Best regards,

Niels
ngj is offline   Reply With Quote

Old   March 20, 2009, 06:49
Default
  #3
New Member
 
Shui Pei
Join Date: Mar 2009
Posts: 20
Rep Power: 8
spwater is on a distinguished road
Hmm, now I have a mesh, I want to use my program to loop all the grids in the mesh and to judge with their position and then to output the data in specified position, can I?
spwater is offline   Reply With Quote

Old   March 20, 2009, 08:11
Default
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,608
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
Hi

You could do something like this:

const vectorField & centers = mesh.C();
forAll(centers,ii)
{
if (<statement for your position>)
{
<Do what is needed>
}
}

Best regards,

Niels
ngj is offline   Reply With Quote

Old   March 20, 2009, 21:41
Default
  #5
New Member
 
Shui Pei
Join Date: Mar 2009
Posts: 20
Rep Power: 8
spwater is on a distinguished road
Thank you very much, it helps.
Quote:
Originally Posted by ngj View Post
Hi

You could do something like this:

const vectorField & centers = mesh.C();
forAll(centers,ii)
{
if (<statement for your position>)
{
<Do what is needed>
}
}

Best regards,

Niels
spwater is offline   Reply With Quote

Reply

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
Problem with Gmsh nishant_hull Open Source Meshers: Gmsh, Netgen, CGNS, ... 19 July 31, 2015 05:10
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51
for loop inside a cell_loop? MHDWill FLUENT 0 September 26, 2007 21:24
NACA0012 geometry/design software needed Franny Main CFD Forum 13 July 7, 2007 15:57


All times are GMT -4. The time now is 04:40.