meshadaptation/pragmatic

python interface to dolfin broken

Closed this issue · 3 comments

I get this when trying python/minimal_example.py:
vagrant@vagrant-ubuntu-trusty-64:~/pragmatic/python$ python minimal_example.py 
Traceback (most recent call last):
  File "minimal_example.py", line 90, in <module>
    minimal_example()
  File "minimal_example.py", line 55, in minimal_example
    mesh = adapt(H)
  File "/home/vagrant/pragmatic/python/adaptivity.py", line 388, in adapt
    _libpragmatic.pragmatic_set_surface(ctypes.byref(nfacets),
  File "/usr/lib/python2.7/ctypes/__init__.py", line 378, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 383, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /home/vagrant/pragmatic/libpragmatic.so: undefined symbol: pragmatic_set_surface

This function got dropped accidentally when I rewrote the way the boundary has handled. It is straightforward to write but not a cheap operation. We may need to take a look again at how Dolfin deals with its boundaries to see if something more efficient can be implemented.

Working on this in branch set_surface. I think the patch on this branch is good but my install of dolfin is foobar so I cannot test it. Let me know if you get a chance to test it. In the mean time I'll fix my dolfin install.

which version of dolfin are you targeting?

I get this with 1.4.

vagrant@vagrant-ubuntu-trusty-64:~/pragmatic/python$ python minimal_example.py 
total (adapt+metric) time was 0.5s, L2error=3e-03, nodes: 739
total (adapt+metric) time was 0.2s, L2error=1e-04, nodes: 219
total (adapt+metric) time was 0.1s, L2error=5e-05, nodes: 192
total (adapt+metric) time was 0.1s, L2error=3e-05, nodes: 211
python: /home/vagrant/pragmatic/include/Swapping2D.h:362: void Swapping2D<_real_t>::swap_kernel(Edge<int>&, std::set<int>&, std::vector<int>*, std::vector<int>*, size_t) [with real_t = double; size_t = long unsigned int]: Assertion `n[(n_off+2)%3]==m[(m_off+1)%3] && n[(n_off+1)%3]==m[(m_off+2)%3]' failed.
[vagrant-ubuntu-trusty-64:11468] *** Process received signal ***
[vagrant-ubuntu-trusty-64:11468] Signal: Aborted (6)
[vagrant-ubuntu-trusty-64:11468] Signal code:  (-6)
[vagrant-ubuntu-trusty-64:11468] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7f3a63609340]
[vagrant-ubuntu-trusty-64:11468] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39) [0x7f3a63269bb9]
[vagrant-ubuntu-trusty-64:11468] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7f3a6326cfc8]
[vagrant-ubuntu-trusty-64:11468] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x2fa76) [0x7f3a63262a76]
[vagrant-ubuntu-trusty-64:11468] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x2fb22) [0x7f3a63262b22]
[vagrant-ubuntu-trusty-64:11468] [ 5] /home/vagrant/pragmatic/libpragmatic.so(_ZN10Swapping2DIdE11swap_kernelER4EdgeIiERSt3setIiSt4lessIiESaIiEEPSt6vectorIiS7_ESC_m+0x60c) [0x7f3a38c2877a]
[vagrant-ubuntu-trusty-64:11468] [ 6] /home/vagrant/pragmatic/libpragmatic.so(+0x18c85f) [0x7f3a38bf785f]
[vagrant-ubuntu-trusty-64:11468] [ 7] /home/vagrant/pragmatic/libpragmatic.so(_ZN10Swapping2DIdE4swapEd+0x1fe) [0x7f3a38c0f980]
[vagrant-ubuntu-trusty-64:11468] [ 8] /home/vagrant/pragmatic/libpragmatic.so(pragmatic_adapt+0x1b3) [0x7f3a38bef756]
[vagrant-ubuntu-trusty-64:11468] [ 9] /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call_unix64+0x4c) [0x7f3a5f210adc]
[vagrant-ubuntu-trusty-64:11468] [10] /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call+0x1fc) [0x7f3a5f21040c]
[vagrant-ubuntu-trusty-64:11468] [11] /usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so(_ctypes_callproc+0x48e) [0x7f3a5f4275fe]
[vagrant-ubuntu-trusty-64:11468] [12] /usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so(+0x15f9e) [0x7f3a5f428f9e]
[vagrant-ubuntu-trusty-64:11468] [13] python(PyEval_EvalFrameEx+0x970) [0x52cc20]
[vagrant-ubuntu-trusty-64:11468] [14] python(PyEval_EvalCodeEx+0x2a4) [0x55c594]
[vagrant-ubuntu-trusty-64:11468] [15] python(PyEval_EvalFrameEx+0x7dd) [0x52ca8d]
[vagrant-ubuntu-trusty-64:11468] [16] python(PyEval_EvalCodeEx+0x2a4) [0x55c594]
[vagrant-ubuntu-trusty-64:11468] [17] python(PyEval_EvalFrameEx+0x7dd) [0x52ca8d]
[vagrant-ubuntu-trusty-64:11468] [18] python(PyEval_EvalCodeEx+0x2a4) [0x55c594]
[vagrant-ubuntu-trusty-64:11468] [19] python(PyEval_EvalCode+0x32) [0x5b7392]
[vagrant-ubuntu-trusty-64:11468] [20] python() [0x469663]
[vagrant-ubuntu-trusty-64:11468] [21] python(PyRun_FileExFlags+0x92) [0x4699e3]
[vagrant-ubuntu-trusty-64:11468] [22] python(PyRun_SimpleFileExFlags+0x2ee) [0x469f1c]
[vagrant-ubuntu-trusty-64:11468] [23] python(Py_Main+0xb5e) [0x46ab81]
[vagrant-ubuntu-trusty-64:11468] [24] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f3a63254ec5]
[vagrant-ubuntu-trusty-64:11468] [25] python() [0x57497e]
[vagrant-ubuntu-trusty-64:11468] *** End of error message ***
Aborted (core dumped)