mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Set correct index for final nuclides in restart tests
Many repetitions of the following change:
- assert y1[3] == approx(s2[0])
- assert y2[3] == approx(s2[1])
+ assert y1[2] == approx(s2[0])
+ assert y2[2] == approx(s2[1])
This causes many of the restart tests to fail, because all
schemes but the predictor save repeated data under restart conditions.
Performing one normal depletion event, non-restarted, and then
one restart event, as these tests do, should produce vectors for
time and densities like:
t = [t0, t1, t2]
a = [a0, a1, a2]
| ^ after restart
^ non-restart run
With this, the current tests would fail due to an IndexError, as
the atom vectors should only have three elements. Instead,
non-predictor schemes return vectors
t = [t0, t1, t1, t2]
a = [a0, a1, a1, a2]
and one can access a[3] to obtain the desired EOS concentrations.
This commit is contained in:
parent
1f3e7fdac1
commit
d5fa7b5c00
1 changed files with 14 additions and 14 deletions
|
|
@ -90,8 +90,8 @@ def test_restart_cecm(run_in_tmpdir):
|
|||
assert y1[1] == approx(s1[0])
|
||||
assert y2[1] == approx(s1[1])
|
||||
|
||||
assert y1[3] == approx(s2[0])
|
||||
assert y2[3] == approx(s2[1])
|
||||
assert y1[2] == approx(s2[0])
|
||||
assert y2[2] == approx(s2[1])
|
||||
|
||||
|
||||
def test_restart_predictor_cecm(run_in_tmpdir):
|
||||
|
|
@ -211,8 +211,8 @@ def test_restart_cf4(run_in_tmpdir):
|
|||
assert y1[1] == approx(s1[0])
|
||||
assert y2[1] == approx(s1[1])
|
||||
|
||||
assert y1[3] == approx(s2[0])
|
||||
assert y2[3] == approx(s2[1])
|
||||
assert y1[2] == approx(s2[0])
|
||||
assert y2[2] == approx(s2[1])
|
||||
|
||||
|
||||
def test_restart_epc_rk4(run_in_tmpdir):
|
||||
|
|
@ -250,8 +250,8 @@ def test_restart_epc_rk4(run_in_tmpdir):
|
|||
assert y1[1] == approx(s1[0])
|
||||
assert y2[1] == approx(s1[1])
|
||||
|
||||
assert y1[3] == approx(s2[0])
|
||||
assert y2[3] == approx(s2[1])
|
||||
assert y1[2] == approx(s2[0])
|
||||
assert y2[2] == approx(s2[1])
|
||||
|
||||
|
||||
def test_restart_celi(run_in_tmpdir):
|
||||
|
|
@ -289,8 +289,8 @@ def test_restart_celi(run_in_tmpdir):
|
|||
assert y1[1] == approx(s1[0])
|
||||
assert y2[1] == approx(s1[1])
|
||||
|
||||
assert y1[3] == approx(s2[0])
|
||||
assert y2[3] == approx(s2[1])
|
||||
assert y1[2] == approx(s2[0])
|
||||
assert y2[2] == approx(s2[1])
|
||||
|
||||
|
||||
def test_restart_leqi(run_in_tmpdir):
|
||||
|
|
@ -328,8 +328,8 @@ def test_restart_leqi(run_in_tmpdir):
|
|||
assert y1[1] == approx(s1[0])
|
||||
assert y2[1] == approx(s1[1])
|
||||
|
||||
assert y1[3] == approx(s2[0])
|
||||
assert y2[3] == approx(s2[1])
|
||||
assert y1[2] == approx(s2[0])
|
||||
assert y2[2] == approx(s2[1])
|
||||
|
||||
def test_restart_si_celi(run_in_tmpdir):
|
||||
"""Integral regression test of integrator algorithm using SI-CELI."""
|
||||
|
|
@ -366,8 +366,8 @@ def test_restart_si_celi(run_in_tmpdir):
|
|||
assert y1[1] == approx(s1[0])
|
||||
assert y2[1] == approx(s1[1])
|
||||
|
||||
assert y1[3] == approx(s2[0])
|
||||
assert y2[3] == approx(s2[1])
|
||||
assert y1[2] == approx(s2[0])
|
||||
assert y2[2] == approx(s2[1])
|
||||
|
||||
|
||||
def test_restart_si_leqi(run_in_tmpdir):
|
||||
|
|
@ -406,5 +406,5 @@ def test_restart_si_leqi(run_in_tmpdir):
|
|||
assert y1[1] == approx(s1[0])
|
||||
assert y2[1] == approx(s1[1])
|
||||
|
||||
assert y1[3] == approx(s2[0])
|
||||
assert y2[3] == approx(s2[1])
|
||||
assert y1[2] == approx(s2[0])
|
||||
assert y2[2] == approx(s2[1])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue