<div dir="ltr">On Tue, Oct 22, 2013 at 8:29 AM, Christophe Ortiz <span dir="ltr"><<a href="mailto:christophe.ortiz@ciemat.es" target="_blank">christophe.ortiz@ciemat.es</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Barry,<div><br></div><div>Thanks for suggestions. Here is the output.</div><div>
Before using the options you suggest I get:</div><div><br></div><div><div> TSAdapt 'basic': step 182 accepted t=0.341561 + 3.416e-02 wlte=1.1e-09 family='arkimex' scheme=0:'3' dt=3.757e-02 </div>
<div> TSAdapt 'basic': step 183 accepted t=0.375717 + 3.757e-02 wlte=9.05e-14 family='arkimex' scheme=0:'3' dt=4.133e-02 </div><div> TSAdapt 'basic': step 184 stage rejected t=0.413289 + 4.133e-02 retrying with dt=1.033e-02 </div>
<div> TSAdapt 'basic': step 184 stage rejected t=0.413289 + 1.033e-02 retrying with dt=2.583e-03 </div></div><div>...</div><div><div> TSAdapt 'basic': step 184 stage rejected t=0.413289 +2.212e-198 retrying with dt=5.529e-199</div>
<div> TSAdapt 'basic': step 184 stage rejected t=0.413289 +5.529e-199 retrying with dt=1.382e-199</div><div>[0]PETSC ERROR: --------------------- Error Message ------------------------------------</div><div>
[0]PETSC ERROR: Floating point exception!</div><div>[0]PETSC ERROR: Vec entry at local location 12 is not-a-number or infinite at end of function: Parameter number 3!</div></div><div><br></div><div><br></div><div> I re-checked my Jacobian several times, and I found few errors. But now I think it is ok.<br>
</div><div>Then, with the options you suggest, it stops immediatly. Not even one timestep:</div></div></blockquote><div><br></div><div>Something is very wrong here. The Jacobian should at least have something on the diagonal from the time derivative,</div>
<div>but the Laplacian (u, v) and q (w) also have diagonals.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
<div><div> 0 SNES Function norm 5.929210530071e+26 </div><div>[0]PETSC ERROR: --------------------- Error Message ------------------------------------</div>
<div>[0]PETSC ERROR: Detected zero pivot in LU factorization:</div><div>see <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html#ZeroPivot" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html#ZeroPivot</a>!</div>
<div>
[0]PETSC ERROR: Zero pivot row 17 value 1.35114e-16 tolerance 2.22045e-14!</div></div><div>...</div><div><div>[0]PETSC ERROR: MatPivotCheck_none() line 589 in src/mat/impls/aij/seq//home/u5751/petsc-3.4.1/include/petsc-private/matimpl.h</div>
<div>[0]PETSC ERROR: MatPivotCheck() line 608 in src/mat/impls/aij/seq//home/u5751/petsc-3.4.1/include/petsc-private/matimpl.h</div><div>[0]PETSC ERROR: MatLUFactorNumeric_SeqAIJ_Inode() line 1626 in src/mat/impls/aij/seq/inode.c</div>
<div>[0]PETSC ERROR: MatLUFactorNumeric() line 2889 in src/mat/interface/matrix.c</div><div>[0]PETSC ERROR: PCSetUp_LU() line 152 in src/ksp/pc/impls/factor/lu/lu.c</div><div>[0]PETSC ERROR: PCSetUp() line 890 in src/ksp/pc/interface/precon.c</div>
<div>[0]PETSC ERROR: KSPSetUp() line 278 in src/ksp/ksp/interface/itfunc.c</div><div>[0]PETSC ERROR: KSPSolve() line 399 in src/ksp/ksp/interface/itfunc.c</div><div>[0]PETSC ERROR: SNESSolve_NEWTONLS() line 220 in src/snes/impls/ls/ls.c</div>
<div>[0]PETSC ERROR: SNESSolve() line 3636 in src/snes/interface/snes.c</div><div>[0]PETSC ERROR: TSStep_ARKIMEX() line 765 in src/ts/impls/arkimex/arkimex.c</div><div>[0]PETSC ERROR: TSStep() line 2458 in src/ts/interface/ts.c</div>
<div>[0]PETSC ERROR: TSSolve() line 2583 in src/ts/interface/ts.c</div><div>[0]PETSC ERROR: main() line 455 in src/ts/examples/tutorials/diffusion.c</div></div><div><br></div><div>Does this give you a hint ?</div><div><br>
</div><div>Christophe</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div>CIEMAT<br>Laboratorio Nacional de Fusión por Confinamiento Magnético<br>Unidad de Materiales<div>Edificio 2 - Planta 0 - Despacho 28m<br>
Avenida Complutense 40,<br>28040 Madrid, Spain<br>Tel: <a href="tel:%2B34%2091496%202582" value="+34914962582" target="_blank">+34 91496 2582</a><br>Fax: <a href="tel:%2B34%2091346%206442" value="+34913466442" target="_blank">+34 91346 6442</a><br>
<br>--<br><span style="color:rgb(0,128,0);font-family:Webdings;font-size:x-large">Q</span> <div><span style="white-space:pre-wrap">Por favor, piense en el medio ambiente antes de imprimir este mensaje.</span><div>
<span style="white-space:pre-wrap">Please consider the environment before printing this email.</span></div></div></div></div>
<br><br><div class="gmail_quote">On Tue, Oct 22, 2013 at 1:58 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Add -snes_monitor -snes_converged_reason -ksp_monitor -ksp_converged_reason -pc_type lu (send the output)<br>
<br>
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 <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html#newton" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html#newton</a><br>
<span><font color="#888888"><br>
Barry<br>
</font></span><div><div><br>
<br>
On Oct 22, 2013, at 4:16 AM, Christophe Ortiz <<a href="mailto:christophe.ortiz@ciemat.es" target="_blank">christophe.ortiz@ciemat.es</a>> wrote:<br>
<br>
> Hi Jed,<br>
><br>
> I added a third specie to my problem (step by step :-)).<br>
><br>
> Now my system is the following:<br>
><br>
> u_t - alpha u_xx +(k.u.v - q.w) = 0<br>
> v_t - beta v_xx +(k.u.v - q.w) = 0<br>
> w_t -(k.u.v - q.w) = 0<br>
><br>
><br>
> So I have 2 PDEs and 1 ODE. I put everything under IFunction and IJacobian.<br>
> For the PDEs I defined Dirichlet boundary conditions.<br>
><br>
> For this simple system, I have lot of problems, it does not converge.<br>
><br>
> I followed your suggestions and I removed any options from the code, and put TSSetFromOptions(); at the end.<br>
> The default options are thus SNESNEWTONLS, KSPGMRES, LineSearch bt, ARKIMEX 3.<br>
><br>
> I obtain the following output:<br>
><br>
> TSAdapt 'basic': step 101 accepted t=1.07438 + 3.223e-01 wlte= 0 family='arkimex' scheme=0:'3' dt=4.190e-01<br>
> TSAdapt 'basic': step 102 accepted t=1.39669 + 4.190e-01 wlte=5.21e-13 family='arkimex' scheme=0:'3' dt=5.447e-01<br>
> TSAdapt 'basic': step 103 accepted t=1.8157 + 5.447e-01 wlte=1.64e-13 family='arkimex' scheme=0:'3' dt=7.081e-01<br>
> TSAdapt 'basic': step 104 accepted t=2.36041 + 7.081e-01 wlte=5.62e-14 family='arkimex' scheme=0:'3' dt=9.206e-01<br>
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 9.206e-01, 1 failures exceeds current TS allowed<br>
> [0]PETSC ERROR: --------------------- Error Message ------------------------------------<br>
> [0]PETSC ERROR: !<br>
> [0]PETSC ERROR: TSStep has failed due to DIVERGED_NONLINEAR_SOLVE, increase -ts_max_snes_failures or make negative to attempt recovery!<br>
><br>
><br>
><br>
> ThenI increase the max number of failures. When I do so, I get the following error message:<br>
><br>
> TSAdapt 'basic': step 101 accepted t=1.07438 + 3.223e-01 wlte= 0 family='arkimex' scheme=0:'3' dt=4.190e-01<br>
> TSAdapt 'basic': step 102 accepted t=1.39669 + 4.190e-01 wlte=5.21e-13 family='arkimex' scheme=0:'3' dt=5.447e-01<br>
> TSAdapt 'basic': step 103 accepted t=1.8157 + 5.447e-01 wlte=1.64e-13 family='arkimex' scheme=0:'3' dt=7.081e-01<br>
> TSAdapt 'basic': step 104 accepted t=2.36041 + 7.081e-01 wlte=5.62e-14 family='arkimex' scheme=0:'3' dt=9.206e-01<br>
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 9.206e-01 retrying with dt=2.301e-01<br>
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 2.301e-01 retrying with dt=5.753e-02<br>
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 5.753e-02 retrying with dt=1.438e-02<br>
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 1.438e-02 retrying with dt=3.596e-03<br>
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 3.596e-03 retrying with dt=8.990e-04<br>
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 8.990e-04 retrying with dt=2.247e-04<br>
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 2.247e-04 retrying with dt=5.619e-05<br>
> TSAdapt 'basic': step 105 stage rejected t=3.06853 + 5.619e-05 retrying with dt=1.405e-05<br>
><br>
> ...<br>
> ...<br>
> TSAdapt 'basic': step 105 stage rejected t=3.06853 +5.679e-179 retrying with dt=1.420e-179<br>
> TSAdapt 'basic': step 105 stage rejected t=3.06853 +1.420e-179 retrying with dt=3.550e-180<br>
> TSAdapt 'basic': step 105 stage rejected t=3.06853 +3.550e-180 retrying with dt=8.874e-181<br>
> [0]PETSC ERROR: --------------------- Error Message ------------------------------------<br>
> [0]PETSC ERROR: Floating point exception!<br>
> [0]PETSC ERROR: Vec entry at local location 15 is not-a-number or infinite at end of function: Parameter number 3!<br>
><br>
> 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.<br>
><br>
> Any idea how to solve that ?<br>
> 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:<br>
><br>
> Is your problem similar to ex25? (If I remember<br>
> correctly, that example uses a DAE formulation for boundary conditions<br>
> and thus has trouble with some methods with explicit stages. There may<br>
> be more going on.)<br>
><br>
> 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 ?<br>
> 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.<br>
><br>
> Thanks a lot in advance for your help.<br>
> Christophe<br>
><br>
<br>
</div></div></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>