[Gmsh] saving/reading meshed geometries from C code.

walter steffe walter.steffe at alice.it
Wed May 1 19:49:52 CEST 2019


Hello, many thanks for the advice.

I never noticed the great new public API and I have extensively used
private API in my code for a long time.
 
In the future I will try to replace tmem with public API (where
possible) in order to improve mainentability.

Nevertheles I may say that the private API (at least that one used in
my code me) seems also to be quite stable. In many years of development
very rarely I had to change my code as a consequence of a change in the
gmsh library.

Walter Steffè


On Wed, 2019-05-01 at 18:25 +0200, Christophe Geuzaine wrote:
> > On 28 Apr 2019, at 11:20, walter steffe <walter.steffe at alice.it>
> > wrote:
> > 
> > Hello, 
> > 
> > I am using c library of gmsh in my EmCAD tool.
> > The geometries are imported from step files using the OCC library
> > and
> > meshed with gmsh.
> > 
> > I would like to do the following: First I would like to mesh an OCC
> > model (IF_model) which contains a set of faces. Then I would like
> > to
> > mesh a second OCC model (solid_model) which includes all the faces
> > of
> > the IF_model and a few additional solid bodies. I need to have a 3D
> > (tetraherdal) mesh for the solid_model and I need to share the 2D
> > mesh
> > with the IF_model.
> > 
> > So I was thinking to import the mesh file associated with the
> > IF_model
> > and use the functions "void copyMesh(GEdge *from, GEdge *to, int
> > direction)" and "static void copyMesh(GFace *source, GFace
> > *target)" in
> > order to copy mesh data from IF_model to solid_model.
> > 
> > The problem is that copyMesh requires geometrical data (Gedge *from
> > or
> > GFace *source) and I do not know how to transfer these data from
> > IF_model to solid_model.
> > 
> > Is there a way to do that ?
> 
> I wouldn't use the (undocumented) private API anymore, and switch to
> the public API. Then if you are able to identify the faces in both
> models (by label, by tag, or simply geometrically through their
> bounding box), it would just be a matter of using
> gmsh.model.mesh.getElements/getNodes and
> gmsh.model.mesh.setElements/setNodes.
> 
> Christophe
> 
> 
> > 
> > Thanks for your attention.
> > 
> > Walter Steffè
> > 
> > 
> > 
> > _______________________________________________
> > gmsh mailing list
> > gmsh at onelab.info
> > http://onelab.info/mailman/listinfo/gmsh
> 
>> Prof. Christophe Geuzaine
> University of Liege, Electrical Engineering and Computer Science 
> http://www.montefiore.ulg.ac.be/~geuzaine
> 
> 
> 




More information about the gmsh mailing list