mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Corrected tests for fixed_source particle restarts
This commit is contained in:
parent
9cffc4a892
commit
884fcac846
3 changed files with 8 additions and 8 deletions
|
|
@ -10,7 +10,7 @@ import particle_restart as pr
|
|||
if len(sys.argv) > 1:
|
||||
p = pr.Particle(sys.argv[1])
|
||||
else:
|
||||
p = pr.Particle('particle_12_556.binary')
|
||||
p = pr.Particle('particle_12_192.binary')
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
|
|
|||
|
|
@ -3,14 +3,14 @@ current batch:
|
|||
current gen:
|
||||
1.000000E+00
|
||||
particle id:
|
||||
5.560000E+02
|
||||
1.920000E+02
|
||||
run mode:
|
||||
2.000000E+00
|
||||
particle weight:
|
||||
1.000000E+00
|
||||
particle energy:
|
||||
1.691175E+00
|
||||
3.643953E+00
|
||||
particle xyz:
|
||||
-3.806864E+01 6.026401E+01 1.932278E+01
|
||||
-4.855597E+01 5.269521E+01 3.202196E+01
|
||||
particle uvw:
|
||||
4.129564E-01 -8.535159E-01 3.177696E-01
|
||||
-8.742346E-01 4.493061E-01 -1.839506E-01
|
||||
|
|
|
|||
|
|
@ -24,13 +24,13 @@ def test_run():
|
|||
assert returncode == 0, 'OpenMC did not exit successfully.'
|
||||
|
||||
def test_created_restart():
|
||||
particle = glob.glob(os.path.join(cwd, 'particle_12_556.*'))
|
||||
particle = glob.glob(os.path.join(cwd, 'particle_12_192.*'))
|
||||
assert len(particle) == 1, 'Either multiple or no particle restart files exist.'
|
||||
assert particle[0].endswith('binary') or \
|
||||
particle[0].endswith('h5'), 'Particle restart file not a binary or hdf5 file.'
|
||||
|
||||
def test_results():
|
||||
particle = glob.glob(os.path.join(cwd, 'particle_12_556.*'))
|
||||
particle = glob.glob(os.path.join(cwd, 'particle_12_192.*'))
|
||||
call(['python', 'results.py', particle[0]])
|
||||
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
|
||||
if not compare:
|
||||
|
|
@ -38,7 +38,7 @@ def test_results():
|
|||
assert compare, 'Results do not agree.'
|
||||
|
||||
def test_run_restart():
|
||||
particle = glob.glob(os.path.join(cwd, 'particle_12_556.*'))
|
||||
particle = glob.glob(os.path.join(cwd, 'particle_12_192.*'))
|
||||
proc = Popen([opts.exe, '-r', particle[0], cwd], stderr=STDOUT, stdout=PIPE)
|
||||
print(proc.communicate()[0])
|
||||
returncode = proc.returncode
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue