Gmsh Writer Skipping Nodes With `output_list` Parameter

Issue #109 new
Ben Whitney created an issue

I am having trouble outputting a selection of my mesh's entities when using the Gmsh writer. In the attached script, I create a triangle with nodes (0, 0, 0), (1, 0, 0), and (0, 1, 0). write_mesh(char *file_name) saves the mesh correctly, while write_mesh(char *file_name, EntityHandle *output_list, int num_sets) does not. Here’s my output:

> bin/tri && cat first.msh && echo '' && cat second.msh
$MeshFormat
2.0 0 8
$EndMeshFormat
$Nodes
3
1 0 0 0
2 1 0 0
3 0 1 0
$EndNodes
$Elements
1
-1 2 0 1 2 3
$EndElements

$MeshFormat
2.0 0 8
$EndMeshFormat
$Nodes
1
1 0.3333333333 0.3333333333 0
$EndNodes
$Elements
1
-1 2 2 -1 2 1 2 3
$EndElements

For comparison, the VTK writer outputs the same thing in both cases. The documentation for the second signature states:

Write mesh to file 'file_name'; if output_list is non-NULL, only material sets contained in that list will be written.

I’m guessing I’m missing a distinction between a ‘material set’ and a normal meshset. In any case, though, something is wrong, because there is no node with coordinates (1/3, 1/3, 0) in the mesh.

Comments (1)

  1. Vijay M

    Good catch. Thanks for raising this issue. I can replicate it locally. I will take a look and push a fix this coming week.

  2. Log in to comment