Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chapter4/solvers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
"\n",
"For large problems, we instead need to use an iterative method which are faster and require less memory.\n",
"## Choosing a linear solver and preconditioner\n",
"As the Poisson equation results in a symmetric, positive definite system matrix, the optimal Krylov solver is the conjugate gradient (Lagrange) method. The default preconditioner is the incomplete LU factorization (ILU), which is a popular and robous overall preconditioner. We can change the preconditioner by setting `\"pc_type\"` to some of the other preconditioners in petsc, which you can find in the [PETSc documentation](https://www.mcs.anl.gov/petsc/documentation/linearsolvertable.html).\n",
"As the Poisson equation results in a symmetric, positive definite system matrix, the optimal Krylov solver is the conjugate gradient (Lagrange) method. The default preconditioner is the incomplete LU factorization (ILU), which is a popular and robous overall preconditioner. We can change the preconditioner by setting `\"pc_type\"` to some of the other preconditioners in petsc, which you can find in at [PETSc KSP solvers](https://petsc.org/release/manual/ksp/#tab-kspdefaults) and [PETSc preconditioners](https://petsc.org/release/manual/ksp/#tab-pcdefaults).\n",
"You can set any opition in `PETSc` through the `petsc_options` input, such as the absolute tolerance (`\"ksp_atol\"`), relative tolerance (`\"ksp_rtol\"`) and maximum number of iterations (`\"ksp_max_it\"`)."
]
},
Expand Down
4 changes: 2 additions & 2 deletions chapter4/solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.14.7
# jupytext_version: 1.15.2
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
Expand Down Expand Up @@ -89,7 +89,7 @@ def u_ex(mod):
#
# For large problems, we instead need to use an iterative method which are faster and require less memory.
# ## Choosing a linear solver and preconditioner
# As the Poisson equation results in a symmetric, positive definite system matrix, the optimal Krylov solver is the conjugate gradient (Lagrange) method. The default preconditioner is the incomplete LU factorization (ILU), which is a popular and robous overall preconditioner. We can change the preconditioner by setting `"pc_type"` to some of the other preconditioners in petsc, which you can find in the [PETSc documentation](https://www.mcs.anl.gov/petsc/documentation/linearsolvertable.html).
# As the Poisson equation results in a symmetric, positive definite system matrix, the optimal Krylov solver is the conjugate gradient (Lagrange) method. The default preconditioner is the incomplete LU factorization (ILU), which is a popular and robous overall preconditioner. We can change the preconditioner by setting `"pc_type"` to some of the other preconditioners in petsc, which you can find in at [PETSc KSP solvers](https://petsc.org/release/manual/ksp/#tab-kspdefaults) and [PETSc preconditioners](https://petsc.org/release/manual/ksp/#tab-pcdefaults).
# You can set any opition in `PETSc` through the `petsc_options` input, such as the absolute tolerance (`"ksp_atol"`), relative tolerance (`"ksp_rtol"`) and maximum number of iterations (`"ksp_max_it"`).

cg_problem = LinearProblem(a, L, bcs=bcs,
Expand Down