Hi.
I want to use petsc MG
or GAMG
preconditioner in conjunction with matrix free approach given here.
So in line 346, I want
solver.getPC().setType(PETSc.PC.Type.GAMG)
instead of
solver.getPC().setType(PETSc.PC.Type.NONE)
Is it possible to use petsc preconditioners directly or do I need to define my own preconditioner? I am presuming something like PCSHELL
Hi,
you will need to build a matrix-free preconditioner within PCSHELL, PETSc built-in preconditioners need access to the matrix entries. Algebraic MG, in particular, needs the assembled matrix, but you can construct your own geometric MG matrix-free. You can also build simpler matrix-free preconditioners (e.g. SOR) or physics-based ones using PCSHELL, depending on the problem you are trying to solve.
1 Like