Skip to content
Projects

Multigrid

The equations of patchwork.solvers.multigrid, declared on the code that implements them and checked by the tests.

CompositeMultigrid

classsource

A geometric multigrid V-cycle over the levels of a hierarchy, preconditioning CG.

spaces
V0⊂⋯⊂VL: the composite nodes of the hierarchy without its finest levels, then of its base level coarsened by 2kV_0 \subset \dots \subset V_L: \ \text{the composite nodes of the hierarchy without its finest levels, then of its base level coarsened by } 2^k
interpolation
Pk=Ek(xfree(k+1)) Tk∣free,Ak=Pk⊤Ak+1Pk (Galerkin)P_k = E_{k}\big(\mathbf{x}^{(k+1)}_\mathrm{free}\big)\, T_k \Big|_{\mathrm{free}}, \qquad A_{k} = P_k^\top A_{k+1} P_k \ (\text{Galerkin})
cycle
V-cycle: Chebyshev/Jacobi smoothing on [0.1,1.1] λmax⁡(D−1A) (or Gauss–Seidel), LU on V0; CG (GMRES if A≠A⊤), ∥r∥≤rtol ∥b∥\text{V-cycle: Chebyshev/Jacobi smoothing on } [0.1, 1.1]\,\lambda_{\max}(D^{-1}A) \text{ (or Gauss--Seidel), LU on } V_0; \ \text{CG (GMRES if } A \ne A^\top\text{)}, \ \|r\| \le \texttt{rtol}\,\|b\|
diagonal
A1=P0⊤(A+diag⁡d)P0=A1ref+Wd,W(a,b),i=(P0)ia(P0)ibA_1 = P_0^\top (A + \operatorname{diag} d) P_0 = A_1^{\mathrm{ref}} + W d, \qquad W_{(a,b), i} = (P_0)_{ia} (P_0)_{ib}
singular
b→b−bˉ,∑pVp(Tϕ)p=0(no Dirichlet face, no body; all nodes, the hanging ones too)b \to b - \bar b, \qquad \sum_p V_p (T\phi)_p = 0 \quad \text{(no Dirichlet face, no body; all nodes, the hanging ones too)}
Assumes
  • the coarse spaces are nested in the fine one: a refinement level is a multigrid level
  • the base level halves while every bound of its boxes is even and every axis keeps two cells; else its LU is the coarsest solve
  • the whole system on every rank (like 'lu')
  • a base level with an odd number of cells along an axis coarsens on its node lattice (linear interpolation)
  • smoother='gauss-seidel': multicolour symmetric Gauss--Seidel, the V-cycle compiled (OpenMP over each colour) when the coarsest level is small
  • point (Jacobi) smoothing: a strongly anisotropic coefficient (magnetized susceptibility) slows it down
References
Built from