Hi all, I understand there is a previous thread on a similar issue: https://fenicsproject.discourse.group/t/transitioning-from-mesh-xml-to-mesh-xdmf-from-dolfin-convert-to-meshio/412/18 but I’m not sure if this problem has to do with the version of gmsh.
I have 2 examples of mesh that I wish to work with: 1) Box.msh (2D) 2) Cylinder (3D)
For the 2D problem I write:
msh = meshio.read(“Box.msh”)
meshio.write(“Box.xdmf”, meshio.Mesh(points=msh.points, cells={“triangle”: msh.cells[“triangle”]}))
and for the 3D problem I write:
msh = meshio.read(“Cylinder.msh”)
meshio.write(“Cylinder.xdmf”, meshio.Mesh(points=msh.points, cells={“triangle”: msh.cells[“triangle”]}))
In both cases, I get a segmentation fault error:
[cbl-02:08311] *** Process received signal ***
[cbl-02:08311] Signal: Segmentation fault (11)
[cbl-02:08311] Signal code: Address not mapped (1)
[cbl-02:08311] Failing at address: 0x7ff500000720
[cbl-02:08311] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20)[0x7ff54f2a0f20]
[cbl-02:08311] [ 1] /lib/x86_64-linux-gnu/libc.so.6(+0x18e5c7)[0x7ff54f3f05c7]
[cbl-02:08311] [ 2] /home/karthic/.local/lib/python3.6/site-packages/h5py/_errors.cpython-36m-x86_64-linux-gnu.so(+0x43b7)[0x7ff50bdf73b7]
[cbl-02:08311] [ 3] /home/karthic/.local/lib/python3.6/site-packages/h5py/defs.cpython-36m-x86_64-linux-gnu.so(+0xc23e)[0x7ff50a82923e]
[cbl-02:08311] [ 4] /home/karthic/.local/lib/python3.6/site-packages/h5py/h5t.cpython-36m-x86_64-linux-gnu.so(+0x11b52)[0x7ff50a5bbb52]
[cbl-02:08311] [ 5] /home/karthic/.local/lib/python3.6/site-packages/h5py/h5t.cpython-36m-x86_64-linux-gnu.so(+0x9aef)[0x7ff50a5b3aef]
[cbl-02:08311] [ 6] /home/karthic/.local/lib/python3.6/site-packages/h5py/h5t.cpython-36m-x86_64-linux-gnu.so(PyInit_h5t+0x3a77)[0x7ff50a5f2a87]
[cbl-02:08311] [ 7] python3(_PyImport_LoadDynamicModuleWithSpec+0x178)[0x5e4268]
[cbl-02:08311] [ 8] python3[0x5e4522]
[cbl-02:08311] [ 9] python3(PyCFunction_Call+0x13e)[0x56246e]
[cbl-02:08311] [10] python3(_PyEval_EvalFrameDefault+0x58c6)[0x4fed26]
[cbl-02:08311] [11] python3[0x4f6128]
[cbl-02:08311] [12] python3[0x4f7d60]
[cbl-02:08311] [13] python3[0x4f876d]
[cbl-02:08311] [14] python3(_PyEval_EvalFrameDefault+0x467)[0x4f98c7]
[cbl-02:08311] [15] python3[0x4f7a28]
[cbl-02:08311] [16] python3[0x4f876d]
[cbl-02:08311] [17] python3(_PyEval_EvalFrameDefault+0x467)[0x4f98c7]
[cbl-02:08311] [18] python3[0x4f7a28]
[cbl-02:08311] [19] python3[0x4f876d]
[cbl-02:08311] [20] python3(_PyEval_EvalFrameDefault+0x467)[0x4f98c7]
[cbl-02:08311] [21] python3[0x4f7a28]
[cbl-02:08311] [22] python3[0x4f876d]
[cbl-02:08311] [23] python3(_PyEval_EvalFrameDefault+0x467)[0x4f98c7]
[cbl-02:08311] [24] python3[0x4f7a28]
[cbl-02:08311] [25] python3[0x4f876d]
[cbl-02:08311] [26] python3(_PyEval_EvalFrameDefault+0x467)[0x4f98c7]
[cbl-02:08311] [27] python3(_PyFunction_FastCallDict+0xf5)[0x4f4065]
[cbl-02:08311] [28] python3(_PyObject_FastCallDict+0x4f1)[0x57c8f1]
[cbl-02:08311] [29] python3(_PyObject_CallMethodIdObjArgs+0xee)[0x57cc5e]
[cbl-02:08311] *** End of error message ***
Segmentation fault (core dumped)
Any advice would be greatly appreciated. An example of the Box.msh is also given. Also, is there an example that describes how to read in meshes from gmsh? Thanks
Box.msh:
$MeshFormat
4.1 0 8
$EndMeshFormat
$Entities
4 4 1 0
1 1 0 0 1 1
2 1 1 0 1 1
3 0 1 0 1 1
4 0 0 0 1 1
1 0 0 0 0 1 0 1 2 2 3 -4
2 0 0 0 1 0 0 1 2 2 4 -1
3 1 0 0 1 1 0 1 2 2 1 -2
4 0 1 0 1 1 0 1 2 2 2 -3
1 0 0 0 1 1 0 1 3 4 1 2 3 4
$EndEntities
$Nodes
9 13 1 13
0 1 0 1
1
1 0 0
0 2 0 1
2
1 1 0
0 3 0 1
3
0 1 0
0 4 0 1
4
0 0 0
1 1 0 1
5
0 0.5000000000020591 0
1 2 0 1
6
0.499999999998694 0 0
1 3 0 1
7
1 0.499999999998694 0
1 4 0 1
8
0.5000000000020591 1 0
2 1 0 5
9
10
11
12
13
0.5000000000001412 0.5000000000001882 0
0.2500000000010295 0.7500000000010295 0
0.7500000000005501 0.7499999999997204 0
0.7499999999997088 0.2499999999997206 0
0.2499999999997088 0.2500000000005618 0
$EndNodes
$Elements
9 28 1 28
0 1 15 1
1 1
0 2 15 1
2 2
0 3 15 1
3 3
0 4 15 1
4 4
1 1 1 2
5 3 5
6 5 4
1 2 1 2
7 4 6
8 6 1
1 3 1 2
9 1 7
10 7 2
1 4 1 2
11 2 8
12 8 3
2 1 2 16
13 8 3 10
14 5 4 13
15 7 2 11
16 6 1 12
17 5 9 10
18 9 8 10
19 8 9 11
20 9 5 13
21 9 7 11
22 6 9 13
23 9 6 12
24 7 9 12
25 4 6 13
26 1 7 12
27 3 5 10
28 2 8 11
$EndElements