[Gmsh] Sets of nodes

Christophe Geuzaine geuzaine at acm.caltech.edu
Wed Apr 6 18:12:45 CEST 2005


Charles Augarde wrote:
> I often use GMSH to prepare meshes for other FE programs that require 
> boundary conditions to be applied node by node, e.g. prescribed 
> displacments in solid mechanics.
> 
> Is there an "easy" way in GMSH to obtain lists of nodes and their 
> coordinates, along a Physical Line, say? I can see how one can obtain 
> lists of _elements_ associated with a physical entity such as a line or 
> a surface but cannot see how it can be done for nodes (or find anything 
> in the archive to help)?
> 

Charles - With the .msh file format, the only way to obtain a list of
entities (nodes, edges, faces, ...) associated with a physical region is 
to derive it from the corresponding list of elements.

An easy and efficient way to construct such a list is to fill a "map" 
(in C++, something like "map<node_num,node_coords>") while looping on 
the elements.

Christophe

-- 
Christophe Geuzaine
Applied and Computational Mathematics, Caltech
geuzaine at acm.caltech.edu - http://geuz.org