Setting parameters in the Customed Newton Solver

Here, we can find an example of a customized newton solver that is recommended by Nate. The newton solver works quite well after running the example. However, in general, I am not sure how to set the parameters in this customized newton solver as we usually did in the NonlinearVariationalSolver like the following:

I find that to change the precondtioner to hypre_amg, we do can the following:
image
However, changing to ilu as precondtioner is slightly different (commented out). There has to be a general rule that I can follow but I cannot find the right documentation for this, hence not sure how to properly set all these parameters.

Any ideas are appreciated. Thank you!

Just an update here. I found one solution.
Here is a link to several PETScoptions that we can set in the linear solver of Newton solver, i.e. the KSP solver.
image
To set the parameters of the Newton iteration, we can do it outside Newton Solver class, like the following:


Please let me know if there are any other better ways or better Customized Newton solvers that I can use. I guess the advantage of this Customized Newton Solver over the usual NonLinearVariationalSolver is that we can set_operator for the linear solver inside the Newton Solver. The parameters setting are almost the same as in the NonLinearVariationalSolver.