<div dir="ltr">All,<div><br></div><div>While running src/ts/examples/tutorials/ex8.c (in PETSc 3.5.1) for TSTYPE sundials and pseudo, I noticed that the solver overshoots the final time.</div>
<div><br></div><div><div>./ex8 -ts_monitor -ts_type sundials -ts_final_time 0.01 -ts_view</div><div><div>0 TS dt 0.001 time 0</div><div>1 TS dt 0.0001 time 0.0001</div><div>2 TS dt 0.0001 time 0.0002</div><div>3 TS dt 0.0001 time 0.0003</div><div>4 TS dt 0.000199571 time 0.000499571</div><div>5 TS dt 0.000199571 time 0.000699141</div><div>6 TS dt 0.000199571 time 0.000898712</div><div>7 TS dt 0.000199571 time 0.00109828</div><div>8 TS dt 0.000404911 time 0.00150319</div><div>9 TS dt 0.000804269 time 0.00230746</div><div>10 TS dt 0.00141825 time 0.00372572</div><div>11 TS dt 0.00141825 time 0.00514397</div><div>12 TS dt 0.00141825 time 0.00656222</div><div>13 TS dt 0.00141825 time 0.00798047</div><div>14 TS dt 0.00141825 time 0.00939873</div><div>15 TS dt 0.00193698 time 0.0113357</div><div>TS Object: 1 MPI processes</div><div> type: sundials</div><div> maximum steps=1000</div><div> maximum time=0.01</div><div> total number of nonlinear solver iterations=18</div><div> total number of nonlinear solve failures=0</div><div> total number of linear solver iterations=18</div><div> total number of rejected steps=0</div><div> Sundials integrater does not use SNES!</div><div> Sundials integrater type BDF: backward differentiation formula</div><div> Sundials abs tol 1e-06 rel tol 1e-06</div><div> Sundials linear solver tolerance factor 0.05</div><div> Sundials max dimension of Krylov subspace 5</div><div> Sundials using unmodified (classical) Gram-Schmidt for orthogonalization in GMRES</div><div> Sundials suggested factor for tolerance scaling 1</div><div> Sundials cumulative number of internal steps 15</div><div> Sundials no. of calls to rhs function 33</div><div> Sundials no. of calls to linear solver setup function 0</div><div> Sundials no. of error test failures 3</div><div> Sundials no. of nonlinear solver iterations 32</div><div> Sundials no. of nonlinear convergence failure 0</div><div> Sundials no. of linear iterations 18</div><div> Sundials no. of linear convergence failures 0</div><div> PC Object: 1 MPI processes</div><div> type: none</div><div> PC has not been set up so information may be incomplete</div><div> Sundials no. of preconditioner evaluations 0</div><div> Sundials no. of preconditioner solves 0</div><div> Sundials no. of Jacobian-vector product evaluations 18</div><div> Sundials no. of rhs calls for finite diff. Jacobian-vector evals 18</div><div>steps 15 (0 rejected, 0 SNES fails), ftime 0.0113357, nonlinits 18, linits 18</div><div>step 15 t=1.13357082e-02 h= 1.94e-03 |x|= 1.07e-01 |x_e|= 1.07e-01 |x-x_e|= 2.57e-06</div></div><div><br></div><div>./ex8 -ts_monitor -ts_type pseudo -ts_final_time 0.01 </div><div>0 TS dt 0.001 time 0</div><div>1 TS dt 0.0011 time 0.0011</div><div>2 TS dt 0.00122331 time 0.00232331</div><div>3 TS dt 0.00136211 time 0.00368542</div><div>4 TS dt 0.00151873 time 0.00520415</div><div>5 TS dt 0.00169599 time 0.00690014</div><div>6 TS dt 0.00189725 time 0.00879739</div><div>7 TS dt 0.0021266 time 0.010924</div><div><div>TS Object: 1 MPI processes</div><div> type: pseudo</div><div> maximum steps=1000</div><div> maximum time=0.01</div><div> total number of nonlinear solver iterations=7</div><div> total number of nonlinear solve failures=0</div><div> total number of linear solver iterations=7</div><div> total number of rejected steps=0</div><div> SNES Object: 1 MPI processes</div><div> type: ksponly</div><div> maximum iterations=50, maximum function evaluations=10000</div><div> tolerances: relative=1e-08, absolute=1e-50, solution=1e-08</div><div> total number of linear solver iterations=1</div><div> total number of function evaluations=1</div><div> SNESLineSearch Object: 1 MPI processes</div><div> type: basic</div><div> maxstep=1.000000e+08, minlambda=1.000000e-12</div><div> tolerances: relative=1.000000e-08, absolute=1.000000e-15, lambda=1.000000e-08</div><div> maximum iterations=1</div><div> KSP Object: 1 MPI processes</div><div> type: gmres</div><div> GMRES: restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement</div><div> GMRES: happy breakdown tolerance 1e-30</div><div> maximum iterations=10000, initial guess is zero</div><div> tolerances: relative=1e-05, absolute=1e-50, divergence=10000</div><div> left preconditioning</div><div> using PRECONDITIONED norm type for convergence test</div><div> PC Object: 1 MPI processes</div><div> type: ilu</div><div> ILU: out-of-place factorization</div><div> 0 levels of fill</div><div> tolerance for zero pivot 2.22045e-14</div><div> using diagonal shift on blocks to prevent zero pivot [INBLOCKS]</div><div> matrix ordering: natural</div><div> factor fill ratio given 1, needed 1</div><div> Factored matrix follows:</div><div> Mat Object: 1 MPI processes</div><div> type: seqaij</div><div> rows=1, cols=1</div><div> package used to perform factorization: petsc</div><div> total: nonzeros=1, allocated nonzeros=1</div><div> total number of mallocs used during MatSetValues calls =0</div><div> not using I-node routines</div><div> linear system matrix = precond matrix:</div><div> Mat Object: 1 MPI processes</div><div> type: seqaij</div><div> rows=1, cols=1</div><div> total: nonzeros=1, allocated nonzeros=5</div><div> total number of mallocs used during MatSetValues calls =0</div><div> not using I-node routines</div><div>steps 7 (0 rejected, 0 SNES fails), ftime 0.010924, nonlinits 7, linits 7</div><div>step 7 t=1.09239877e-02 h= 2.13e-03 |x|= 1.03e-01 |x_e|= 1.03e-01 |x-x_e|= 7.93e-04</div></div></div><div><br></div><div>Is there an option to ensure that the TS doesn't overshoot the final time?</div><div><br></div><div>Thanks,</div><div>Gautam.</div></div>