[petsc-users] Suggestions for code with dof >> 1 ?

Matthew Knepley knepley at gmail.com
Tue Oct 22 08:37:51 CDT 2013


On Tue, Oct 22, 2013 at 8:29 AM, Christophe Ortiz <
christophe.ortiz at ciemat.es> wrote:

> Hi Barry,
>
> Thanks for suggestions. Here is the output.
> Before using the options you suggest I get:
>
>  TSAdapt 'basic': step 182 accepted t=0.341561   + 3.416e-02 wlte=1.1e-09
> family='arkimex' scheme=0:'3' dt=3.757e-02
>       TSAdapt 'basic': step 183 accepted t=0.375717   + 3.757e-02
> wlte=9.05e-14 family='arkimex' scheme=0:'3' dt=4.133e-02
>       TSAdapt 'basic': step 184 stage rejected t=0.413289   + 4.133e-02
> retrying with dt=1.033e-02
>       TSAdapt 'basic': step 184 stage rejected t=0.413289   + 1.033e-02
> retrying with dt=2.583e-03
> ...
>       TSAdapt 'basic': step 184 stage rejected t=0.413289   +2.212e-198
> retrying with dt=5.529e-199
>       TSAdapt 'basic': step 184 stage rejected t=0.413289   +5.529e-199
> retrying with dt=1.382e-199
> [0]PETSC ERROR: --------------------- Error Message
> ------------------------------------
> [0]PETSC ERROR: Floating point exception!
> [0]PETSC ERROR: Vec entry at local location 12 is not-a-number or infinite
> at end of function: Parameter number 3!
>
>
>  I re-checked my Jacobian several times, and I found few errors. But now I
> think it is ok.
> Then, with the options you suggest, it stops immediatly. Not even one
> timestep:
>

Something is very wrong here. The Jacobian should at least have something
on the diagonal from the time derivative,
but the Laplacian (u, v) and q (w) also have diagonals.

   Matt


