[Gmsh] Gmsh how to extract the node ID's on a given 3D Mesh Boundary Surface
G. D. McBain
gdmcbain at protonmail.com
Mon Jun 18 03:22:18 CEST 2018
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Le 17 juin 2018 7:12 PM, Zuheyr Alsalihi <zuheyr at gmail.com> a écrit :
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20180617/2db24cd8/attachment.html>
More information about the gmsh
mailing list