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

How to loop over faces in a cell?

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes
  • 7 Post By andrewryan

Reply
 
LinkBack Thread Tools Search this Thread 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: 9
Rep Power: 17
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: 17
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: 9
Rep Power: 17
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, 20:20
Default
  #4
Senior Member
 
Thomas Oliveira
Join Date: Apr 2015
Posts: 114
Rep Power: 12
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


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
Loop over the faces of a cell in UDF Anthony Wachs Fluent UDF and Scheme Programming 6 April 2, 2024 11:10
DecomposePar unequal number of shared faces maka OpenFOAM Pre-Processing 6 August 12, 2010 10:01
NACA0012 geometry/design software needed Franny Main CFD Forum 13 July 7, 2007 16:57
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 05:15
Warning 097- AB Siemens 6 November 15, 2004 05:41


All times are GMT -4. The time now is 00:56.