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

How to loop over cell faces

Register Blogs Community New Posts Updated Threads Search

Rate this Entry

How to loop over cell faces

Posted September 17, 2014 at 12:09 by pfhan

How to loop over cell faces qoute

Quote:
Originally Posted by fumiya View Post
Hi Marshak,

I think it is better to start another thread for being easy to search later.
Regarding your question, the following is my sample code:

Code:
scalar sumA = 0.0; //Sum of areas of all faces of a cell
const cell& cFaces = mesh.cells()[yourCellIndex];

forAll(cFaces, i)
{
    sumA += mag(mesh.Sf()[cFaces[i]]); //cFaces[i]: face label of a cell
}

scalar Length = mesh.V()[yourCellIndex]/sumA;
Hopt that helps,
Fumiya
Posted in Uncategorized
Views 1521 Comments 0 Edit Tags Email Blog Entry
« Prev     Main     Next »
Total Comments 0

Comments

 

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