mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
adding back files to be reviewed
This commit is contained in:
parent
ae28233110
commit
bc09d1ef55
1244 changed files with 301904 additions and 0 deletions
31
tests/regression_tests/sourcepoint_batch/test.py
Normal file
31
tests/regression_tests/sourcepoint_batch/test.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import glob
|
||||
|
||||
from openmc import StatePoint
|
||||
|
||||
from tests.testing_harness import TestHarness
|
||||
|
||||
|
||||
class SourcepointTestHarness(TestHarness):
|
||||
def _test_output_created(self):
|
||||
"""Make sure statepoint files have been created."""
|
||||
statepoint = glob.glob('statepoint.*.h5')
|
||||
assert len(statepoint) == 5, 'Five statepoint files must exist.'
|
||||
|
||||
def _get_results(self):
|
||||
"""Digest info in the statepoint and return as a string."""
|
||||
# Get the eigenvalue information.
|
||||
outstr = TestHarness._get_results(self)
|
||||
|
||||
# Read the statepoint file.
|
||||
with StatePoint(self._sp_name) as sp:
|
||||
# Add the source information.
|
||||
xyz = sp.source[0]['r']
|
||||
outstr += ' '.join(['{0:12.6E}'.format(x) for x in xyz])
|
||||
outstr += "\n"
|
||||
|
||||
return outstr
|
||||
|
||||
|
||||
def test_sourcepoint_batch():
|
||||
harness = SourcepointTestHarness('statepoint.08.h5')
|
||||
harness.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue