CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   How to loop over faces in a cell? (

jhierroa November 30, 2009 06:04

How to loop over faces in a cell?
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,

andrewryan November 30, 2009 06:09

For example look in src/lagrangian/basic/Particle/Particle.C on line 75:


const labelList& faces = mesh.cells()[celli];

jhierroa November 30, 2009 06:42

Thank you very much.
In fact, what I was looking for is defined in primitiveMesh.H

I could not have found it without your hint.


All times are GMT -4. The time now is 20:07.