Skip to content

Commit 50b0aad

Browse files
committed
Update python file as well
1 parent 6a67d30 commit 50b0aad

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

chapter2/nonlinpoisson_code.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,12 @@ def u_exact(x): return eval(str(u_ufl))
8383
ksp = solver.krylov_solver
8484
opts = PETSc.Options()
8585
option_prefix = ksp.getOptionsPrefix()
86-
opts[f"{option_prefix}ksp_type"] = "cg"
87-
opts[f"{option_prefix}pc_type"] = "gamg"
88-
opts[f"{option_prefix}pc_factor_mat_solver_type"] = "mumps"
86+
opts[f"{option_prefix}ksp_type"] = "gmres"
87+
opts[f"{option_prefix}ksp_rtol"] = 1.0e-8
88+
opts[f"{option_prefix}pc_type"] = "hypre"
89+
opts[f"{option_prefix}pc_hypre_type"] = "boomeramg"
90+
opts[f"{option_prefix}pc_hypre_boomeramg_max_iter"] = 1
91+
opts[f"{option_prefix}pc_hypre_boomeramg_cycle_type"] = "v"
8992
ksp.setFromOptions()
9093

9194
# We are now ready to solve the non-linear problem. We assert that the solver has converged and print the number of iterations.

0 commit comments

Comments
 (0)