CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Boundary faces sharing a point

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 12, 2016, 06:07
Default Boundary faces sharing a point
  #1
Member
 
Join Date: May 2014
Posts: 39
Rep Power: 4
Phil_ is on a distinguished road
Hi all,

I'm trying to get all the faces sharing a point.

For the internal faces the following works:

Code:
labelList facesSharingPoint = mesh.pointFaces()[pointLabelI];
In order to get the boundary faces I tried:

Code:
labelList boundaryFacesSharingPoint = mesh.boundaryMesh()[patchI]pointFaces()[pointLabelI];
This fails, as the points are defined on the patches by local labels. How is it possible to return the boundary faces through a global point label?

Philip
Phil_ is offline   Reply With Quote

Old   July 12, 2016, 10:48
Default
  #2
Member
 
Jerry
Join Date: Oct 2013
Location: Salt Lake City, UT, USA
Posts: 52
Rep Power: 4
Jerryfan is on a distinguished road
Hi,



Each of the fvPatch object maintains a polyPatch instance. There is a start() function defining in polyPatch which returns the start label of this patch in the polyMesh face list. This returned label is in the global level. The other thing about the patch label is that for each of the patch, its storage in the global polyMesh face list is continuous. Therefore, if you add the start label of that patch to the local labels you obtained, you will be able to get the global label.


Quote:
forAll (mesh.BoundaryMesh(), PatchI)
{
label pstart=mesh.boundaryMesh()[patchI].start();
labelList boundaryFacesSharingPoint = mesh.boundaryMesh()[patchI]pointFaces();
forAll (boundaryFacesSharingPoint, pI)
{
boundaryFacesSharingPoint[pI] += pstart;
}
}

I didn't test the above code. But the idea should work for you. I hope it will help you.
Jerryfan is offline   Reply With Quote

Old   July 13, 2016, 02:53
Default
  #3
Member
 
Join Date: May 2014
Posts: 39
Rep Power: 4
Phil_ is on a distinguished road
Hi Jerryfan,

thanks for your suggestion.

Maybe I'm not fully understanding your idea, but the main issue here is the relation of global vertice labels to local patch vertice labels.

Code:
mesh.pointFaces()
returns a labelListList containing the global vertice labels and the global labels of the internal faces sharing the respective vertice. I need to know the boundary faces sharing a vertice too.

Code:
mesh.boundaryMesh()[patchI]pointFaces()
returns a labelListList containing the local vertice labels of the patch and the local labels of the boundary faces sharing the respective vertice.

So the problem is, that I only know the global vertice label. Is there a function etc. to get the relation of global to local patch vertice labels?

Philip
Phil_ is offline   Reply With Quote

Old   July 13, 2016, 08:33
Default
  #4
Member
 
Join Date: May 2014
Posts: 39
Rep Power: 4
Phil_ is on a distinguished road
I found an much easier way to accomplish the original task, so finding all the faces sharing a point is no longer needed
Phil_ is offline   Reply With Quote

Old   July 13, 2016, 12:07
Default
  #5
Member
 
Jerry
Join Date: Oct 2013
Location: Salt Lake City, UT, USA
Posts: 52
Rep Power: 4
Jerryfan is on a distinguished road
Would you mind sharing it?
Jerryfan is offline   Reply With Quote

Old   July 14, 2016, 03:32
Default
  #6
Member
 
Join Date: May 2014
Posts: 39
Rep Power: 4
Phil_ is on a distinguished road
It has nothing to do with the original question, so I guess it's not worth sharing. I'm
avoiding any search for faces sharing a point and instead utilize
Code:
mesh.pointPoints()[pI];
to do stuff with the direct neighbor points.
Phil_ is offline   Reply With Quote

Reply

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
Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 19:57
foam-extend_3.1 decompose and pyfoam warning shipman OpenFOAM 3 July 24, 2014 08:14
determining displacement for added points CFDnewbie147 OpenFOAM Native Meshers: snappyHexMesh and Others 1 October 22, 2013 09:53
Add Mesh Layers doesnt work on the whole surface Kryo OpenFOAM Native Meshers: snappyHexMesh and Others 8 September 13, 2012 09:28
[Other] Mesh Importing Problem cuteapathy ANSYS Meshing & Geometry 1 June 7, 2012 13:39


All times are GMT -4. The time now is 14:40.