Trying to create a JIT-compiled expression that uses some VTK object. However, even with such a simple code as:
I0 = dolfin.Expression('''
#include <vtkSmartPointer.h>
#include <vtkPoints.h>
namespace dolfin
{
class MyFun : public Expression
{
public:
MyFun(): Expression()
{
points->InsertNextPoint(0.,0.,0.);
};
private:
vtkSmartPointer<vtkPoints> points;
};
}''')
I'm getting some PETSC runtime error:
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
If you comment the InsertNextPoint
line then it runs fine, though nothing gets done of course. Any idea what might be going on? Thanks!