[petsc-users] snes options for rough solution

Praveen C cpraveen at gmail.com
Mon Dec 12 02:29:29 CST 2016


Hello Matt

I have attached the detailed output.

Fenics automatically computes Jacobian, so I think Jacobian should be
correct. I am not able to run the Fenics code without giving the Jacobian.
I am currently writing a C code where I can test this.

This equation is bit weird. Its like this

u_t = ( K u_x)_x

K = u / sqrt(u_x^2 + eps^2)

If u > 0, then this is a nonlinear parabolic eqn. Problem is that eps = h
(mesh size), so at extrema, it is like

u_t = (u/eps)*u_xx

and (1/eps) is approximating a delta function.

Best
praveen

On Mon, Dec 12, 2016 at 12:41 PM, Matthew Knepley <knepley at gmail.com> wrote:

> On Mon, Dec 12, 2016 at 1:04 AM, Matthew Knepley <knepley at gmail.com>
> wrote:
>
>> On Mon, Dec 12, 2016 at 12:56 AM, Praveen C <cpraveen at gmail.com> wrote:
>>
>>> Increasing number of snes iterations, I get convergence.
>>>
>>> So it is a problem of initial guess being too far from the solution of
>>> the nonlinear equation.
>>>
>>> Solution can be seen here
>>>
>>> https://github.com/cpraveen/fenics/blob/master/1d/cosmic_ray
>>> /cosmic_ray.ipynb
>>>
>>
> Also, how is this a parabolic equation? It looks like u/|u'| to me, which
> does not look parabolic at all.
>
>   Matt
>
>
>> Green curve is solution after two time steps.
>>>
>>> It took about 100 snes iterations in first time step and about 50 in
>>> second time step.
>>>
>>> I use exact Jacobian and direct LU solve.
>>>
>>
>> I do not believe its the correct Jacobian. Did you test it as I asked?
>> Also run with
>>
>>   -snes_monitor -ksp_monitor_true_residual -snes_view
>> -snes_converged_reason
>>
>> and then
>>
>>   -snes_fd
>>
>> and send all the output
>>
>>    Matt
>>
>>
>>> Thanks
>>> praveen
>>>
>>
>>
>>
>> --
>> 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
>>
>
>
>
> --
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20161212/ec003c68/attachment-0001.html>
-------------- next part --------------
h  =  0.01
dt =  0.01
Solving nonlinear variational problem.
  0 SNES Function norm 1.977638959494e+00 
  1 SNES Function norm 1.924169835496e+00 
  2 SNES Function norm 1.922201608879e+00 
  3 SNES Function norm 1.920237421814e+00 
  4 SNES Function norm 1.918277062381e+00 
  5 SNES Function norm 1.916320289472e+00 
  6 SNES Function norm 1.914366865403e+00 
  7 SNES Function norm 1.912416585240e+00 
  8 SNES Function norm 1.910469283868e+00 
  9 SNES Function norm 1.899960770375e+00 
 10 SNES Function norm 1.879131065459e+00 
 11 SNES Function norm 1.857531063656e+00 
 12 SNES Function norm 1.836809521483e+00 
 13 SNES Function norm 1.816709863124e+00 
 14 SNES Function norm 1.797014998190e+00 
 15 SNES Function norm 1.777737697197e+00 
 16 SNES Function norm 1.758825541543e+00 
 17 SNES Function norm 1.740232061718e+00 
 18 SNES Function norm 1.721929885464e+00 
 19 SNES Function norm 1.703895519687e+00 
 20 SNES Function norm 1.686113465512e+00 
 21 SNES Function norm 1.668566528915e+00 
 22 SNES Function norm 1.651247832992e+00 
 23 SNES Function norm 1.634150402758e+00 
 24 SNES Function norm 1.617265971731e+00 
 25 SNES Function norm 1.600589248992e+00 
 26 SNES Function norm 1.584114929900e+00 
 27 SNES Function norm 1.567836662164e+00 
 28 SNES Function norm 1.551748332761e+00 
 29 SNES Function norm 1.535845822400e+00 
 30 SNES Function norm 1.520125060009e+00 
 31 SNES Function norm 1.504582049738e+00 
 32 SNES Function norm 1.489213340181e+00 
 33 SNES Function norm 1.474015969067e+00 
 34 SNES Function norm 1.458987020278e+00 
 35 SNES Function norm 1.444123487154e+00 
 36 SNES Function norm 1.429422455304e+00 
 37 SNES Function norm 1.414881258532e+00 
 38 SNES Function norm 1.400497521029e+00 
 39 SNES Function norm 1.386269021843e+00 
 40 SNES Function norm 1.372193573931e+00 
 41 SNES Function norm 1.358269024537e+00 
 42 SNES Function norm 1.344493290602e+00 
 43 SNES Function norm 1.330864378208e+00 
 44 SNES Function norm 1.317380313100e+00 
 45 SNES Function norm 1.304039060314e+00 
 46 SNES Function norm 1.290838655798e+00 
 47 SNES Function norm 1.277777248327e+00 
 48 SNES Function norm 1.264853054978e+00 
 49 SNES Function norm 1.252064339134e+00 
 50 SNES Function norm 1.239409403964e+00 
 51 SNES Function norm 1.226886591052e+00 
 52 SNES Function norm 1.214494281861e+00 
 53 SNES Function norm 1.202230901070e+00 
 54 SNES Function norm 1.190094918961e+00 
 55 SNES Function norm 1.178084849542e+00 
 56 SNES Function norm 1.166199243366e+00 
 57 SNES Function norm 1.154436670909e+00 
 58 SNES Function norm 1.142795705612e+00 
 59 SNES Function norm 1.131274935077e+00 
 60 SNES Function norm 1.119872975088e+00 
 61 SNES Function norm 1.006658785619e+00 
 62 SNES Function norm 9.965354091038e-01 
 63 SNES Function norm 9.865153605132e-01 
 64 SNES Function norm 9.765975240363e-01 
 65 SNES Function norm 9.667808048914e-01 
 66 SNES Function norm 9.570641211503e-01 
 67 SNES Function norm 9.474463955125e-01 
 68 SNES Function norm 9.508858486555e-01 
 69 SNES Function norm 8.515799668765e-01 
 70 SNES Function norm 7.646471697850e-01 
 71 SNES Function norm 6.867917438028e-01 
 72 SNES Function norm 6.176405904289e-01 
 73 SNES Function norm 5.556706584294e-01 
 74 SNES Function norm 4.999626714271e-01 
 75 SNES Function norm 4.463679712027e-01 
 76 SNES Function norm 4.017228526152e-01 
 77 SNES Function norm 3.616061488103e-01 
 78 SNES Function norm 3.255374775336e-01 
 79 SNES Function norm 2.930940243173e-01 
 80 SNES Function norm 2.639003327720e-01 
 81 SNES Function norm 2.376217412647e-01 
 82 SNES Function norm 2.139741463439e-01 
 83 SNES Function norm 1.926849809517e-01 
 84 SNES Function norm 1.735153700354e-01 
 85 SNES Function norm 1.562525692758e-01 
 86 SNES Function norm 1.407058781515e-01 
 87 SNES Function norm 1.267040909513e-01 
 88 SNES Function norm 1.140933639284e-01 
 89 SNES Function norm 1.027353600019e-01 
 90 SNES Function norm 9.250561741668e-02 
 91 SNES Function norm 8.329210826886e-02 
 92 SNES Function norm 7.499396232175e-02 
 93 SNES Function norm 6.752033924276e-02 
 94 SNES Function norm 6.078943744255e-02 
 95 SNES Function norm 5.472762212026e-02 
 96 SNES Function norm 4.926863241002e-02 
 97 SNES Function norm 4.435282122697e-02 
 98 SNES Function norm 3.992643547354e-02 
 99 SNES Function norm 2.442751870615e-02 
