I am not sure if I install it correctly, but I install using the command pip install git+https://github.com/dolfin-adjoint/pyadjoint.git
and I got the same error (I have FEniCS install on Anaconda)
File "<ipython-input-1-2a406f0a4900>", line 1, in <module>
runfile('/home/phuris/Test_memory_issue/testmemoryissue.py', wdir='/home/phuris/Test_memory_issue')
File "/home/phuris/anaconda3/envs/fenicsproject/lib/python3.8/site-packages/spyder_kernels/customize/spydercustomize.py", line 827, in runfile
execfile(filename, namespace)
File "/home/phuris/anaconda3/envs/fenicsproject/lib/python3.8/site-packages/spyder_kernels/customize/spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "/home/phuris/Test_memory_issue/testmemoryissue.py", line 173, in <module>
dJdsT = JhatT.derivative()
File "/home/phuris/anaconda3/envs/fenicsproject/lib/python3.8/site-packages/pyadjoint/reduced_functional.py", line 61, in derivative
derivatives = compute_gradient(self.functional,
File "/home/phuris/anaconda3/envs/fenicsproject/lib/python3.8/site-packages/pyadjoint/drivers.py", line 29, in compute_gradient
tape.evaluate_adj(markings=True)
File "/home/phuris/anaconda3/envs/fenicsproject/lib/python3.8/site-packages/pyadjoint/tape.py", line 140, in evaluate_adj
self._blocks[i].evaluate_adj(markings=markings)
File "/home/phuris/anaconda3/envs/fenicsproject/lib/python3.8/site-packages/pyadjoint/tape.py", line 46, in wrapper
return function(*args, **kwargs)
File "/home/phuris/anaconda3/envs/fenicsproject/lib/python3.8/site-packages/pyadjoint/block.py", line 126, in evaluate_adj
prepared = self.prepare_evaluate_adj(inputs, adj_inputs, relevant_dependencies)
File "/home/phuris/anaconda3/envs/fenicsproject/lib/python3.8/site-packages/fenics_adjoint/solving.py", line 182, in prepare_evaluate_adj
adj_sol, adj_sol_bdy = self._assemble_and_solve_adj_eq(dFdu_form, dJdu)
File "/home/phuris/anaconda3/envs/fenicsproject/lib/python3.8/site-packages/fenics_adjoint/lu_solver.py", line 108, in _assemble_and_solve_adj_eq
solver.solve(adj_sol.vector(), dJdu)
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 solve linear system using PETSc Krylov solver.
*** Reason: Solution failed to converge in 0 iterations (PETSc reason DIVERGED_PC_FAILED, residual norm ||r|| = 0.000000e+00).
*** Where: This error was encountered inside PETScKrylovSolver.cpp.
*** Process: 0
***
*** DOLFIN version: 2019.1.0
*** Git changeset: 15b823f2c45d3036b6af931284d0f8e3c77b6845
*** -------------------------------------------------------------------------