CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > 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 Search this Thread Display Modes
Old   March 20, 2009, 04:21
Default How to loop through all the field?
  #1
New Member
 
Shui Pei
Join Date: Mar 2009
Posts: 27
Rep Power: 17
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, 04:38
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
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, 05:49
Default
  #3
New Member
 
Shui Pei
Join Date: Mar 2009
Posts: 27
Rep Power: 17
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, 07:11
Default
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
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, 20:41
Default
  #5
New Member
 
Shui Pei
Join Date: Mar 2009
Posts: 27
Rep Power: 17
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 Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Gmsh] Problem with Gmsh nishant_hull OpenFOAM Meshing & Mesh Conversion 23 August 5, 2015 02:09
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 06: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 21:25.