CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

How to get the name of a patch

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 31, 2009, 07:56
Default How to get the name of a patch
  #1
New Member
 
Join Date: Mar 2009
Posts: 20
Rep Power: 8
Xabi is on a distinguished road
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 is offline   Reply With Quote

Old   March 31, 2009, 08:09
Default I got it
  #2
New Member
 
Join Date: Mar 2009
Posts: 20
Rep Power: 8
Xabi is on a distinguished road
Hi,

I got it:

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

Thank you anyway.
Xabi is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CheckMeshbs errors ivanyao OpenFOAM Running, Solving & CFD 2 March 11, 2009 03:34
Create boundary fabrizio Open Source Meshers: Gmsh, Netgen, CGNS, ... 1 October 26, 2008 15:12
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51
Import gmsh msh to Foam adorean Open Source Meshers: Gmsh, Netgen, CGNS, ... 24 April 27, 2005 08:19
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12


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