Order of points in a boundary patch
Hello,
I try to get the order of points (whitout redundancy) in a boundary field to correctly apply a pointVectorField to modify a mesh. I precise that I use an external software to evaluate this field. I tried with a polyPatch : label PatchId = mesh.boundaryMesh().findPatchID("name"); const polypatch& namePolyPatch = mesh.boundaryMesh()[PatchID]; But after that I don't know what to do. How extract ID of points or they coordinates in the right order that OpenFOAM use ? Thanks for helping. Camille |
Hello, it's me again.
I think I am not far away. I use : label PatchId = mesh.boundaryMesh().findPatchID("name"); const polypatch& namePolyPatch = mesh.boundaryMesh()[PatchID]; labelList test(namePolyPatch.boundaryPoints()); forAll( test , pos) { Info << test[pos] << endl; } But the number of label given is not enought so I thing it's not a good method. I keep searching. Quote:
|
Hello, It's me again :).
I think I succeed in having what I want (only the position). It's not a pretty solution but it could help. My code : #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" label PatchID = mesh.boundaryMesh().findPatchID("tuyau"); const polyPatch& patchFound = mesh.boundaryMesh()[PatchID]; labelList labelPatchFound( patchFound.meshPoints() ); pointField meshPoints(mesh.points()); long nombre = 0; forAll(labelPatchFound , label) { vector coord = meshPoints[labelPatchFound[label]]; Info << coord[0] << " " << coord[1] << " " << coord[2] << endl; nombre++; } Info << nombre << endl; Any comment will be appreciated. Quote:
|
Hi Camille,
I need to find coordinate points of the mesh also so this here helps a lot. I am very interested, however, in finding out how do you know for example that by typing .meshPoints() you will get the mesh points. Is there a list of classes somewhere where I can read about the name of the different classes and what they do? I will appreciate any help. Thanks |
Hi Camille,
Thanks for your hints on finding the coordinates, it was much of help. |
you can use the localPoints function, too.
this code does the same: Code:
const List<vector>& patchFound = mesh.boundaryMesh()[patchID].localPoints(); |
Quote:
************code****************** for(int ii=0; ii<mesh.boundaryMesh().size();ii++) Info<<mesh.boundaryMesh()[patchWallID][ii].localPoints<<endl; ************************************** kind regards Fan Fei |
hello Fanfei,
I do not know much about this, but I think you need to add parentasis () at the end so: .localPoints() Hope this helps Wouter |
Hello,
I need to log the position and velocity of a time dependent problem. I know this piece of code will be really helpful for me. However, since I am now to OF am not able to figure out where to add. Any help will be appreciated.!! |
All times are GMT -4. The time now is 06:43. |