Extract patch coordinates
Hi guys I've got a simple question about the mesh:
I would like to extract the point coordinates of a patch and save them on a file. Is it possible? Any help is really appreciated Thanks in advance Simone |
Hi it's me again!
I found how to solve my problem by myself. Besides I write my solution, just in case someone wants to have a look; hope it can help :) pointField meshPoints(mesh.points()); word patchName = "foil"; label patchID = mesh.boundary().findPatchID(patchName); const polyPatch& patchFound = mesh.boundaryMesh()[patchID]; labelList labelPatchFound( patchFound.meshPoints() ); std::ofstream naca_x; std::ofstream naca_y; naca_x_top.open("naca_x.txt"); naca_y_top.open("naca_y.txt"); forAll(labelPatchFound , label) { vector coord = meshPoints[labelPatchFound[label]]; naca_x << coordTop[0]; naca_x << "\n"; naca_y << coordTop[1]; naca_y << "\n"; } naca_x.close(); naca_y.close(); |
:O :o Thanks for your code. :)
|
All times are GMT -4. The time now is 20:31. |