I am trying to interpolate a function defined on one mesh onto another mesh in dolfinx 0.7.3. When doing so, I get the following 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 https://petsc.org/release/faq/#valgrind and https://petsc.org/release/faq/
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
[0]PETSC ERROR: Run with -malloc_debug to check if memory corruption is causing the crash.
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
with errorcode 59.
NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
I have installed dolfinx (with complex numbers) using conda: conda create -n testenv -c conda-forge fenics-dolfinx petsc=*=complex*
Here is a minimal example reproducing the error:
import dolfinx
from mpi4py import MPI
mesh = dolfinx.mesh.create_rectangle(MPI.COMM_WORLD,[[-10,-10],[10,10]],[20,20])
V = dolfinx.fem.functionspace(mesh,('CG',1,))
F=dolfinx.fem.Function(V)
F.interpolate(lambda x: x[0],)
new_mesh = dolfinx.mesh.create_rectangle(MPI.COMM_WORLD,[[-10,-10],[10,10]],[10,10])
Vnew = dolfinx.fem.functionspace(new_mesh,('CG',1,))
Fnew=dolfinx.fem.Function(Vnew)
Fnew.interpolate(F) # SEGV happens here.