I am working with FEniCS legacy (2019.1.0) in C++. I am solving a nonlinear problem with a Newton solver coupled with GMRES for the linear iterations between Newton steps. I would like to have more control over the linear solver and access to PETSc parameters. Specifically, I want to modify the GMRES restart.
This post answers my question for Python, but I have been struggling to implement it in C++ fenicsproject.discourse.group/t/set-krylov-linear-solver-paramters-in-newton-solver/1070/3
Here are some linesof 2019.1.0 c++ code I have laying around for setting PETSc options while using a Newton solver. Is this helping you in the right direction?