Discussion:
[Gmsh] Gmsh how to extract the node ID's on a given 3D Mesh Boundary Surface
Zuheyr Alsalihi
2018-06-17 09:12:55 UTC
Permalink
Hello,
Is there a way to get the node ID's of the elements that lie on a boundary
surface in a 3d solid mesh where I mark the
surface by creating a physical surface.

Thank you for reading!

Best,
--
Zuheyr Alsalihi
G. D. McBain
2018-06-18 01:22:18 UTC
Permalink
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Is there a way to get the node ID's of the elements that lie on a boundary surface in a 3d solid mesh where I mark the surface by creating a physical surface.
I don't know how to do that directly in Gmsh, but for a (two-dimensional) example using Python to extract the nodes belonging to different Physical Lines, see

https://github.com/kinnala/scikit-fem/blob/master/examples/ex14.py

The essential line is the dict-comprehension on line 52:

boundaries = {bc:
np.unique(cells['line'][cell_data['line']['gmsh:physical'] ==
field_data[bc][0]])

for bc in field_data if field_data[bc][1] == 1}

basically having loaded the mesh from Gmsh into Python with meshio, this filters the element-node connectivity array according to the Physical boundary entities, and then applies numpy.unique to each subset.
Zuheyr Alsalihi
2018-06-18 10:00:22 UTC
Permalink
Thank you I appreciated it very much.
Prof. Geuzaine indicated me a solution in the follow-up.

As i mentioned in my reply to his email below, I was confused/did not
think, that the CPS6 type surface element
with its own ID is one of the faces of a 3D C3D10 type tetrahedra element
who has another ID.
So looping over the tagged physical group surface elements is what I need
to do!


Many thanks again and best regards,
Zuheyr
Post by G. D. McBain
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Is there a way to get the node ID's of the elements that lie on a
boundary surface in a 3d solid mesh where I mark the surface by creating a
physical surface.
I don't know how to do that directly in Gmsh, but for a (two-dimensional)
example using Python to extract the nodes belonging to different Physical
Lines, see
https://github.com/kinnala/scikit-fem/blob/master/examples/ex14.py
np.unique(cells['line'][cell_data['line']['
gmsh:physical'] ==
field_data[bc][0]])
for bc in field_data if field_data[bc][1] == 1}
basically having loaded the mesh from Gmsh into Python with meshio, this
filters the element-node connectivity array according to the Physical
boundary entities, and then applies numpy.unique to each subset.
--
Zuheyr Alsalihi
Jeremy Theler
2018-06-18 10:32:31 UTC
Permalink
Post by Zuheyr Alsalihi
Thank you I appreciated it very much.
Prof. Geuzaine indicated me a solution in the follow-up.
As i mentioned in my reply to his email below, I was confused/did not think, that the CPS6 type surface element
with its own ID is one of the faces of a 3D C3D10 type tetrahedra element who has another ID.
I would like to comment on this. I find the way that CalculiX treats all this very awkard, and leads users
into situations like what happens to you. Gmsh's approach is far superior. I do not understand why
many many users keep on with codes like CalculiX that take all the FEA stuff back to the 70s.
Post by Zuheyr Alsalihi
So looping over the tagged physical group surface elements is what I need to do!
Actually, this should be done on the FEA solver side, not on the user side.
But again, there are people that are happy with FORTRAN.

--
jeremy theler
www.seamplex.com

Christophe Geuzaine
2018-06-18 08:25:59 UTC
Permalink
Post by Zuheyr Alsalihi
Hello,
Is there a way to get the node ID's of the elements that lie on a boundary surface in a 3d solid mesh where I mark the
surface by creating a physical surface.
Load the mesh and retrieve the elements tagged with the physical group; then loop over the elements and get the nodes.

(The gmsh::model::mesh::getNodesForPhysicalGroup function in the Gmsh API does just that.)
Post by Zuheyr Alsalihi
Thank you for reading!
Best,
--
Zuheyr Alsalihi
_______________________________________________
gmsh mailing list
http://onelab.info/mailman/listinfo/gmsh
—
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine

Free software: http://gmsh.info | http://getdp.info | http://onelab.info
Zuheyr Alsalihi
2018-06-18 09:37:56 UTC
Permalink
Dear Prof. Geuzaine,

Mille grand merci.

The question is I only need the nodes on the on the tagged Physical Surface
surface.

For instance: in the msh abaqus.inp with "Save groups of nodes" option:
my tagged surface is:

*ELSET,ELSET=PeriodicSurfacePS
589727, ......

where

******* E L E M E N T S *************
*ELEMENT, type=CPS6, ELSET=Surface7
589727, 1150, 13, 18137, 1170, 18413, 18414

are then the nodes of the SURFACE ELEMENT 589727

but what I am missing then is :
this surface element is not one of the faces of a 3D tetrahedra element as
I cannot find an element 589727 in the Volume :
*ELEMENT, type=C3D10, ELSET=Volume1

If I use the nodes from the line: 1150, 13, 18137, 1170, 18413, 18414 for
the surface element 589727, I am set?

Many thanks and best regards,
Zuheyr
--------
Dr. Zuheyr Alsalihi
Senior Research Engineer
Turbomachinery and Propulsion Department von Karman Institute for
Fluid Dynamics Ch. de Waterloo, 72, Rhode-St-Genese
Belgium Direct Line: +32 (0)2 359 98 65
Fax: +32 (0)2 359 96 00
E-mail: ***@vki.ac.be
http://www.vki.ac.be
Post by Zuheyr Alsalihi
Hello,
Is there a way to get the node ID's of the elements that lie on a
boundary surface in a 3d solid mesh where I mark the
surface by creating a physical surface.
Load the mesh and retrieve the elements tagged with the physical group;
then loop over the elements and get the nodes.
(The gmsh::model::mesh::getNodesForPhysicalGroup function in the Gmsh API does just that.)
Thank you for reading!
Best,
--
Zuheyr Alsalihi
_______________________________________________
gmsh mailing list
http://onelab.info/mailman/listinfo/gmsh
—
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science
http://www.montefiore.ulg.ac.be/~geuzaine
Free software: http://gmsh.info | http://getdp.info | http://onelab.info
--
Zuheyr Alsalihi
Loading...