CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to get the name of a patch (http://www.cfd-online.com/Forums/openfoam-solving/63174-how-get-name-patch.html)

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

Xabi March 31, 2009 08:09

I got it
 
Hi,

I got it:

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

Thank you anyway.


All times are GMT -4. The time now is 18:41.