[Gmsh] How to associate line elements on boundaries with inner elements

jeremy theler jeremy at talador.com.ar
Wed Nov 30 22:09:42 CET 2011


Dear All,

Coincidentally, last week I ran into the very same issue Y Jiang did when 
dealing with Neumann boundary conditions for a finite element solver I am 
writing. I ended up doing what he proposes, i.e. trying to determine to which 
2D element each 1D element in a boundary "belongs" during run-time. Although 
it works, of course it is very inefficient, and I just coded the 2D case. The 3D 
case complexity scales exponentially. I would be very interested in a solution 
in which this "linking" is made when creating the mesh file.

Moreover, in a non-totally-unrelated topic, I would also like to have a list 
of "neighbors" elements for each volumetric (2D in this case) element in order 
to implement a solver based on the finite-volumes method.

If any of the members of this list comes up with a solution for either of 
these issues, I will be very thankful.

BTW, for the gmsh developers: great work!


jeremy


On Wednesday 30 November 2011 14:31:00 Y JIANG wrote:
> Dear Gmsh gurus,
> 
> I just started using Gmsh and found it is really great. But I come
> across a problem when I use it with my own finite element solver. Take
> 2D analysis for instance, the solver needs to know which element and
> which face of it in order to assign proper boundary conditions. This is
> quite different from Gmsh's standard output, where elements on boundary
> are represented as line elements and have no explicit relation with the
> inner elements they belong to.
> 
> I thought about an awkward way to associate the line elements and inner
> elements by comparing the nodes on boundaries. But this seems very
> inefficient. A better way would be adding corresponding inner element
> tags and the face tags to the line elements. Is it possible to do it in
> Gmsh, or are there other better methods in doing so?
> 
> Thank you for all your suggestions.
> 
> Y Jiang