Skip to content

Commit ee9f257

Browse files
committed
use Jacobi to speed up test
1 parent 8e8d14c commit ee9f257

1 file changed

Lines changed: 7 additions & 20 deletions

File tree

demos/adaptive_multigrid/adaptive_multigrid.py.rst

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Our approach strongly follows the similar problem in this `lecture course <https
6464
return uh
6565

6666
Note the code after the construction of the :class:`.NonlinearVariationalProblem`. To use the :class:`.AdaptiveMeshHierarchy` with the existing Firedrake solver, we have to set the :class:`.AdaptiveTransferManager` as the transfer manager of the multigrid solver.
67-
For the parameters of the multigrid solver, we will be using patch relaxation, which we define with ::
67+
Since we are using linear CG elements, we will employ Jacobi as the multigrid relaxation, which we define with ::
6868

6969
solver_params = {
7070
"mat_type": "matfree",
@@ -73,30 +73,17 @@ For the parameters of the multigrid solver, we will be using patch relaxation, w
7373
"mg_levels": {
7474
"ksp_type": "chebyshev",
7575
"ksp_max_it": 1,
76-
"pc_type": "python",
77-
"pc_python_type": "firedrake.PatchPC",
78-
"patch": {
79-
"pc_patch": {
80-
"construct_type": "star",
81-
"construct_dim": 0,
82-
"sub_mat_type": "seqdense",
83-
"dense_inverse": True,
84-
"save_operators": True,
85-
"precompute_element_tensors": True,
86-
},
87-
"sub_ksp_type": "preonly",
88-
"sub_pc_type": "lu",
89-
},
76+
"pc_type": "jacobi",
9077
},
9178
"mg_coarse": {
92-
"ksp_type": "preonly",
93-
"pc_type": "python",
94-
"pc_python_type": "firedrake.AssembledPC",
95-
"assembled": {"ksp_type": "preonly", "pc_type": "lu"},
79+
"mat_type": "aij",
80+
"pc_type": "lu",
9681
},
9782
}
9883

99-
For more information about patch relaxation,
84+
Alternatively for high-order CG elements, it is recommended to use patch relaxation
85+
to achieve degree-independent multigrid convergence.
86+
For more information
10087
see :doc:`Using patch relaxation for multigrid <poisson_mg_patches.py>`.
10188
The initial solution is shown below.
10289

0 commit comments

Comments
 (0)