|
[Sponsors] |
November 27, 2012, 10:42 |
Extract patch coordinates
|
#1 |
Member
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 13 |
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 |
|
November 28, 2012, 06:38 |
|
#2 |
Member
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 13 |
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:fstream naca_x; std:fstream 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(); |
|
May 9, 2016, 14:43 |
|
#3 |
Member
Divyaprakash
Join Date: Jun 2014
Posts: 68
Rep Power: 11 |
:O Thanks for your code.
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Commercial meshers] Using starToFoam | clo | OpenFOAM Meshing & Mesh Conversion | 33 | September 26, 2012 05:04 |
[Other] StarToFoam error | Kart | OpenFOAM Meshing & Mesh Conversion | 1 | February 4, 2010 05:38 |
CheckMeshbs errors | ivanyao | OpenFOAM Running, Solving & CFD | 2 | March 11, 2009 03:34 |
[Gmsh] Import gmsh msh to Foam | adorean | OpenFOAM Meshing & Mesh Conversion | 24 | April 27, 2005 09:19 |
Multicomponent fluid | Andrea | CFX | 2 | October 11, 2004 06:12 |