Merge pull request #1890 from ojschumann/rational_dist

Rational univariate distribution
This commit is contained in:
Paul Romano 2021-10-12 22:26:02 -05:00 committed by GitHub
commit c2fe6327e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 234 additions and 8 deletions

View file

@ -42,6 +42,16 @@ def test_uniform():
assert t.p == [1/(b-a), 1/(b-a)]
assert t.interpolation == 'histogram'
def test_powerlaw():
a, b, n = 10.0, 20.0, 2.0
d = openmc.stats.PowerLaw(a, b, n)
elem = d.to_xml_element('distribution')
d = openmc.stats.PowerLaw.from_xml_element(elem)
assert d.a == a
assert d.b == b
assert d.n == n
assert len(d) == 3
def test_maxwell():
theta = 1.2895e6