Hi, I am trying to generate a gradient for the electric potential generated from a mesh. The electric potentials are stored in phi_values. I am trying to find the gradient using
E_space = VectorFunctionSpace(self.geometry.mesh, ‘DG’, 1)
E_field = project(-grad(phi_values), E_space)
return E_field
but I get the following error
line 138, in project
cpp.la.solve(A, function.vector(), b, solver_type, preconditioner_type)
RuntimeError:
*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
*** fenics-support@googlegroups.com
*** Remember to include the error message listed below and, if possible,
*** include a minimal running example to reproduce the error.
*** -------------------------------------------------------------------------
*** Error: Unable to successfully call PETSc function ‘KSPSolve’.
*** Reason: PETSc error code is: 76 (Error in external library).
*** Where: This error was encountered inside /home/conda/feedstock_root/build_artifacts/fenics_1555852928859/work/dolfin/la/PETScKrylovSolver.cpp.
*** Process: 0
*** DOLFIN version: 2018.1.0
*** Git changeset: 9e1777c0df7c762c7230189c87c13fd5ad33a4f0
*** -------------------------------------------------------------------------
how can I solve this ?