[petsc-users] Problem with SNES

Milan Mitrovic milan.v.mitrovic at gmail.com
Mon Aug 29 10:43:54 CDT 2011


> Or your system is somewhat ill-conditioned. If you add '-mat_fd_type ds' to
> the last command line, are the errors similar or improve a bit?

Norm of matrix ratio 3.24879e-07 difference 3.24879e-05

So I guess it is the same...

> A different way to test for a correct Jacobian is to run with
> -snes_mf_operator -pc_type lu
> and check that it converges in 1 or occasionally 2 iterations. This also
> helps if the Jacobian is incorrect, but not visibly so on the first
> iteration (e.g. because nonlinearities are silent for the initial guess).
>

SNES Function norm 2.369969231195e-02
Linear solve converged due to CONVERGED_RTOL iterations 0
SNES Object:
  type: ls
    line search variant: SNESLineSearchCubic
    alpha=0.0001, maxstep=1e+08, minlambda=1e-12
  maximum iterations=50, maximum function evaluations=10000
  tolerances: relative=1e-08, absolute=1e-50, solution=1e-08
  total number of linear solver iterations=0
  total number of function evaluations=1
  KSP Object:
    type: gmres
      GMRES: restart=30, using Classical (unmodified) Gram-Schmidt
Orthogonalization with no iterative refinement
      GMRES: happy breakdown tolerance 1e-30
    maximum iterations=20, initial guess is zero
    tolerances:  relative=800695, absolute=5.33098e-35, divergence=5.33098e-35
    left preconditioning
    using PRECONDITIONED norm type for convergence test
  PC Object:
    type: lu
      LU: out-of-place factorization
      tolerance for zero pivot 1e-12
      matrix ordering: nd
      factor fill ratio given 5, needed 12.0255
        Factored matrix follows:
          Matrix Object:
            type=seqaij, rows=10000, cols=10000
            package used to perform factorization: petsc
            total: nonzeros=13464834, allocated nonzeros=13464834
              using I-node routines: found 6447 nodes, limit used is 5
    linear system matrix = precond matrix:
    Matrix Object:
      type=seqaij, rows=10000, cols=10000
      total: nonzeros=1119686, allocated nonzeros=1280000
        not using I-node routines
Nonlinear solve did not converge due to DIVERGED_LS_FAILURE

I tried this with both -pc_type lu and without and got the same results...

> -snes_mf_operator : solve with matrix-free finite differenced Jacobian,
> preconditioned using the matrix you assembled
> -snes_fd : assemble the dense FD operator (same as created by -snes_type
> test) and solve using that

I also tried using -snes_fd and get:

[0]PETSC ERROR: --------------------- Error Message
------------------------------------
[0]PETSC ERROR: Null argument, when expecting valid pointer!
[0]PETSC ERROR: Null Object: Parameter # 1!
[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: Petsc Release Version 3.1.0, Patch 8, Thu Mar 17
13:37:48 CDT 2011
[0]PETSC ERROR: See docs/changes/index.html for recent updates.
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[0]PETSC ERROR: See docs/index.html for manual pages.
[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: ./ppm_pf on a darwin10. named
milan-mitrovics-macbook-pro.local by milan Mon Aug 29 17:41:15 2011
[0]PETSC ERROR: Libraries linked from /Users/milan/Work/Library/petsc/lib
[0]PETSC ERROR: Configure run at Fri May  6 16:32:02 2011
[0]PETSC ERROR: Configure options --with-mpi=true
--with-mpi-dir=/Users/milan/Work/Library/openmpi.gcc/
--with-fortran=true --with-sundials=true
--with-sundials-dir=/Users/milan/Work/Library/sundials/
--prefix=/Users/milan/Work/Library/petsc
[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: MatAssembled() line 4595 in src/mat/interface/matrix.c
[0]PETSC ERROR: SNESDefaultComputeJacobian() line 64 in
src/snes/interface/snesj.c
[0]PETSC ERROR: SNESComputeJacobian() line 1198 in src/snes/interface/snes.c
[0]PETSC ERROR: SNESSolve_LS() line 189 in src/snes/impls/ls/ls.c
[0]PETSC ERROR: SNESSolve() line 2255 in src/snes/interface/snes.c

so I still havent gotten it to converge a single time :(


More information about the petsc-users mailing list