<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 23, 2013 at 4:52 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">Christophe Ortiz <<a href="mailto:christophe.ortiz@ciemat.es">christophe.ortiz@ciemat.es</a>> writes:<br>

> I finally found what was wrong. I used -mat_view to check each element of<br>
> the Jacobian. The structure was ok but there was some unexpected values.<br>
> Then I checked my code and found a mistake while assigning values to some<br>
> array (the diagonal block). It was cumulating values during the loop for<br>
> (row i) {}. Now, at the beginning of the loop I use PetscMemzero(array) to<br>
> reset the array.<br>
><br>
> Now it works much better with 1bee and linesearch bt. It converges quickly<br>
> to large times in few timesteps.<br>
<br>
</div>That's reassuring to hear, thanks.<br>
<div class="im"><br>
> Nevertheless...I still observe some problem, some oscillations in the<br>
> solution, but in some extreme cases. It occurs with the following system,<br>
> when q is very large:<br>
><br>
> u_t - alpha u_xx + (k.u.v - q.w) = 0<br>
> v_t - alpha v_xx + (k.u.v - q.w) = 0<br>
> w_t - (k.u.v - q.w) = 0<br>
><br>
> I guess the problem becomes stiff.<br>
<br>
</div>Does a shorter time step fix the oscillations?</blockquote><div><br></div><div>Hi Jed,</div><div><br></div><div>Thanks for the prompt reply.</div><div><br></div><div>No, it did not in this case. However, I noticed for "smoother" cases that max timestep matters. I try to fix it to finaltime/100 to avoid too large timesteps. I also use -ts_adapt_basic_clip 0.1,1.1 to avoid large timesteps.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">  Is this with<br>
-ts_arkimex_type 1bee or something else?<br></blockquote><div><br></div><div>It occurs with 1bee, a2 or arkimex 3.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
Can you try -ts_arkimex_fully_implicit and add -snes_mf_operator if<br>
necessary to get SNES to converge?</blockquote><div><br></div><div><br></div><div>I tried -ts_arkimex_fully_implicit and it gave a wrong result. As if there was no diffusion. Seems there is an artefact with fullyimplicit option.</div>
<div><br></div><div>With -snes_mf_operator I got an error message:</div><div><div>[0]PETSC ERROR: No support for this operation for this object type!</div><div>[0]PETSC ERROR: Mat type mffd!</div></div><div><br></div><div>
 </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">  (I'm assuming you have used an IMEX<br>
formulation here, but perhaps you already use fully implicit?)<br></blockquote><div><br></div><div>I put everything under IFunction and IJacobian. This part is not clear to me actually. I understand that in IMEX methods, the LHS is solved implicitely and the RHS explicitely. What happens when I use an IMEX method with no RHS, everything in the LHS ? Is there any explicit stage ?</div>
<div><br></div><div>Actually, I could solve the problem by adding mesh points. Since I start from steep gaussian distributions with large peak values, maybe there was a problem with large gradients.</div><div><br></div><div>
BTW, is it possible to have adaptive mesh in 1D with PETSc ? I am thinking of steep profiles that evolve and that require a fine mesh at the beginning.</div><div><br></div><div>Christophe</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class=""><div class="h5"><br>
> I tried assuming that the reaction is in steady state (w_t=0) and modifying<br>
> the IJacobian accordingly, but it did not work.<br>
<br>
</div></div></blockquote></div><br></div></div>