CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   How to get the name of a patch (

Xabi March 31, 2009 07:56

How to get the name of a patch
Hi all!

I need to get the name of the patches that are set in the PolyMesh/boundary file.
I have to connect the following pieces of code (wallViscosityI.H)that is the reason why I need a vector with the names of the patches.

Code 1: const fvPatchList& patches = mesh_.boundary();
forAll(patches,patchy) {

const fvPatch& curPatch = patches[patchi];
Code 2: label Patchid=mesh_.boundaryMesh().findPatchID("_______" ).

The vector I need to get should be included inside the brackets.
All advices are wellcome.

Thank you in advance.

Xabi March 31, 2009 08:09

I got it

I got it:

Code 2: label Patchid=mesh_.boundaryMesh().findPatchID(curPatch. name()).

Thank you anyway.

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