<div dir="ltr"><div><br></div><div>I was wondering if the following code in TSComputeRHSJacobian is correct when the user pass the reuse flag via TSRHSJacobianReuse</div><div><br></div><div><div> if (ts->rhsjacobian.time == t && (ts->problem_type == TS_LINEAR || (ts->rhsjacobian.Xid == Uid && ts->rhsjacobian.Xstate == Ustate)) && (rhsfunction != TSComputeRHSFunctionLinear)) {</div><div> PetscFunctionReturn(0);<br></div><div> }</div></div><div><br></div><div>Should the above code be replaced by the following?</div><div><br></div><div> if (ts->rhsjacobian.time == t && (ts->problem_type == TS_LINEAR || (ts->rhsjacobian.Xid == Uid && ts->rhsjacobian.Xstate == Ustate)) && (rhsfunction != TSComputeRHSFunctionLinear)) {</div><div> if (ts->rhsjacobian.reuse) {</div><div> ierr = MatShift(A,-ts->rhsjacobian.shift);CHKERRQ(ierr);</div><div> ierr = MatScale(A,1./ts->rhsjacobian.scale);CHKERRQ(ierr);</div><div> if (B && A != B) {</div><div> ierr = MatShift(B,-ts->rhsjacobian.shift);CHKERRQ(ierr);</div><div> ierr = MatScale(B,1./ts->rhsjacobian.scale);CHKERRQ(ierr);</div><div> }</div><div> ts->rhsjacobian.shift = 0;</div><div> ts->rhsjacobian.scale = 1.;</div><div> }</div><div> PetscFunctionReturn(0);</div><div> }</div><div><br></div><div><br></div>-- <br><div class="gmail_signature">Stefano</div>
</div>