100 SNES Function norm 9.583107967453e-03 
101 SNES Function norm 3.353407360472e-03 
102 SNES Function norm 7.792652342405e-04 
103 SNES Function norm 6.592466838500e-05 
104 SNES Function norm 5.566315624542e-07 
105 SNES Function norm 4.129206377245e-11 
Nonlinear solve converged due to CONVERGED_FNORM_ABS iterations 105
SNES Object: 1 MPI processes
  type: vinewtonssls
  maximum iterations=200, maximum function evaluations=2000
  tolerances: relative=1e-09, absolute=1e-10, solution=1e-16
  total number of linear solver iterations=105
  total number of function evaluations=106
  norm schedule ALWAYS
  SNESLineSearch Object:   1 MPI processes
    type: bt
      interpolation: cubic
      alpha=1.000000e-04
    maxstep=1.000000e+08, minlambda=1.000000e-12
    tolerances: relative=1.000000e-08, absolute=1.000000e-15, lambda=1.000000e-08
    maximum iterations=40
  KSP Object:   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:   1 MPI processes
    type: lu
      LU: out-of-place factorization
      tolerance for zero pivot 2.22045e-14
      matrix ordering: nd
      factor fill ratio given 0., needed 0.
        Factored matrix follows:
          Mat Object:           1 MPI processes
            type: seqaij
            rows=101, cols=101
            package used to perform factorization: mumps
            total: nonzeros=499, allocated nonzeros=499
            total number of mallocs used during MatSetValues calls =0
              MUMPS run parameters:
                SYM (matrix type):                   0 
                PAR (host participation):            1 
                ICNTL(1) (output for error):         6 
                ICNTL(2) (output of diagnostic msg): 0 
                ICNTL(3) (output for global info):   0 
                ICNTL(4) (level of printing):        0 
                ICNTL(5) (input mat struct):         0 
                ICNTL(6) (matrix prescaling):        7 
                ICNTL(7) (sequentia matrix ordering):7 
                ICNTL(8) (scalling strategy):        77 
                ICNTL(10) (max num of refinements):  0 
                ICNTL(11) (error analysis):          0 
                ICNTL(12) (efficiency control):                         1 
                ICNTL(13) (efficiency control):                         0 
                ICNTL(14) (percentage of estimated workspace increase): 20 
                ICNTL(18) (input mat struct):                           0 
                ICNTL(19) (Shur complement info):                       0 
                ICNTL(20) (rhs sparse pattern):                         0 
                ICNTL(21) (solution struct):                            0 
                ICNTL(22) (in-core/out-of-core facility):               0 
                ICNTL(23) (max size of memory can be allocated locally):0 
                ICNTL(24) (detection of null pivot rows):               0 
                ICNTL(25) (computation of a null space basis):          0 
                ICNTL(26) (Schur options for rhs or solution):          0 
                ICNTL(27) (experimental parameter):                     -24 
                ICNTL(28) (use parallel or sequential ordering):        1 
                ICNTL(29) (parallel ordering):                          0 
                ICNTL(30) (user-specified set of entries in inv(A)):    0 
                ICNTL(31) (factors is discarded in the solve phase):    0 
                ICNTL(33) (compute determinant):                        0 
                CNTL(1) (relative pivoting threshold):      0.01 
                CNTL(2) (stopping criterion of refinement): 1.49012e-08 
                CNTL(3) (absolute pivoting threshold):      0. 
                CNTL(4) (value of static pivoting):         -1. 
                CNTL(5) (fixation for null pivots):         0. 
                RINFO(1) (local estimated flops for the elimination after analysis): 
                  [0] 993. 
                RINFO(2) (local estimated flops for the assembly after factorization): 
                  [0]  392. 
                RINFO(3) (local estimated flops for the elimination after factorization): 
                  [0]  993. 
                INFO(15) (estimated size of (in MB) MUMPS internal data for running numerical factorization): 
                [0] 1 
                INFO(16) (size of (in MB) MUMPS internal data used during numerical factorization): 
                  [0] 1 
                INFO(23) (num of pivots eliminated on this processor after factorization): 
                  [0] 101 
                RINFOG(1) (global estimated flops for the elimination after analysis): 993. 
                RINFOG(2) (global estimated flops for the assembly after factorization): 392. 
                RINFOG(3) (global estimated flops for the elimination after factorization): 993. 
                (RINFOG(12) RINFOG(13))*2^INFOG(34) (determinant): (0.,0.)*(2^0)
                INFOG(3) (estimated real workspace for factors on all processors after analysis): 499 
                INFOG(4) (estimated integer workspace for factors on all processors after analysis): 2079 
                INFOG(5) (estimated maximum front size in the complete tree): 3 
                INFOG(6) (number of nodes in the complete tree): 99 
                INFOG(7) (ordering option effectively use after analysis): 2 
                INFOG(8) (structural symmetry in percent of the permuted matrix after analysis): 100 
                INFOG(9) (total real/complex workspace to store the matrix factors after factorization): 499 
                INFOG(10) (total integer space store the matrix factors after factorization): 2079 
                INFOG(11) (order of largest frontal matrix after factorization): 3 
                INFOG(12) (number of off-diagonal pivots): 0 
                INFOG(13) (number of delayed pivots after factorization): 0 
                INFOG(14) (number of memory compress after factorization): 0 
                INFOG(15) (number of steps of iterative refinement after solution): 0 
                INFOG(16) (estimated size (in MB) of all MUMPS internal data for factorization after analysis: value on the most memory consuming processor): 1 
                INFOG(17) (estimated size of all MUMPS internal data for factorization after analysis: sum over all processors): 1 
                INFOG(18) (size of all MUMPS internal data allocated during factorization: value on the most memory consuming processor): 1 
                INFOG(19) (size of all MUMPS internal data allocated during factorization: sum over all processors): 1 
                INFOG(20) (estimated number of entries in the factors): 499 
                INFOG(21) (size in MB of memory effectively used during factorization - value on the most memory consuming processor): 1 
                INFOG(22) (size in MB of memory effectively used during factorization - sum over all processors): 1 
                INFOG(23) (after analysis: value of ICNTL(6) effectively used): 0 
                INFOG(24) (after analysis: value of ICNTL(12) effectively used): 1 
                INFOG(25) (after factorization: number of pivots modified by static pivoting): 0 
                INFOG(28) (after factorization: number of null pivots encountered): 0
                INFOG(29) (after factorization: effective number of entries in the factors (sum over all processors)): 499
                INFOG(30, 31) (after solution: size in Mbytes of memory used during solution phase): 0, 0
                INFOG(32) (after analysis: type of analysis done): 1
                INFOG(33) (value used for ICNTL(8)): 7
                INFOG(34) (exponent of the determinant if determinant is requested): 0
    linear system matrix = precond matrix:
    Mat Object:     1 MPI processes
      type: seqaij
      rows=101, cols=101
      total: nonzeros=303, allocated nonzeros=303
      total number of mallocs used during MatSetValues calls =0
        not using I-node routines
  PETSc SNES solver converged in 105 iterations with convergence reason CONVERGED_FNORM_ABS.
