[Gmsh] Extraction of elements whose edges are on the boundary

Sacconi, Andrea a.sacconi11 at imperial.ac.uk
Sat Feb 15 00:13:38 CET 2014


Hi everybody,

I would like to ask you a question about the boundary.

In order to traverse the boundary segments, I extract the geometrical edges and, for each of them, I can then enumerate all the mesh edges that have been generated as their children (they are sort of subsegments of those edges).
My question is: do you know if there is a direct method to extract the mesh element (i.e., the triangle with its global number) to which each boundary edge belongs? It's crucial, in order to prescribe the boundary conditions in my code!

Enumerating all the possible pairs of vertices (of the edges), storing them in a set (or something similar) and then traversing all the elements and comparing edges seems a solution to my problem, but quite inefficient and time-consuming. Is there something already implemented?

Thanks again for your patience and your help!
Best,

Andrea
__________________________________________________________

Andrea Sacconi
PhD student, Applied Mathematics
AMMP Section, Department of Mathematics, Imperial College London,
London SW7 2AZ, UK
a.sacconi11 at imperial.ac.uk