CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Meshing Format & General Technical

Order of points in a boundary patch

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

Like Tree5Likes
  • 1 Post By camille.yvin
  • 4 Post By styleworker

Reply
 
LinkBack Thread Tools Display Modes
Old   April 16, 2010, 07:43
Default Order of points in a boundary patch
  #1
New Member
 
yvin
Join Date: Dec 2009
Posts: 7
Rep Power: 7
camille.yvin is on a distinguished road
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
camille.yvin is offline   Reply With Quote

Old   April 16, 2010, 08:35
Default
  #2
New Member
 
yvin
Join Date: Dec 2009
Posts: 7
Rep Power: 7
camille.yvin is on a distinguished road
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:
Originally Posted by camille.yvin View Post
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
camille.yvin is offline   Reply With Quote

Old   April 16, 2010, 09:02
Default
  #3
New Member
 
yvin
Join Date: Dec 2009
Posts: 7
Rep Power: 7
camille.yvin is on a distinguished road
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:
Originally Posted by camille.yvin View Post
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.
mm.abdollahzadeh likes this.
camille.yvin is offline   Reply With Quote

Old   September 12, 2011, 10:18
Default
  #4
Member
 
Santiago
Join Date: Dec 2009
Posts: 85
Rep Power: 7
gascortado is on a distinguished road
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
gascortado is offline   Reply With Quote

Old   September 30, 2011, 05:15
Default
  #5
New Member
 
Mehran Saeedi
Join Date: Jan 2010
Posts: 8
Rep Power: 7
Mehran is on a distinguished road
Hi Camille,

Thanks for your hints on finding the coordinates, it was much of help.
Mehran is offline   Reply With Quote

Old   October 30, 2013, 10:01
Default
  #6
Member
 
Join Date: May 2012
Posts: 55
Rep Power: 6
styleworker is on a distinguished road
you can use the localPoints function, too.

this code does the same:
Code:
const List<vector>& patchFound = mesh.boundaryMesh()[patchID].localPoints();
Info << "### localPoints" << patchFound << endl;
donno, Tobi, hua1015 and 1 others like this.
styleworker is offline   Reply With Quote

Old   May 24, 2015, 08:00
Default
  #7
Member
 
Fei Fan
Join Date: Jun 2013
Location: NanJing, China
Posts: 44
Rep Power: 4
Fanfei is on a distinguished road
Quote:
Originally Posted by styleworker View Post
you can use the localPoints function, too.

this code does the same:
Code:
const List<vector>& patchFound = mesh.boundaryMesh()[patchID].localPoints();
Info << "### localPoints" << patchFound << endl;
Hi i have a problem to access the coordinate of points as assign face cell. i used localPoints() funtion. when I use the mesh.boundaryMesh()[patchWallID].localPoints, it works, while i use for loop to access the coordinate of points, errors occured, it hints 'const class Foam::face' has no member named 'localPoints'. if I want to access the coorinate of points of boundaryface[i] what should i do? Thanks.
************code******************
for(int ii=0; ii<mesh.boundaryMesh().size();ii++)
Info<<mesh.boundaryMesh()[patchWallID][ii].localPoints<<endl;
**************************************

kind regards
Fan Fei
Fanfei is offline   Reply With Quote

Old   August 5, 2015, 17:14
Default
  #8
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 131
Rep Power: 8
wouter is on a distinguished road
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
wouter is offline   Reply With Quote

Reply

Tags
boundary, order, point

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
Wind turbine simulation Saturn CFX 34 October 16, 2014 05:27
Using starToFoam clo OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 33 September 26, 2012 04:04
Cyclic boundary condition qtian OpenFOAM Running, Solving & CFD 3 November 12, 2008 22:23
Create boundary fabrizio Open Source Meshers: Gmsh, Netgen, CGNS, ... 1 October 26, 2008 15:12
Import gmsh msh to Foam adorean Open Source Meshers: Gmsh, Netgen, CGNS, ... 24 April 27, 2005 08:19


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