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

How to loop over faces in a cell?

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

Like Tree2Likes
  • 2 Post By andrewryan

Reply
 
LinkBack Thread Tools Display Modes
Old   November 30, 2009, 06:04
Default How to loop over faces in a cell?
  #1
New Member
 
Juan Hierro
Join Date: Mar 2009
Posts: 11
Rep Power: 9
jhierroa is on a distinguished road
Dear sirs,

I am wondering how may I loop over all the faces in a cell.

I have been looking at the code (mesh definition) and have found only a reference to faces, neighbours and owners.

Is there any way to find all the faces surrounding a given cell?

Yours faithfully,
jhierroa is offline   Reply With Quote

Old   November 30, 2009, 06:09
Default
  #2
Member
 
Andrew Ryan
Join Date: Mar 2009
Posts: 47
Rep Power: 9
andrewryan is on a distinguished road
For example look in src/lagrangian/basic/Particle/Particle.C on line 75:

Code:
const labelList& faces = mesh.cells()[celli];
andrewryan is offline   Reply With Quote

Old   November 30, 2009, 06:42
Default Thank you very much.
  #3
New Member
 
Juan Hierro
Join Date: Mar 2009
Posts: 11
Rep Power: 9
jhierroa is on a distinguished road
In fact, what I was looking for is defined in primitiveMesh.H

I could not have found it without your hint.

Thanks!
jhierroa is offline   Reply With Quote

Old   May 29, 2016, 19:20
Default
  #4
Member
 
Thomas Oliveira
Join Date: Apr 2015
Posts: 77
Rep Power: 3
t.oliveira is on a distinguished road
Quote:
Originally Posted by andrewryan View Post
Code:
const labelList& faces = mesh.cells()[celli];
It is not intuitive that mesh.cells()[celli] will give you a list of labels of the faces surrounding the cell celli but don't resist as I did. Do believe in andrewryan.
t.oliveira 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
Loop over the faces of a cell in UDF Anthony Wachs Fluent UDF and Scheme Programming 5 September 20, 2015 07:22
DecomposePar unequal number of shared faces maka OpenFOAM Pre-Processing 6 August 12, 2010 09:01
NACA0012 geometry/design software needed Franny Main CFD Forum 13 July 7, 2007 15:57
Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15
Warning 097- AB CD-adapco 6 November 15, 2004 05:41


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