Skip to content

Commit 3169bfe

Browse files
authored
remove the is_jacobian_term_used logic in the linear algebra (#1502)
this was wrong, but turns out, it had no effect because of a bug in the logic of the is_jacobian_term_used. That issue is also fixed here, and the function is kept for use in the future. note: nets with one species that was not evolved will see a change here.
1 parent d7e5b84 commit 3169bfe

File tree

2 files changed

+18
-25
lines changed

2 files changed

+18
-25
lines changed

networks/rhs.H

+5-13
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ constexpr int is_jacobian_term_used ()
263263
}
264264
}
265265

266-
if (is_spec_1_used || is_spec_2_used) {
266+
if (is_spec_1_used && is_spec_2_used) {
267267
term_is_used = 1;
268268
}
269269
});
@@ -289,9 +289,7 @@ void dgesl (RArray2D& a1, RArray1D& b1)
289289
{
290290
constexpr int j = n2;
291291

292-
if (is_jacobian_term_used<j, k>()) {
293-
b(j) += t * a(j,k);
294-
}
292+
b(j) += t * a(j,k);
295293
});
296294
});
297295

@@ -305,9 +303,7 @@ void dgesl (RArray2D& a1, RArray1D& b1)
305303

306304
constexpr_for<0, k>([&] (auto j)
307305
{
308-
if (is_jacobian_term_used<j, k>()) {
309-
b(j) += t * a(j,k);
310-
}
306+
b(j) += t * a(j,k);
311307
});
312308
});
313309
}
@@ -329,9 +325,7 @@ void dgefa (RArray2D& a1)
329325
{
330326
[[maybe_unused]] constexpr int j = n2;
331327

332-
if (is_jacobian_term_used<j, k>()) {
333-
a(j,k) *= t;
334-
}
328+
a(j,k) *= t;
335329
});
336330

337331
// row elimination with column indexing
@@ -344,9 +338,7 @@ void dgefa (RArray2D& a1)
344338
{
345339
[[maybe_unused]] constexpr int i = n3;
346340

347-
if constexpr (is_jacobian_term_used<i, k>()) {
348-
a(i,j) += t * a(i,k);
349-
}
341+
a(i,j) += t * a(i,k);
350342
});
351343
});
352344
});
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
AMReX (23.07-7-g88f03408f18a-dirty) initialized
1+
Initializing AMReX (24.02-30-g2ecafcff4013)...
2+
AMReX (24.02-30-g2ecafcff4013) initialized
23
starting the single zone burn...
34
Maximum Time (s): 0.01585
45
State Density (g/cm^3): 1000000000
@@ -12,21 +13,21 @@ RHS at t = 0
1213
ash 0.01230280576
1314
------------------------------------
1415
successful? 1
15-
- Hnuc = 5.274803093e+17
16-
- added e = 8.360562902e+15
17-
- final T = 1433512646
16+
- Hnuc = 5.277406316e+17
17+
- added e = 8.364689011e+15
18+
- final T = 1433713029
1819
------------------------------------
1920
e initial = 1.253426044e+18
20-
e final = 1.261786607e+18
21+
e final = 1.261790733e+18
2122
------------------------------------
2223
new mass fractions:
23-
C12 0.9658063217
24-
O16 9.999999766e-31
25-
ash 0.03419367826
24+
C12 0.9657894807
25+
O16 1e-30
26+
ash 0.03421051932
2627
------------------------------------
2728
species creation rates:
28-
omegadot(C12): -2.157329859
29-
omegadot(O16): -1.476105976e-36
30-
omegadot(ash): 2.157329859
29+
omegadot(C12): -2.158392386
30+
omegadot(O16): 3.315374916e-44
31+
omegadot(ash): 2.158392386
3132
number of steps taken: 381
32-
AMReX (23.07-7-g88f03408f18a-dirty) finalized
33+
AMReX (24.02-30-g2ecafcff4013) finalized

0 commit comments

Comments
 (0)