Skip to content

Commit

Permalink
only zero the Jacobian once (#1636)
Browse files Browse the repository at this point in the history
now it is the role of the jac() wrapper to zero the analytic Jacobian.
The networks can assume that it is zero.  Previously both VODE
and the network were doing the zeroing, which was redundant.
  • Loading branch information
zingale authored Aug 5, 2024
1 parent 115aec8 commit 8ce3375
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 0 additions & 3 deletions integration/VODE/vode_dvjac.H
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ void dvjac (int& IERPJ, BurnT& state, DvodeT& vstate)
// Indicate that the Jacobian is current for this solve.
vstate.JCUR = 1;

// Initialize the Jacobian to zero
vstate.jac.zero();

jac(vstate.tn, state, vstate, vstate.jac);

#ifdef ALLOW_JACOBIAN_CACHING
Expand Down
5 changes: 5 additions & 0 deletions sphinx_docs/source/integrators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ The form looks like:
A network is not required to provide a Jacobian if a numerical
Jacobian is used.

.. important::

The integrator does not zero the Jacobian elements. It is the responsibility
of the Jacobian implementation to zero the Jacobian array if necessary.


Jacobian wrapper
^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit 8ce3375

Please sign in to comment.