>     0 SNES Function norm 5.929210530071e+26
> [0]PETSC ERROR: --------------------- Error Message
> ------------------------------------
> [0]PETSC ERROR: Detected zero pivot in LU factorization:
> see http://www.mcs.anl.gov/petsc/documentation/faq.html#ZeroPivot!
> [0]PETSC ERROR: Zero pivot row 17 value 1.35114e-16 tolerance 2.22045e-14!
> ...
> [0]PETSC ERROR: MatPivotCheck_none() line 589 in
> src/mat/impls/aij/seq//home/u5751/petsc-3.4.1/include/petsc-private/matimpl.h
> [0]PETSC ERROR: MatPivotCheck() line 608 in
> src/mat/impls/aij/seq//home/u5751/petsc-3.4.1/include/petsc-private/matimpl.h
> [0]PETSC ERROR: MatLUFactorNumeric_SeqAIJ_Inode() line 1626 in
> src/mat/impls/aij/seq/inode.c
> [0]PETSC ERROR: MatLUFactorNumeric() line 2889 in
> src/mat/interface/matrix.c
> [0]PETSC ERROR: PCSetUp_LU() line 152 in src/ksp/pc/impls/factor/lu/lu.c
> [0]PETSC ERROR: PCSetUp() line 890 in src/ksp/pc/interface/precon.c
> [0]PETSC ERROR: KSPSetUp() line 278 in src/ksp/ksp/interface/itfunc.c
> [0]PETSC ERROR: KSPSolve() line 399 in src/ksp/ksp/interface/itfunc.c
> [0]PETSC ERROR: SNESSolve_NEWTONLS() line 220 in src/snes/impls/ls/ls.c
> [0]PETSC ERROR: SNESSolve() line 3636 in src/snes/interface/snes.c
> [0]PETSC ERROR: TSStep_ARKIMEX() line 765 in src/ts/impls/arkimex/arkimex.c
> [0]PETSC ERROR: TSStep() line 2458 in src/ts/interface/ts.c
> [0]PETSC ERROR: TSSolve() line 2583 in src/ts/interface/ts.c
> [0]PETSC ERROR: main() line 455 in src/ts/examples/tutorials/diffusion.c
>
> Does this give you a hint ?
>
> Christophe
>
>
> CIEMAT
> Laboratorio Nacional de Fusión por Confinamiento Magnético
> Unidad de Materiales
> Edificio 2 - Planta 0 - Despacho 28m
> Avenida Complutense 40,
> 28040 Madrid, Spain
> Tel: +34 91496 2582
> Fax: +34 91346 6442
>
> --
> Q
> Por favor, piense en el medio ambiente antes de imprimir este mensaje.
> Please consider the environment before printing this email.
>
>
> On Tue, Oct 22, 2013 at 1:58 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
>>
>>    Add -snes_monitor -snes_converged_reason -ksp_monitor
>> -ksp_converged_reason -pc_type lu (send the output)
>>
>>    Does it now get stuck at the same time step or does it get past it?
>> The most common cause of this problem is an incorrect Jacobian
>> http://www.mcs.anl.gov/petsc/documentation/faq.html#newton
>>
>>    Barry
>>
>>
>> On Oct 22, 2013, at 4:16 AM, Christophe Ortiz <christophe.ortiz at ciemat.es>
>> wrote:
>>
>> > Hi Jed,
>> >
>> > I added a third specie to my problem (step by step :-)).
>> >
>> > Now my system is the following:
>> >
>> > u_t - alpha u_xx +(k.u.v - q.w) = 0
>> > v_t - beta v_xx +(k.u.v - q.w) = 0
>> > w_t -(k.u.v - q.w) = 0
>> >
>> >
>> > So I have 2 PDEs and 1 ODE. I put everything under IFunction and
>> IJacobian.
>> > For the PDEs I defined Dirichlet boundary conditions.
>> >
>> > For this simple system, I have lot of problems, it does not converge.
>> >
>> > I followed your suggestions and I removed any options from the code,
>> and put TSSetFromOptions(); at the end.
>> > The default options are thus SNESNEWTONLS, KSPGMRES, LineSearch bt,
>> ARKIMEX 3.
>> >
>> > I obtain the following output:
>> >
>> >       TSAdapt 'basic': step 101 accepted t=1.07438    + 3.223e-01 wlte=
>>    0 family='arkimex' scheme=0:'3' dt=4.190e-01
>> >       TSAdapt 'basic': step 102 accepted t=1.39669    + 4.190e-01
>> wlte=5.21e-13 family='arkimex' scheme=0:'3' dt=5.447e-01
>> >       TSAdapt 'basic': step 103 accepted t=1.8157     + 5.447e-01
>> wlte=1.64e-13 family='arkimex' scheme=0:'3' dt=7.081e-01
>> >       TSAdapt 'basic': step 104 accepted t=2.36041    + 7.081e-01
>> wlte=5.62e-14 family='arkimex' scheme=0:'3' dt=9.206e-01
>> >       TSAdapt 'basic': step 105 stage rejected t=3.06853    +
>> 9.206e-01, 1 failures exceeds current TS allowed
>> > [0]PETSC ERROR: --------------------- Error Message
>> ------------------------------------
>> > [0]PETSC ERROR:   !
>> > [0]PETSC ERROR: TSStep has failed due to DIVERGED_NONLINEAR_SOLVE,
>> increase -ts_max_snes_failures or make negative to attempt recovery!
>> >
>> >
>> >
>> > ThenI increase the max number of failures. When I do so, I get the
>> following error message:
>> >
>> >       TSAdapt 'basic': step 101 accepted t=1.07438    + 3.223e-01 wlte=
>>    0 family='arkimex' scheme=0:'3' dt=4.190e-01
>> >       TSAdapt 'basic': step 102 accepted t=1.39669    + 4.190e-01
>> wlte=5.21e-13 family='arkimex' scheme=0:'3' dt=5.447e-01
>> >       TSAdapt 'basic': step 103 accepted t=1.8157     + 5.447e-01
>> wlte=1.64e-13 family='arkimex' scheme=0:'3' dt=7.081e-01
>> >       TSAdapt 'basic': step 104 accepted t=2.36041    + 7.081e-01
>> wlte=5.62e-14 family='arkimex' scheme=0:'3' dt=9.206e-01
>> >       TSAdapt 'basic': step 105 stage rejected t=3.06853    + 9.206e-01
>> retrying with dt=2.301e-01
>> >       TSAdapt 'basic': step 105 stage rejected t=3.06853    + 2.301e-01
>> retrying with dt=5.753e-02
>> >       TSAdapt 'basic': step 105 stage rejected t=3.06853    + 5.753e-02
>> retrying with dt=1.438e-02
>> >       TSAdapt 'basic': step 105 stage rejected t=3.06853    + 1.438e-02
>> retrying with dt=3.596e-03
>> >       TSAdapt 'basic': step 105 stage rejected t=3.06853    + 3.596e-03
>> retrying with dt=8.990e-04
>> >       TSAdapt 'basic': step 105 stage rejected t=3.06853    + 8.990e-04
>> retrying with dt=2.247e-04
>> >       TSAdapt 'basic': step 105 stage rejected t=3.06853    + 2.247e-04
>> retrying with dt=5.619e-05
>> >       TSAdapt 'basic': step 105 stage rejected t=3.06853    + 5.619e-05
>> retrying with dt=1.405e-05
>> >
>> > ...
>> > ...
>> >       TSAdapt 'basic': step 105 stage rejected t=3.06853    +5.679e-179
>> retrying with dt=1.420e-179
>> >       TSAdapt 'basic': step 105 stage rejected t=3.06853    +1.420e-179
>> retrying with dt=3.550e-180
>> >       TSAdapt 'basic': step 105 stage rejected t=3.06853    +3.550e-180
>> retrying with dt=8.874e-181
>> > [0]PETSC ERROR: --------------------- Error Message
>> ------------------------------------
>> > [0]PETSC ERROR: Floating point exception!
>> > [0]PETSC ERROR: Vec entry at local location 15 is not-a-number or
>> infinite at end of function: Parameter number 3!
>> >
>> > It seems it is not able to recover, it decreases the timestep so much
>> that at the end you are left with something that it not a number, or 0.
>> >
>> > Any idea how to solve that ?
>> > Some time ago you told me it could be due to a problem associated with
>> DAE formulation for boundary conditions and methods with explicit stages:
>> >
>> > Is your problem similar to ex25?  (If I remember
>> > correctly, that example uses a DAE formulation for boundary conditions
>> > and thus has trouble with some methods with explicit stages.  There may
>> > be more going on.)
>> >
>> > How can I reformulate my problem so I do not use DAE formulation for
>> boundary conditions ? For instance, if I want u=u* at i=0, or Neumann (or
>> Robin) boundary conditions ?
>> > If due to method with explicit stages, which method do you recommend ?
>> I tried the FullyImplicit option for ARKIMEX, and it's even worse, it gets
>> slower.
>> >
>> > Thanks a lot in advance for your help.
>> > Christophe
>> >
>>
>>
>


-- 
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/20131022/f36844ce/attachment.html>


More information about the petsc-users mailing list