Solving nonlinear variational problem.
  0 SNES Function norm 6.623206717145e-01 
  1 SNES Function norm 6.556821069554e-01 
  2 SNES Function norm 6.491099981285e-01 
  3 SNES Function norm 6.426037008333e-01 
  4 SNES Function norm 6.361626956675e-01 
  5 SNES Function norm 6.297864680981e-01 
  6 SNES Function norm 5.749259243409e-01 
  7 SNES Function norm 5.691573594996e-01 
  8 SNES Function norm 5.634472907047e-01 
  9 SNES Function norm 5.577950372875e-01 
 10 SNES Function norm 5.521998463416e-01 
 11 SNES Function norm 5.466609217750e-01 
 12 SNES Function norm 5.411774340146e-01 
 13 SNES Function norm 5.357485298680e-01 
 14 SNES Function norm 5.303733708588e-01 
 15 SNES Function norm 5.250512178084e-01 
 16 SNES Function norm 5.197815360359e-01 
 17 SNES Function norm 5.145640347623e-01 
 18 SNES Function norm 5.093985766790e-01 
 19 SNES Function norm 4.646423240600e-01 
 20 SNES Function norm 4.576766105809e-01 
 21 SNES Function norm 4.174336257378e-01 
 22 SNES Function norm 3.742302716857e-01 
 23 SNES Function norm 3.357283827242e-01 
 24 SNES Function norm 3.014171088900e-01 
 25 SNES Function norm 2.704703694106e-01 
 26 SNES Function norm 2.433222943686e-01 
 27 SNES Function norm 2.186726322928e-01 
 28 SNES Function norm 1.965068773466e-01 
 29 SNES Function norm 1.766108019269e-01 
 30 SNES Function norm 1.587661144089e-01 
 31 SNES Function norm 1.427482658793e-01 
 32 SNES Function norm 1.283590510004e-01 
 33 SNES Function norm 1.154270364093e-01 
 34 SNES Function norm 1.038012241207e-01 
 35 SNES Function norm 9.334326660164e-02 
 36 SNES Function norm 8.393997747033e-02 
 37 SNES Function norm 7.549452654457e-02 
 38 SNES Function norm 6.790730578509e-02 
 39 SNES Function norm 6.108800733894e-02 
 40 SNES Function norm 5.495707008678e-02 
 41 SNES Function norm 4.944392679486e-02 
 42 SNES Function norm 4.448565604949e-02 
 43 SNES Function norm 2.815467755193e-02 
 44 SNES Function norm 1.194728783916e-02 
 45 SNES Function norm 4.292205565379e-03 
 46 SNES Function norm 1.102470315477e-03 
 47 SNES Function norm 1.185868296672e-04 
 48 SNES Function norm 1.687572026972e-06 
 49 SNES Function norm 3.521970663626e-10 
