mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
test spherical_uniform
This commit is contained in:
parent
f1f215bdbb
commit
86ec0658c5
1 changed files with 18 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import openmc
|
||||
import openmc.stats
|
||||
|
||||
from math import pi, cos
|
||||
|
||||
def test_source():
|
||||
space = openmc.stats.Point()
|
||||
|
|
@ -26,6 +26,22 @@ def test_source():
|
|||
assert src.strength == 1.0
|
||||
|
||||
|
||||
def test_spherical_uniform():
|
||||
r_outer = 2.0
|
||||
r_inner = 1.0
|
||||
thetas = (0.0, pi/2)
|
||||
phis = (0.0, pi)
|
||||
origin = (0.0, 1.0, 2.0)
|
||||
|
||||
sph_indep_function = openmc.stats.spherical_uniform(r_outer,
|
||||
r_inner,
|
||||
thetas,
|
||||
phis,
|
||||
origin)
|
||||
|
||||
assert isinstance(sph_indep_function, openmc.stats.SphericalIndependent)
|
||||
|
||||
|
||||
def test_source_file():
|
||||
filename = 'source.h5'
|
||||
src = openmc.Source(filename=filename)
|
||||
|
|
@ -35,6 +51,7 @@ def test_source_file():
|
|||
assert 'strength' in elem.attrib
|
||||
assert 'file' in elem.attrib
|
||||
|
||||
|
||||
def test_source_dlopen():
|
||||
library = './libsource.so'
|
||||
src = openmc.Source(library=library)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue