On 28 Jan 2021, at 17:54, Matthew Knepley <knepley@gmail.com> wrote:
On Thu, Jan 28, 2021 at 12:04 PM Artur Palha <artur.palha@gmail.com> wrote: Hello Everyone,
I am trying to solve a (linear) system of equations I am constructing as a result of a specific discretisation of a PDE. As I try to solve with a direct solver (MUMPS) I notice that in some circumstances (mesh size and polynomial degree) I get a solve error:
ConvergenceError: Nonlinear solve failed to converge after 0 nonlinear iterations. Reason: DIVERGED_LINEAR_SOLVE
After much digging around I managed to (I think) reproduce the error on the mixed Poisson example. For that I simply changed the solver parameters. I add below the full code with the two options of solver parameters (if broken_parameters is set to True then I get the error, if set to False it works fine). The difference is that the broken one uses a direct solver (MUMPS) and the working one uses an iterative solver (gmres). Note that I changed the domain into a periodic domain and I solve for a purely Neumann problem, hence I add the nullspace in the solve step.
The nullspace you set is only used in the iterative solver, since it projects out the nullspace from the approximation. MUMPS tries to factorize your rank-deficient matrix and fails.
There are some magic `mat_mumps_icntl` flags you can set to ask mumps to try and find the nullspace. Run with `-help` on the commandline to see what they are. Lawrence