Nonlinear solve converged due to CONVERGED_FNORM_RELATIVE iterations 49
SNES Object: 1 MPI processes
  type: vinewtonssls
  maximum iterations=200, maximum function evaluations=2000
  tolerances: relative=1e-09, absolute=1e-10, solution=1e-16
  total number of linear solver iterations=49
  total number of function evaluations=50
  norm schedule ALWAYS
  SNESLineSearch Object:   1 MPI processes
    type: bt
      interpolation: cubic
      alpha=1.000000e-04
    maxstep=1.000000e+08, minlambda=1.000000e-12
    tolerances: relative=1.000000e-08, absolute=1.000000e-15, lambda=1.000000e-08
    maximum iterations=40
  KSP Object:   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:   1 MPI processes
    type: lu
      LU: out-of-place factorization
      tolerance for zero pivot 2.22045e-14
      matrix ordering: nd
      factor fill ratio given 0., needed 0.
        Factored matrix follows:
          Mat Object:           1 MPI processes
            type: seqaij
            rows=101, cols=101
            package used to perform factorization: mumps
            total: nonzeros=499, allocated nonzeros=499
            total number of mallocs used during MatSetValues calls =0
              MUMPS run parameters:
                SYM (matrix type):                   0 
                PAR (host participation):            1 
                ICNTL(1) (output for error):         6 
                ICNTL(2) (output of diagnostic msg): 0 
                ICNTL(3) (output for global info):   0 
                ICNTL(4) (level of printing):        0 
                ICNTL(5) (input mat struct):         0 
                ICNTL(6) (matrix prescaling):        7 
                ICNTL(7) (sequentia matrix ordering):7 
                ICNTL(8) (scalling strategy):        77 
                ICNTL(10) (max num of refinements):  0 
                ICNTL(11) (error analysis):          0 
                ICNTL(12) (efficiency control):                         1 
                ICNTL(13) (efficiency control):                         0 
                ICNTL(14) (percentage of estimated workspace increase): 20 
                ICNTL(18) (input mat struct):                           0 
                ICNTL(19) (Shur complement info):                       0 
                ICNTL(20) (rhs sparse pattern):                         0 
                ICNTL(21) (solution struct):                            0 
                ICNTL(22) (in-core/out-of-core facility):               0 
                ICNTL(23) (max size of memory can be allocated locally):0 
                ICNTL(24) (detection of null pivot rows):               0 
                ICNTL(25) (computation of a null space basis):          0 
                ICNTL(26) (Schur options for rhs or solution):          0 
                ICNTL(27) (experimental parameter):                     -24 
                ICNTL(28) (use parallel or sequential ordering):        1 
                ICNTL(29) (parallel ordering):                          0 
                ICNTL(30) (user-specified set of entries in inv(A)):    0 
                ICNTL(31) (factors is discarded in the solve phase):    0 
                ICNTL(33) (compute determinant):                        0 
                CNTL(1) (relative pivoting threshold):      0.01 
                CNTL(2) (stopping criterion of refinement): 1.49012e-08 
                CNTL(3) (absolute pivoting threshold):      0. 
                CNTL(4) (value of static pivoting):         -1. 
                CNTL(5) (fixation for null pivots):         0. 
                RINFO(1) (local estimated flops for the elimination after analysis): 
                  [0] 993. 
                RINFO(2) (local estimated flops for the assembly after factorization): 
                  [0]  392. 
                RINFO(3) (local estimated flops for the elimination after factorization): 
                  [0]  993. 
                INFO(15) (estimated size of (in MB) MUMPS internal data for running numerical factorization): 
                [0] 1 
                INFO(16) (size of (in MB) MUMPS internal data used during numerical factorization): 
                  [0] 1 
                INFO(23) (num of pivots eliminated on this processor after factorization): 
                  [0] 101 
                RINFOG(1) (global estimated flops for the elimination after analysis): 993. 
                RINFOG(2) (global estimated flops for the assembly after factorization): 392. 
                RINFOG(3) (global estimated flops for the elimination after factorization): 993. 
                (RINFOG(12) RINFOG(13))*2^INFOG(34) (determinant): (0.,0.)*(2^0)
                INFOG(3) (estimated real workspace for factors on all processors after analysis): 499 
                INFOG(4) (estimated integer workspace for factors on all processors after analysis): 2079 
                INFOG(5) (estimated maximum front size in the complete tree): 3 
                INFOG(6) (number of nodes in the complete tree): 99 
                INFOG(7) (ordering option effectively use after analysis): 2 
                INFOG(8) (structural symmetry in percent of the permuted matrix after analysis): 100 
                INFOG(9) (total real/complex workspace to store the matrix factors after factorization): 499 
                INFOG(10) (total integer space store the matrix factors after factorization): 2079 
                INFOG(11) (order of largest frontal matrix after factorization): 3 
                INFOG(12) (number of off-diagonal pivots): 0 
                INFOG(13) (number of delayed pivots after factorization): 0 
                INFOG(14) (number of memory compress after factorization): 0 
                INFOG(15) (number of steps of iterative refinement after solution): 0 
                INFOG(16) (estimated size (in MB) of all MUMPS internal data for factorization after analysis: value on the most memory consuming processor): 1 
                INFOG(17) (estimated size of all MUMPS internal data for factorization after analysis: sum over all processors): 1 
                INFOG(18) (size of all MUMPS internal data allocated during factorization: value on the most memory consuming processor): 1 
                INFOG(19) (size of all MUMPS internal data allocated during factorization: sum over all processors): 1 
                INFOG(20) (estimated number of entries in the factors): 499 
                INFOG(21) (size in MB of memory effectively used during factorization - value on the most memory consuming processor): 1 
                INFOG(22) (size in MB of memory effectively used during factorization - sum over all processors): 1 
                INFOG(23) (after analysis: value of ICNTL(6) effectively used): 0 
                INFOG(24) (after analysis: value of ICNTL(12) effectively used): 1 
                INFOG(25) (after factorization: number of pivots modified by static pivoting): 0 
                INFOG(28) (after factorization: number of null pivots encountered): 0
                INFOG(29) (after factorization: effective number of entries in the factors (sum over all processors)): 499
                INFOG(30, 31) (after solution: size in Mbytes of memory used during solution phase): 0, 0
                INFOG(32) (after analysis: type of analysis done): 1
                INFOG(33) (value used for ICNTL(8)): 7
                INFOG(34) (exponent of the determinant if determinant is requested): 0
    linear system matrix = precond matrix:
    Mat Object:     1 MPI processes
      type: seqaij
      rows=101, cols=101
      total: nonzeros=303, allocated nonzeros=303
      total number of mallocs used during MatSetValues calls =0
        not using I-node routines
  PETSc SNES solver converged in 49 iterations with convergence reason CONVERGED_FNORM_RELATIVE.
it, t = 2 0.02


More information about the petsc-users mailing list