<div dir="ltr">Hi Jed,<div><br></div><div>I added a third specie to my problem (step by step :-)).</div><div><br></div><div>Now my system is the following:</div><div><br></div><div>u_t - alpha u_xx +(k.u.v - q.w) = 0</div>


<div>v_t - beta v_xx +(k.u.v - q.w) = 0</div><div>w_t -(k.u.v - q.w) = 0</div><div><br></div><div><br></div><div>So I have 2 PDEs and 1 ODE. I put everything under IFunction and IJacobian.</div><div>For the PDEs I defined Dirichlet boundary conditions.</div>


<div><br></div><div>For this simple system, I have lot of problems, it does not converge.<br></div><div><br></div><div>I followed your suggestions and I removed any options from the code, and put TSSetFromOptions(); at the end.</div>

<div>The default options are thus SNESNEWTONLS, KSPGMRES, LineSearch bt, ARKIMEX 3.</div>
<div><br></div><div>I obtain the following output:</div><div><br></div><div><div>      TSAdapt 'basic': step 101 accepted t=1.07438    + 3.223e-01 wlte=    0 family='arkimex' scheme=0:'3' dt=4.190e-01 </div>


<div>      TSAdapt 'basic': step 102 accepted t=1.39669    + 4.190e-01 wlte=5.21e-13 family='arkimex' scheme=0:'3' dt=5.447e-01 </div><div>      TSAdapt 'basic': step 103 accepted t=1.8157     + 5.447e-01 wlte=1.64e-13 family='arkimex' scheme=0:'3' dt=7.081e-01 </div>


<div>      TSAdapt 'basic': step 104 accepted t=2.36041    + 7.081e-01 wlte=5.62e-14 family='arkimex' scheme=0:'3' dt=9.206e-01 </div><div>      TSAdapt 'basic': step 105 stage rejected t=3.06853    + 9.206e-01, 1 failures exceeds current TS allowed</div>


<div>[0]PETSC ERROR: --------------------- Error Message ------------------------------------</div><div>[0]PETSC ERROR:   !</div><div>[0]PETSC ERROR: TSStep has failed due to DIVERGED_NONLINEAR_SOLVE, increase -ts_max_snes_failures or make negative to attempt recovery!</div>


</div><div><br></div><div><br></div><div><br></div><div>ThenI increase the max number of failures. When I do so, I get the following error message:</div><div><br></div><div><div>      TSAdapt 'basic': step 101 accepted t=1.07438    + 3.223e-01 wlte=    0 family='arkimex' scheme=0:'3' dt=4.190e-01 </div>


<div>      TSAdapt 'basic': step 102 accepted t=1.39669    + 4.190e-01 wlte=5.21e-13 family='arkimex' scheme=0:'3' dt=5.447e-01 </div><div>      TSAdapt 'basic': step 103 accepted t=1.8157     + 5.447e-01 wlte=1.64e-13 family='arkimex' scheme=0:'3' dt=7.081e-01 </div>


<div>      TSAdapt 'basic': step 104 accepted t=2.36041    + 7.081e-01 wlte=5.62e-14 family='arkimex' scheme=0:'3' dt=9.206e-01 </div><div>      TSAdapt 'basic': step 105 stage rejected t=3.06853    + 9.206e-01 retrying with dt=2.301e-01 </div>


<div>      TSAdapt 'basic': step 105 stage rejected t=3.06853    + 2.301e-01 retrying with dt=5.753e-02 </div><div>      TSAdapt 'basic': step 105 stage rejected t=3.06853    + 5.753e-02 retrying with dt=1.438e-02 </div>


<div>      TSAdapt 'basic': step 105 stage rejected t=3.06853    + 1.438e-02 retrying with dt=3.596e-03 </div><div>      TSAdapt 'basic': step 105 stage rejected t=3.06853    + 3.596e-03 retrying with dt=8.990e-04 </div>


<div>      TSAdapt 'basic': step 105 stage rejected t=3.06853    + 8.990e-04 retrying with dt=2.247e-04 </div><div>      TSAdapt 'basic': step 105 stage rejected t=3.06853    + 2.247e-04 retrying with dt=5.619e-05 </div>


<div>      TSAdapt 'basic': step 105 stage rejected t=3.06853    + 5.619e-05 retrying with dt=1.405e-05 </div><div>     </div></div><div>...</div><div>...</div><div><div>      TSAdapt 'basic': step 105 stage rejected t=3.06853    +5.679e-179 retrying with dt=1.420e-179</div>


<div>      TSAdapt 'basic': step 105 stage rejected t=3.06853    +1.420e-179 retrying with dt=3.550e-180</div><div>      TSAdapt 'basic': step 105 stage rejected t=3.06853    +3.550e-180 retrying with dt=8.874e-181</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 15 is not-a-number or infinite at end of function: Parameter number 3!</div>


</div><div><br></div><div>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.</div><div><br></div><div>Any idea how to solve that ?</div>

<div>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:</div><div><br></div>
<div><i><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">Is your problem similar to ex25?  (If I remember</span><br style="font-family:arial,sans-serif;font-size:13.333333969116211px"><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">correctly, that example uses a </span><span class="" style="font-family:arial,sans-serif;font-size:13.333333969116211px">DAE</span><span style="font-family:arial,sans-serif;font-size:13.333333969116211px"> formulation for boundary conditions</span><br style="font-family:arial,sans-serif;font-size:13.333333969116211px">
<span style="font-family:arial,sans-serif;font-size:13.333333969116211px">and thus has trouble with some methods with explicit stages.  There may</span><br style="font-family:arial,sans-serif;font-size:13.333333969116211px">
<span style="font-family:arial,sans-serif;font-size:13.333333969116211px">be more going on.)</span></i></div><div><font face="arial, sans-serif"><i><br></i></font></div><div><span style="font-family:arial,sans-serif">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 ?</span><br>
</div><div><span style="font-family:arial,sans-serif">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.</span></div>
<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Thanks a lot in advance for your help.</font></div><div><font face="arial, sans-serif">Christophe<br></font><div class="gmail_extra">
<br></div></div></div>