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

Entries for September 17, 2014

Register Blogs Community New Posts Updated Threads Search

Old

How to loop over cell faces

Posted September 17, 2014 at 11: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;
...
New Member
Posted in Uncategorized
Views 1455 Comments 0 pfhan is offline Edit Tags

All times are GMT -4. The time now is 15:31.