<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">While there is a ~3.5X speedup, deleting the aforementioned 20 lines also leads the new version of petsc to give the wrong solution (off by orders of magnitude for the same program). <br><br></div><div>I tried switching over the the IFunction/IJacobian interface as per the manual (page 146) which the following lines :<br>```<br>TSSetProblemType(ts,TSLINEAR);<br>TSSetRHSFunction(ts,NULL,TSComputeRHSFunctionLinear,NULL);<br>TSSetRHSJacobian(ts,A,A,TSComputeRHSJacobianConstant,NULL);<br>```<br></div><div>are equivalent to :<br></div><div>```<br>TSSetProblemType(ts,TSLINEAR);<br>TSSetIFunction(ts,NULL,TSComputeIFunctionLinear,NULL);<br>TSSetIJacobian(ts,A,A,TSComputeIJacobianConstant,NULL);<br>```<br></div>But the example at src/ts/examples/tutorials/ex3.c employs a strategy of setting a shift flag to prevent re-computation for time-independent problems. Moreover, the docs say "using this function (TSComputeIFunctionLinear) is NOT equivalent to using TSComputeRHSFunctionLinear()" and now I'm even more confused.<br clear="all"></div><div dir="ltr"><br></div><div>PS : Doing the simple switch is as slow as the original code and the answer is wrong as well. <br></div><div dir="ltr"><br></div><div>Thank You,<br></div><div dir="ltr" class="gmail-m_6290488874186853915gmail-m_1389765672258582734gmail-m_6483013226690558604gmail_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></div></div></div>