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/)
-   -   Obtain PointLabels from code (http://www.cfd-online.com/Forums/openfoam-solving/59629-obtain-pointlabels-code.html)

bfa June 19, 2007 12:27

Hello out there, I need two
 
Hello out there,

I need two things to be done, and somehow don't manage to do it:
1) How can I get the ID of a patch by name (I tried findPatchID, but it doesn't work on a fvMesh)?
2) How can I get the labels of the points belonging to this patch?

by the way: the search function in my doxygen representation is broken and it's quite hard to guess the right class if i want to find a specific function. Is that a known issue or am I alone with this problem?

thanks for your guidance
Bjoern

fra76 June 19, 2007 12:50

Hi Björn! The answer to the f
 
Hi Björn!
The answer to the first question should be:
label patchI = mesh.boundaryMesh().findPatchID("patchname");

Regarding the second question, I don't know exactly how to access the point, but with this line you can access the faces centers:

const fvPatchVectorField& faceCentres = mesh.Cf().boundaryField()[patchID];

For the point, perhaps something like:

const fvPatchVectorField& faceCentres = mesh.points().boundaryField()[patchID];

But I've never tried it...

eugene June 19, 2007 13:09

You can get all the point labe
 
You can get all the point labels on a patch via:

const labelList listOfPatchPointLabels mesh.boundaryMesh()[patchID].meshPoints();

Check:
src/OpenFOAM/lnInclude/PrimitivePatch.H and polyPatch.H for the members of polyPatch (i.e. mesh.boundaryMesh()[patchID]).

bfa June 19, 2007 14:08

thanks a lot to both of you!
 
thanks a lot to both of you!
it worked just fine

alberto June 19, 2007 15:25

The search function in the dox
 
The search function in the doxygen documentation requires you install the documentation on a web server with php enabled.

Regards,
Alberto


All times are GMT -4. The time now is 11:35.