Skip to content

Commit

Permalink
change to relying on the networks to do the zeroing
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Jul 30, 2024
1 parent c3f4ea3 commit 391ffcb
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 8 deletions.
2 changes: 0 additions & 2 deletions integration/integrator_rhs_sdc.H
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void jac (const amrex::Real time, BurnT& state, T& int_state, MatrixType& pd)
{

pd.zero();

// update rho, rho*u, ... in the burn_t state

update_density_in_time(time, state);
Expand Down
2 changes: 0 additions & 2 deletions integration/integrator_rhs_strang.H
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void jac ([[maybe_unused]] const amrex::Real time, BurnT& state, T& int_state, MatrixType& pd)
{

pd.zero();

// Only do the burn if the incoming temperature is within the temperature
// bounds. Otherwise set the Jacobian to zero and return.

Expand Down
2 changes: 2 additions & 0 deletions networks/CNO_He_burn/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -2808,6 +2808,8 @@ void actual_jac(const burn_t& state, MatrixType& jac)
}


jac.zero();

rate_derivs_t rate_eval;

constexpr int do_T_derivatives = 1;
Expand Down
2 changes: 2 additions & 0 deletions networks/CNO_extras/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,8 @@ void actual_jac(const burn_t& state, MatrixType& jac)
}


jac.zero();

rate_derivs_t rate_eval;

constexpr int do_T_derivatives = 1;
Expand Down
2 changes: 2 additions & 0 deletions networks/ECSN/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,8 @@ void actual_jac(const burn_t& state, MatrixType& jac)
}


jac.zero();

rate_derivs_t rate_eval;

constexpr int do_T_derivatives = 1;
Expand Down
2 changes: 2 additions & 0 deletions networks/He-C-Fe-group/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -2945,6 +2945,8 @@ void actual_jac(const burn_t& state, MatrixType& jac)
}


jac.zero();

rate_derivs_t rate_eval;

constexpr int do_T_derivatives = 1;
Expand Down
2 changes: 2 additions & 0 deletions networks/ase/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -1716,6 +1716,8 @@ void actual_jac(const burn_t& state, MatrixType& jac)
}


jac.zero();

rate_derivs_t rate_eval;

constexpr int do_T_derivatives = 1;
Expand Down
2 changes: 2 additions & 0 deletions networks/ignition_reaclib/C-burn-simple/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ void actual_jac(const burn_t& state, MatrixType& jac)
}


jac.zero();

rate_derivs_t rate_eval;

constexpr int do_T_derivatives = 1;
Expand Down
2 changes: 2 additions & 0 deletions networks/ignition_reaclib/URCA-medium/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,8 @@ void actual_jac(const burn_t& state, MatrixType& jac)
}


jac.zero();

rate_derivs_t rate_eval;

constexpr int do_T_derivatives = 1;
Expand Down
2 changes: 2 additions & 0 deletions networks/ignition_reaclib/URCA-simple/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,8 @@ void actual_jac(const burn_t& state, MatrixType& jac)
}


jac.zero();

rate_derivs_t rate_eval;

constexpr int do_T_derivatives = 1;
Expand Down
2 changes: 2 additions & 0 deletions networks/nova/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,8 @@ void actual_jac(const burn_t& state, MatrixType& jac)
}


jac.zero();

rate_derivs_t rate_eval;

constexpr int do_T_derivatives = 1;
Expand Down
2 changes: 2 additions & 0 deletions networks/nova2/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,8 @@ void actual_jac(const burn_t& state, MatrixType& jac)
}


jac.zero();

rate_derivs_t rate_eval;

constexpr int do_T_derivatives = 1;
Expand Down
2 changes: 2 additions & 0 deletions networks/partition_test/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ void actual_jac(const burn_t& state, MatrixType& jac)
}


jac.zero();

rate_derivs_t rate_eval;

constexpr int do_T_derivatives = 1;
Expand Down
2 changes: 2 additions & 0 deletions networks/sn160/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -19845,6 +19845,8 @@ void actual_jac(const burn_t& state, MatrixType& jac)
}


jac.zero();

rate_derivs_t rate_eval;

constexpr int do_T_derivatives = 1;
Expand Down
2 changes: 2 additions & 0 deletions networks/subch_base/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,8 @@ void actual_jac(const burn_t& state, MatrixType& jac)
}


jac.zero();

rate_derivs_t rate_eval;

constexpr int do_T_derivatives = 1;
Expand Down
2 changes: 2 additions & 0 deletions networks/subch_simple/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -1789,6 +1789,8 @@ void actual_jac(const burn_t& state, MatrixType& jac)
}


jac.zero();

rate_derivs_t rate_eval;

constexpr int do_T_derivatives = 1;
Expand Down
3 changes: 3 additions & 0 deletions networks/vode_example/actual_rhs.H
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ void actual_jac (burn_t& state, MatrixType& jac)
{
using namespace Species;

// initialize
jac.zero();

// carbon jacobian elements
jac(Y1, Y1) = -0.04_rt;
jac(Y1, Y2) = 1.e4_rt * state.xn[Y3-1];
Expand Down
7 changes: 3 additions & 4 deletions sphinx_docs/source/integrators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,10 @@ The form looks like:
A network is not required to provide a Jacobian if a numerical
Jacobian is used.

.. tip::
.. important::

It is not necessary to zero the Jacobian elements at the top of the
``actual_jac()`` function---this is handled by the wrapper that the
integrator calls.
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 391ffcb

Please sign in to comment.