Skip to content

Commit 8ce3375

Browse files
authored
only zero the Jacobian once (#1636)
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.
1 parent 115aec8 commit 8ce3375

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

integration/VODE/vode_dvjac.H

-3
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ void dvjac (int& IERPJ, BurnT& state, DvodeT& vstate)
7979
// Indicate that the Jacobian is current for this solve.
8080
vstate.JCUR = 1;
8181

82-
// Initialize the Jacobian to zero
83-
vstate.jac.zero();
84-
8582
jac(vstate.tn, state, vstate, vstate.jac);
8683

8784
#ifdef ALLOW_JACOBIAN_CACHING

sphinx_docs/source/integrators.rst

+5
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,11 @@ The form looks like:
276276
A network is not required to provide a Jacobian if a numerical
277277
Jacobian is used.
278278

279+
.. important::
280+
281+
The integrator does not zero the Jacobian elements. It is the responsibility
282+
of the Jacobian implementation to zero the Jacobian array if necessary.
283+
279284

280285
Jacobian wrapper
281286
^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)