[Gmsh] Physical names and step files

Christophe Geuzaine cgeuzaine at ulg.ac.be
Wed Mar 7 07:27:27 CET 2012


On 05 Mar 2012, at 23:56, Wayne Christopher wrote:

> Dear Gmsh Users,
> 
> I would like to write a Step file (from my app which uses OpenCascade), read it into gmsh and create a mesh in batch mode, and read the msh file back into my app, associating the triangles and tetras with the original shapes.
> 
> What I am seeing is that there is no PhysicalNames section in the output msh file, and the values of the physical names tag seems arbitrary.  (Also the numbers used for triangle regions and tetra regions overlap).
> 

If you did not define physical tags, then by default all the elements in the mesh will be saved with

- an elementary tag that corresponds to the id of the geometrical entity they discretize
- a physical tag == 0

> I'm assuming that the right way to handle this requires me to attach labels to the volume, surface, curve entities in the step file and somehow tell gmsh to use these labels as the PhysicalNames in the output file.  Is this correct and if so how would I specify this?
> 

Just create a .geo file that

- merges the .step file (Merge "file.step";)
- and defines the physical tags you want (Physical Volume("my volume") = {1,2,3};)

By default, when physical groups are defined, only those elements that belong to physical groups are saved.


> The other fly in the ointment here is that OpenCascade seems to ignore the labels I attach to sub-shapes and this seems to be a long-standing problem - see http://www.opencascade.org/org/forum/thread_14829 ..  Has anybody dealt with this issue?
> 
> Thanks for the help!
> 
>    Wayne
> 
> _______________________________________________
> gmsh mailing list
> gmsh at geuz.org
> http://www.geuz.org/mailman/listinfo/gmsh

-- 
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science 
http://www.montefiore.ulg.ac.be/~geuzaine