Hi all, I am receiving SIGSEGV running code from linked anwer. I am attaching an example code and stack trace.
import dolfinx
import dolfinx.io
mesh = dolfinx.UnitSquareMesh(dolfinx.MPI.comm_world, 9, 9)
V = dolfinx.FunctionSpace(mesh, ("DG", 0))
v = dolfinx.Function(V)
x = V.tabulate_dof_coordinates()
for i in range(x.shape[0]):
midpoint = x[i,:]
if midpoint[0]> 0.5 and midpoint[1]>0.25:
v.vector.setValueLocal(i, 2)
else:
v.vector.setValueLocal(i, 1)
dolfinx.io.XDMFFile(dolfinx.MPI.comm_world, "DG.xdmf").write(v)
Loguru caught a signal: SIGSEGV
Stack trace:
22 0x5f6ede _start + 46
21 0x7fa349ca20b3 __libc_start_main + 243
20 0x6afa59 Py_BytesMain + 41
19 0x6af6ce Py_RunMain + 526
18 0x67845a PyRun_SimpleFileExFlags + 378
17 0x6780d7 PyRun_FileExFlags + 151
16 0x67801f python3() [0x67801f]
15 0x677fa1 python3() [0x677fa1]
14 0x687033 PyEval_EvalCode + 35
13 0x565332 _PyEval_EvalCodeWithName + 610
12 0x567228 _PyEval_EvalFrameDefault + 2248
11 0x5f2b85 _PyFunction_Vectorcall + 933
10 0x565332 _PyEval_EvalCodeWithName + 610
9 0x56bed7 _PyEval_EvalFrameDefault + 21879
8 0x508312 python3() [0x508312]
7 0x5f31fe _PyObject_MakeTpCall + 654
6 0x5f25e5 PyCFunction_Call + 85
5 0x7fa3497e116e /usr/local/lib/python3.8/dist-packages/dolfinx/cpp.cpython-38-x86_64-linux-gnu.so(+0xd616e) [0x7fa3497e116e]
4 0x7fa349787770 /usr/local/lib/python3.8/dist-packages/dolfinx/cpp.cpython-38-x86_64-linux-gnu.so(+0x7c770) [0x7fa349787770]
3 0x7fa34953358d dolfinx::io::XDMFFile::write(dolfinx::function::Function const&, double) + 109
2 0x7fa349543104 dolfinx::io::xdmf_function::write(dolfinx::function::Function const&, double, int, pugi::xml_document&, long) + 3188
1 0x7fa34954bd2c dolfinx::io::xdmf_utils::get_cell_data_values(dolfinx::function::Function const&) + 556
0 0x7fa349cc1210 /lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7fa349cc1210]
2020-03-30 19:10:24.656 ( 1.707s) [main thread ] :0 FATL| Signal: SIGSEGV
Segmentation fault (core dumped)
I am running latest dolfinx:complex docker build.