mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Allow tallies to be activated from C API (mostly for CMFD)
This commit is contained in:
parent
06161d1693
commit
39554e4614
4 changed files with 63 additions and 2 deletions
|
|
@ -164,6 +164,10 @@ def test_tally(capi_init):
|
|||
t.scores = new_scores
|
||||
assert t.scores == new_scores
|
||||
|
||||
assert not t.active
|
||||
t.active = True
|
||||
assert t.active
|
||||
|
||||
|
||||
def test_new_tally(capi_init):
|
||||
with pytest.raises(exc.AllocationError):
|
||||
|
|
@ -177,7 +181,7 @@ def test_new_tally(capi_init):
|
|||
|
||||
def test_tally_results(capi_run):
|
||||
t = openmc.capi.tallies[1]
|
||||
assert t.num_realizations == 5
|
||||
assert t.num_realizations == 10 # t was made active in test_tally
|
||||
assert np.all(t.mean >= 0)
|
||||
nonzero = (t.mean > 0.0)
|
||||
assert np.all(t.std_dev[nonzero] >= 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue