CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Extract patch coordinates

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

Like Tree3Likes
  • 3 Post By batta31

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 27, 2012, 10:42
Exclamation Extract patch coordinates
  #1
Member
 
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 13
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
Simone
batta31 is offline   Reply With Quote

Old   November 28, 2012, 06:38
Default
  #2
Member
 
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 13
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_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();
PicklER, Akshay_11235 and lucb-cfd like this.
batta31 is offline   Reply With Quote

Old   May 9, 2016, 14:43
Default
  #3
Member
 
Divyaprakash
Join Date: Jun 2014
Posts: 68
Rep Power: 11
Divyaprakash is on a distinguished road
:O Thanks for your code.
Divyaprakash is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 04:05.