Skip to content

Commit 441bca9

Browse files
committed
Move pivot into the VODE state
1 parent a4d7ab4 commit 441bca9

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

integration/VODE/vode_dvjac.H

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
#include <integrator_rhs_simplified_sdc.H>
1313
#endif
1414

15-
template <typename IArray1D, typename BurnT, typename DvodeT>
15+
template <typename BurnT, typename DvodeT>
1616
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
17-
void dvjac (IArray1D& pivot, int& IERPJ, BurnT& state, DvodeT& vstate)
17+
void dvjac (int& IERPJ, BurnT& state, DvodeT& vstate)
1818
{
1919
// dvjac is called by dvnlsd to compute and process the matrix
2020
// P = I - h*rl1*J , where J is an approximation to the Jacobian
@@ -169,11 +169,10 @@ void dvjac (IArray1D& pivot, int& IERPJ, BurnT& state, DvodeT& vstate)
169169
int IER;
170170

171171
#ifdef NEW_NETWORK_IMPLEMENTATION
172-
amrex::ignore_unused(pivot);
173172
RHS::dgefa(vstate.jac);
174173
IER = 0;
175174
#else
176-
dgefa<int_neqs>(vstate.jac, pivot, IER);
175+
dgefa<int_neqs>(vstate.jac, vstate.pivot, IER);
177176
#endif
178177

179178
if (IER != 0) {

integration/VODE/vode_dvnlsd.H

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
#endif
88
#include <vode_dvjac.H>
99

10-
template <typename IArray1D, typename BurnT, typename DvodeT>
10+
template <typename BurnT, typename DvodeT>
1111
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
12-
Real dvnlsd (IArray1D& pivot, int& NFLAG, BurnT& state, DvodeT& vstate)
12+
Real dvnlsd (int& NFLAG, BurnT& state, DvodeT& vstate)
1313
{
1414
constexpr int int_neqs = integrator_neqs<BurnT>();
1515

@@ -76,7 +76,7 @@ Real dvnlsd (IArray1D& pivot, int& NFLAG, BurnT& state, DvodeT& vstate)
7676
// to 0 as an indicator that this has been done.
7777

7878
int IERPJ;
79-
dvjac(pivot, IERPJ, state, vstate);
79+
dvjac(IERPJ, state, vstate);
8080
vstate.IPUP = 0;
8181
vstate.RC = 1.0_rt;
8282
vstate.DRC = 0.0_rt;
@@ -114,7 +114,7 @@ Real dvnlsd (IArray1D& pivot, int& NFLAG, BurnT& state, DvodeT& vstate)
114114
#ifdef NEW_NETWORK_IMPLEMENTATION
115115
RHS::dgesl(vstate.jac, vstate.y);
116116
#else
117-
dgesl<int_neqs>(vstate.jac, pivot, vstate.y);
117+
dgesl<int_neqs>(vstate.jac, vstate.pivot, vstate.y);
118118
#endif
119119

120120
if (vstate.RC != 1.0_rt) {

integration/VODE/vode_dvstep.H

+1-3
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ int dvstep (BurnT& state, DvodeT& vstate)
132132

133133
}
134134

135-
Array1D<short, 1, int_neqs> pivot;
136-
137135
// Compute the predicted values by effectively
138136
// multiplying the yh array by the Pascal triangle matrix.
139137
// dvset is called to calculate all integration coefficients.
@@ -174,7 +172,7 @@ int dvstep (BurnT& state, DvodeT& vstate)
174172

175173
// Call the nonlinear system solver.
176174

177-
Real ACNRM = dvnlsd(pivot, NFLAG, state, vstate);
175+
Real ACNRM = dvnlsd(NFLAG, state, vstate);
178176

179177
if (NFLAG != 0) {
180178

integration/VODE/vode_type.H

+2
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ struct dvode_t
159159

160160
Array1D<Real, 1, int_neqs> ewt, savf;
161161

162+
Array1D<short, 1, int_neqs> pivot;
163+
162164
// Array of size NEQ used for the accumulated corrections on each
163165
// step, scaled in the output to represent the estimated local
164166
// error in Y on the last step. This is the vector e in the

0 commit comments

Comments
 (0)