I’m experimenting a little with ngsolve combined with ngsPETSc. Attached I have a code to solve an IP-HDG discretization of Poisson’s equation and I’d like to solve this using PETSc solvers/preconditioners. Since I have an HDG discretization, I’d like to solve the statically condensed system.
When running with ngsolve’s CGSolver and bddc preconditioner, the solver converges in 26 iterations. Furthermore, the solver seems mesh robust. Using PETSc’s CG solver with bddc preconditioner, I get a KSP Residual norm of 0 already in the first step. I’m assuming I’m using PETSc’s bddc incorrectly. Does anyone have any comments on how to correctly call bddc here?
A second question I have is, instead of bddc I’d also like to use an algebraic multigrid method. Using hypre, so changing
solver = KrylovSolver(a, X.FreeDofs(True), solverParameters={"ksp_type": "cg", "ksp_monitor": "", "pc_type": "bddc", "ngs_mat_type": "is"})
to
solver = KrylovSolver(a, X.FreeDofs(True), solverParameters={"ksp_type": "cg", "ksp_monitor": "", "pc_type": "hypre"})
it seems like hypre is not robust with respect to mesh size. I know of Guosheng Fu’s ASP for HDG, and that works in our codes, but I was hoping I could directly use a PETSc AMG out of the box. I found the following paper by Lee and Vassilevski https://www.osti.gov/servlets/purl/1237557 and was wondering if what they describe on page 5 is the reason for hypre not being robust in ngsolve (“One of the factors affecting the success of BoomerAMG is that the constant coefficient vector 1 should be in the near-null space of S (as a matrix).”). They present a fix there. Would anyone have a suggestion on how to implement that in ngsolve?