<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 1, 2017 at 1:00 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
What are LandSNESFunction() and LandSNESJacobian()?<br></blockquote><div><br></div><div>These are the same methods that I give to TS (IFunction and IJacobian), except there is no mass matrix in IJacobian. What do I do here? I do not have a shift.</div><div><br></div><div>But I see that IFunction is not correct. I am solving du/dt - C(u) = 0. My IFunction applies C(u)*u, but LandSNESFunction should just return zero, maybe?</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Note that Picard<br>
<br>
Solves the equation A(x) x = b(x) via the defect correction algorithm A(x^{n}) (x^{n+1} - x^{n}) = b(x^{n}) - A(x^{n})x^{n}<br>
<br>
The functions you need to provide are (compute the vector) b(x) and (compute the matrix) A(x). A() is most definitely not the Jacobian of b(). To use Picard you have to rewrite the nonlinear equations that come out of the definition of the time-step in the form A(x) x = b(x). This may require additions to TS, I don't know.<br>
<span class="gmail-HOEnZb"><font color="#888888"><br>
Barry<br>
</font></span><div class="gmail-HOEnZb"><div class="gmail-h5"><br>
<br>
<br>
> On Jan 1, 2017, at 8:56 AM, Mark Adams <<a href="mailto:mfadams@lbl.gov">mfadams@lbl.gov</a>> wrote:<br>
><br>
> I tried using Picard inside of TS, and SNES diverged. Is this supposed to be possible? I tried to do do this by wrapping my operator in a SNES version and simply adding it like this.<br>
><br>
> Mark<br>
><br>
> ierr = TSSetIFunction(ts,NULL,<wbr>LandIFunction,ctx);CHKERRQ(<wbr>ierr);<br>
> ierr = TSSetIJacobian(ts,J,J,<wbr>LandIJacobian,ctx);CHKERRQ(<wbr>ierr);<br>
> SNES snes;<br>
> Vec vec;<br>
> ierr = VecDuplicate(uu,&vec);CHKERRQ(<wbr>ierr);<br>
> ierr = TSGetSNES(ts,&snes);CHKERRQ(<wbr>ierr);<br>
> ierr = SNESSetPicard(snes, vec, LandSNESFunction, J, J, LandSNESJacobian, ctx);CHKERRQ(ierr);<br>
><br>
<br>
</div></div></blockquote></div><br></div></div>