CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Technical] Order of points in a boundary patch

Register Blogs Community New Posts Updated Threads Search

Like Tree10Likes
  • 4 Post By camille.yvin
  • 6 Post By styleworker

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 16, 2010, 08:43
Default Order of points in a boundary patch
  #1
New Member
 
yvin
Join Date: Dec 2009
Posts: 7
Rep Power: 17
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, 09:35
Default
  #2
New Member
 
yvin
Join Date: Dec 2009
Posts: 7
Rep Power: 17
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, 10:02
Default
  #3
New Member
 
yvin
Join Date: Dec 2009
Posts: 7
Rep Power: 17
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.
camille.yvin is offline   Reply With Quote

Old   September 12, 2011, 11:18
Default
  #4
Member
 
Santiago
Join Date: Dec 2009
Posts: 85
Rep Power: 17
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, 06:15
Default
  #5
New Member
 
Mehran Saeedi
Join Date: Jan 2010
Posts: 8
Rep Power: 16
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: 15
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 3 others like this.
styleworker is offline   Reply With Quote

Old   May 24, 2015, 09:00
Default
  #7
Member
 
Fei Fan
Join Date: Jul 2013
Location: NanJing, China
Posts: 54
Rep Power: 13
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, 18:14
Default
  #8
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 203
Rep Power: 18
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

Old   November 11, 2015, 11:31
Default
  #9
New Member
 
Nitish
Join Date: Oct 2015
Location: Delft, Netherlands
Posts: 5
Rep Power: 11
nitishanand1989 is on a distinguished road
Hello,

I need to log the position and velocity of a time dependent problem. I know this piece of code will be really helpful for me. However, since I am now to OF am not able to figure out where to add.

Any help will be appreciated.!!
nitishanand1989 is offline   Reply With Quote

Reply

Tags
boundary, order, point


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
y+ and u+ values with low-Re RANS turbulence models: utility + testcase florian_krause OpenFOAM 114 August 23, 2023 06:37
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 08:30
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 07:28
[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 13:47.