Skip to content

Commit

Permalink
updated docs to use IndependentSource
Browse files Browse the repository at this point in the history
  • Loading branch information
shimwell committed Jul 17, 2023
1 parent 3f9cd0d commit 0d5b7d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions docs/source/usersguide/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ distributed over a cube centered at the origin with an edge length of 10 cm, and
emitting a pulse of particles from 0 to 10 µs, one
would run::

source = openmc.Source()
source = openmc.IndependentSource()
source.space = openmc.stats.Box((-5, -5, -5), (5, 5, 5))
source.angle = openmc.stats.Isotropic()
source.energy = openmc.stats.Discrete([10.0e6], [1.0])
Expand All @@ -237,11 +237,11 @@ that indicates the relative strength of a source distribution if multiple are
used. For example, to create two sources, one that should be sampled 70% of the
time and another that should be sampled 30% of the time::

src1 = openmc.Source()
src1 = openmc.IndependentSource()
src1.strength = 0.7
...

src2 = openmc.Source()
src2 = openmc.IndependentSource()
src2.strength = 0.3
...

Expand All @@ -251,7 +251,7 @@ Finally, the :attr:`Source.particle` attribute can be used to indicate the
source should be composed of particles other than neutrons. For example, the
following would generate a photon source::

source = openmc.Source()
source = openmc.IndependentSource()
source.particle = 'photon'
...

Expand All @@ -266,7 +266,7 @@ File-based Sources
OpenMC can use a pregenerated HDF5 source file by specifying the ``filename``
argument to :class:`openmc.Source`::

settings.source = openmc.Source(filename='source.h5')
settings.source = openmc.IndependentSource(filename='source.h5')

Statepoint and source files are generated automatically when a simulation is run
and can be used as the starting source in a new simulation. Alternatively, a
Expand Down
2 changes: 1 addition & 1 deletion tests/regression_tests/pulse_height/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def sphere_model():
model.settings.batches = 5
model.settings.particles = 100
model.settings.photon_transport = True
model.settings.source = openmc.Source(space=openmc.stats.Point(),
model.settings.source = openmc.IndependentSource(space=openmc.stats.Point(),
energy=openmc.stats.Discrete([1e6],[1]),
particle='photon')

Expand Down

0 comments on commit 0d5b7d2

Please sign in to comment.