<div dir="ltr"><div>Hi,<br><br></div>I wanted to ask a few questions about the TS example ex3.c when using the ifunc option <br><br><pre width="80"><a name="line190">190: </a>    <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/Mat.html#Mat">Mat</a> J;

<a name="line192">192: </a>    RHSMatrixHeat(ts,0.0,u,A,A,&appctx);
<a name="line193">193: </a>    <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatDuplicate.html#MatDuplicate">MatDuplicate</a>(A,<a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatDuplicateOption.html#MatDuplicateOption">MAT_DO_NOT_COPY_VALUES</a>,&J);
<a name="line194">194: </a>    <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSSetIFunction.html#TSSetIFunction">TSSetIFunction</a>(ts,NULL,IFunctionHeat,&appctx);
<a name="line195">195: </a>    <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/TS/TSSetIJacobian.html#TSSetIJacobian">TSSetIJacobian</a>(ts,J,J,IJacobianHeat,&appctx);
<a name="line196">196: </a>    <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatDestroy.html#MatDestroy">MatDestroy</a>(&J);

<a name="line198">198: </a>    <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscObjectReference.html#PetscObjectReference">PetscObjectReference</a>((<a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscObject.html#PetscObject">PetscObject</a>)A);
<a name="line199">199: </a>    appctx.A = A;
<a name="line200">200: </a>    appctx.oshift = PETSC_MIN_REAL;
<a name="line201">201: </a>  }<br><br><br></pre>1) When TSSetIJacobian is called on line 195, J is empty. Why is J deleted after calling the routing but before TSSolve is called ? (Isn't J supposed to hold the jacobian ? )<br><div><br></div><div>2) The shift is not calculated before calling TSSetIJacobian. Does this mean that the TSSetIJacobian takes care of the shift ?<br><br></div><div>3) What is happening on line 198 ?<br></div><div><div><br clear="all"><div><div><br></div><div>Thank You,<br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div style="font-size:12.8px">Sajid Ali<br></div><div style="font-size:12.8px">Applied Physics<br></div><div style="font-size:12.8px">Northwestern University</div></div></div></div></div></div></div></div>