Preconditioner: Multigrid

LFAToolkit.MultigridType
Multigrid(fineoperator, coarseoperator, smoother, prolongation, multigridtype)

Multigrid preconditioner for finite element operators

Arguments:

  • fineoperator::Operator: finite element operator to precondition
  • coarseoperator::Union{Operator,Multigrid}: coarse grid representation of finite element operator to precondition
  • smoother::AbstractPreconditioner: error relaxation operator, such as Jacobi
  • prolongationbases::AbstractArray{<:AbstractBasis}: element prolongation bases from coarse to fine grid
  • multigridtype::MultigridType: multigrid type, h-multigrid or p-multigrid

Returns:

  • multigrid preconditioner object
source
LFAToolkit.getnodecoordinatedifferencesMethod
getnodecoordinateddifferences(multigrid)

Compute or retrieve the array of differences in coordinates between nodes

Returns:

  • array of differences in coordinates between nodes
source
LFAToolkit.getprolongationmatrixFunction
getprolongationmatrix(multigrid)

Compute or retrieve the prolongation matrix

Returns:

  • matrix prolonging from coarse grid to fine grid

Example:

# setup
mesh = Mesh2D(1.0, 1.0);
ctofbasis = TensorH1LagrangeBasis(2, 3, 1, 2; collocatedquadrature = true);

# operators
finediffusion = GalleryOperator("diffusion", 3, 3, mesh);
coarsediffusion = GalleryOperator("diffusion", 2, 3, mesh);

# smoother
jacobi = Jacobi(finediffusion);

# preconditioner
multigrid = PMultigrid(finediffusion, coarsediffusion, jacobi, [ctofbasis]);

# verify
u = ones(ctofbasis.numbernodes);
v = multigrid.prolongationmatrix * u;
@assert v' ≈ [4.0 2.0 4.0 2.0 1.0 2.0 4.0 2.0 4.0] .^ -1

# output
source
LFAToolkit.computesymbolsprolongationMethod
computesymbolsprolongation(multigrid, θ)

Compute the symbol matrix for a multigrid prolongation operator

Arguments:

  • multigrid: Multigrid operator to compute prolongation symbol matrix for
  • θ: Fourier mode frequency array (one frequency per dimension)

Returns:

  • symbol matrix for the multigrid prolongation operator
source