On Mon, Aug 26, 2019 at 5:37 PM Sander Rhebergen <srhebergen@uwaterloo.ca> wrote:

Hello,


Is it possible to set a constant nullspace for a NonlinearVariationalSolver?

I tried the following:


order = 2
V3 = FunctionSpace(mesh, "CG", order)
V1 = FunctionSpace(mesh, "BDM", order)
V2 = FunctionSpace(mesh, "DG", order-1)
W  = MixedFunctionSpace([V3, V1, V2])
v_basis = VectorSpaceBasis(constant=True)
null_space = MixedVectorSpaceBasis(W, [W.sub(0), W.sub(1), v_basis])


# Build Nonlinear Solver
uprob = NonlinearVariationalProblem(L, w1)
usolver = NonlinearVariationalSolver(uprob, nullspace=null_space, solver_parameters = {
    'snes_max_it': '50',
    'snes_rtol': '1e-12',
    'mat_type': 'aij',
    'ksp_type': 'preonly',
    'pc_type': 'lu',
    'snes_monitor': True,
    'snes_view': False,
    'snes_converged_reason': True,
    'ksp_converged_reason': True})

but the linear solver did not converge:


  0 SNES Function norm 7.964422825545e-02
  Linear firedrake_1_ solve did not converge due to DIVERGED_PCSETUP_FAILED iterations 0
                 PCSETUP_FAILED due to FACTOR_NUMERIC_ZEROPIVOT
Nonlinear firedrake_1_ solve did not converge due to DIVERGED_LINEAR_SOLVE iterations 0

HI Sander,

Even if you set a nullspace here, you will get the same error because the null space is not projected out, we just know
about it, thus LU will still fail. Getting the projected matrix would be prohibitively expensive (I assume). Just to make sure,
the nullspace is constant pressure, right? I suggest either

  a) Using a Schur complement scheme, sticking the pressure mass matrix as the PC matrix, and then using LU

or

  b) Using monolithic multigrid since you can use SVD on the coarse grid with no problem

Or am I misunderstanding something. I have never used the VVP formulation.

 Thanks,

    Matt
 
I can send the full code if necessary. I'm trying to solve Navier-Stokes in velocity-vorticity-pressure formulation (https://arxiv.org/pdf/1604.00257.pdf) but the solver doesn't converge. If I add a small parameter times a pressure mass-matrix, the solver converges, but I was hoping to avoid doing this.


Thanks,

Sander



_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake


--
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
-- Norbert Wiener