dolfinx icon indicating copy to clipboard operation
dolfinx copied to clipboard

demo_stokes.py direct solver fails with nan

Open drew-parsons opened this issue 3 years ago • 1 comments

The direct solver ("blocked") in the python demo demo_stokes.py for dolfinx 0.4.1 is returning nan on Debian Linux systems. Full test log can be found at https://ci.debian.net/data/autopkgtest/unstable/amd64/f/fenics-dolfinx/22703381/log.gz, the end of the log reports

  KSP Object: (fieldsplit_p_) 1 MPI processes
    type: preonly
    maximum iterations=10000, initial guess is zero
    tolerances:  relative=1e-05, absolute=1e-50, divergence=10000.
    left preconditioning
    using NONE norm type for convergence test
  PC Object: (fieldsplit_p_) 1 MPI processes
    type: jacobi
      type DIAGONAL
    linear system matrix = precond matrix:
    Mat Object: (fieldsplit_p_) 1 MPI processes
      type: seqaij
      rows=1089, cols=1089
      total: nonzeros=7361, allocated nonzeros=7361
      total number of mallocs used during MatSetValues calls=0
        not using I-node routines
  linear system matrix followed by preconditioner matrix:
  Mat Object: 1 MPI processes
    type: seqaij
    rows=9539, cols=9539
    total: nonzeros=269576, allocated nonzeros=269576
    total number of mallocs used during MatSetValues calls=0
      has attached null space
      using I-node routines: found 5312 nodes, limit used is 5
  Mat Object: 1 MPI processes
    type: seqaij
    rows=9539, cols=9539
    total: nonzeros=197829, allocated nonzeros=197829
    total number of mallocs used during MatSetValues calls=0
      using I-node routines: found 5312 nodes, limit used is 5
(A) Norm of velocity coefficient vector (nested, iterative): 17.478370152447766
(A) Norm of pressure coefficient vector (nested, iterative): 311.44253800229257
(B) Norm of velocity coefficient vector (blocked, iterative): 17.478370158383505
(B) Norm of pressure coefficient vector (blocked, interative): 311.44253801601417
(C) Norm of velocity coefficient vector (blocked, direct): nan
(C) Norm of pressure coefficient vector (blocked, direct): nan
----------------------------- Captured stderr call -----------------------------
Traceback (most recent call last):
  File "/tmp/autopkgtest-lxc.lhvvm1tb/downtmp/build.KH9/src/python/demo/demo_stokes.py", line 406, in <module>
    assert np.isclose(norm_u_2, norm_u_0)
AssertionError

Do we know what would cause the Stokes direct solver to return nan like this?

drew-parsons avatar Jun 14 '22 14:06 drew-parsons

We probably don't pin the pressure for case (C). @jpdean?

garth-wells avatar Jun 14 '22 14:06 garth-wells

This is likely fixed by #2512, which adds proper handling of the pressure nullspace when using a direct solver.

garth-wells avatar Jan 28 '23 08:01 garth-wells