CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to access the number of faces on a boundary (https://www.cfd-online.com/Forums/openfoam-solving/59218-how-access-number-faces-boundary.html)

jam January 20, 2008 12:01

Hi all, What is the function
 
Hi all,
What is the function to access the total number of faces ( triangles) on each boundary?
I have this function:
Info << "number " << mesh.boundaryMesh()[0] << endl;
which give:
patch
patch0
5506 945258


for patch no 0.
I would like to extract the number 5506 from this lot to do some calculation.
Thanks,
-Alain

jam January 20, 2008 13:13

I found it: scalar number
 
I found it:

scalar number = mesh.boundaryMesh()[PatchID].size() ;

where PatchID is the patch number.

-Alain


All times are GMT -4. The time now is 19:30.