OK. Thank you.<br><br><div class="gmail_quote">On Mon, Jun 4, 2012 at 3:04 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div class="im">On Mon, Jun 4, 2012 at 1:41 AM, behzad baghapour <span dir="ltr"><<a href="mailto:behzad.baghapour@gmail.com" target="_blank">behzad.baghapour@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
According to my last question, I am trying to use Shell to handle the MatrixFree procedure as below:<br><br>1- Define residual as: <br>       F := M * DQ/Dt - R(Q) (R is the nonlinear residual obtained from discretization)<br>


2- MatCreateShell<br>3- MatShellSetOperation -> MATOP_MULT as follows:<br>       dF/dQ * v = M * v / Dt - ( R(Q+eps*v) - R(Q) ) / eps<br>4- Using this operation in each step of KSP (GMRES) subspace construction. <br><br>


Does the above procedure seem reasonable to use with SNES? Please help me if it needs more considerations.<br></blockquote><div><br></div></div><div>You can just set the SNES function and do -snes_mf, then this will be done for you.</div>

<div><br></div><div>You might also consider using TS. TSSetIFunction() is the interface you propose.</div></div>
</blockquote></div><br>