CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Running, Solving & CFD

Extract patch coordinates

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

Like Tree1Likes
  • 1 Post By batta31

LinkBack Thread Tools Display Modes
Old   November 27, 2012, 10:42
Exclamation Extract patch coordinates
Join Date: Sep 2012
Posts: 95
Rep Power: 7
batta31 is on a distinguished road
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
batta31 is offline   Reply With Quote

Old   November 28, 2012, 06:38
Join Date: Sep 2012
Posts: 95
Rep Power: 7
batta31 is on a distinguished road
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.txt");"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";

PicklER likes this.
batta31 is offline   Reply With Quote

Old   May 9, 2016, 13:43
Join Date: Jun 2014
Posts: 36
Rep Power: 5
Divyaprakash is on a distinguished road
:O Thanks for your code.
Divyaprakash is offline   Reply With Quote


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
Using starToFoam clo OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 33 September 26, 2012 04:04
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
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 20:18.