[petsc-users] Strange behavior of TS after setting hand-coded Jacobian
Jed Brown
jed at jedbrown.org
Mon Nov 8 16:38:21 CST 2021
Barry Smith <bsmith at petsc.dev> writes:
> Note that you get the same result if you think of the problem as a DAE because the residual equation is R_{V_1} = V_1^{n+1} and the derivative of this with respect to V_1^{n+1} is 1 (not zero). So you still end up with a nonzero on the diagonal, not zero. Regardless, you can keep these rows in the ODE form right hand side and form Jacobian, or you can eliminate them (analytically as Hong suggested) so the ODE solver does not see these rows but in either case the results are identical.
This is a niche technical point, but these strategies (DAE versus ODE enforcement of boundary conditions) are not always equivalent. In particular, the DAE form can exhibit order reduction, meaning that you may observe a lower order of accuracy with this form of boundary conditions than with the ODE form.
More information about the petsc-users
mailing list