Addressed PR comments

This commit is contained in:
Adam Nelson 2015-10-07 20:06:44 -04:00
parent d462a1717e
commit 01cf738f12
7 changed files with 46 additions and 46 deletions

View file

@ -1266,58 +1266,65 @@ The ``<tally>`` element accepts the following sub-elements:
:mu:
A monotonically increasing list of bounding **post-collision**
cosines of the change in a particle's angle (i.e., :math:`\mu`),
which represents a portion of the possible values of :math:`\[-1,1\]`.
For example, spanning all of :math:`\[-1,1\]` with five equi-width
cosines of the change in a particle's angle (i.e.,
:math:`\mu = \cos(\Omega \cdot \Omega')`),
which represents a portion of the possible values of :math:`[-1,1]`.
For example, spanning all of :math:`[-1,1]` with five equi-width
bins can be specified as:
.. code-block :: xml
``<filter type="mu" bins="-1.0 -0.6 -0.2 0.2 0.6 1.0" />``
.. code-block:: xml
<filter type="mu" bins="-1.0 -0.6 -0.2 0.2 0.6 1.0" />
Alternatively, if only one value is provided as a bin, OpenMC will
interpret this to mean the complete range of :math:`\[-1,1\]` should
interpret this to mean the complete range of :math:`[-1,1]` should
be automatically subdivided in to the provided value for the bin.
That is, the above example of five equi-width bins spanning
:math:`\[-1,1\]` can be instead written as:
:math:`[-1,1]` can be instead written as:
.. code-block :: xml
``<filter type="mu" bins="5" />``.
.. code-block:: xml
<filter type="mu" bins="5" />
:polar:
A monotonically increasing list of bounding particle polar angles
which represents a portion of the possible values of :math:`\[0,\pi\]`.
For example, spanning all of :math:`\[0,\pi\]` with five equi-width
which represents a portion of the possible values of :math:`[0,\pi]`.
For example, spanning all of :math:`[0,\pi]` with five equi-width
bins can be specified as:
.. code-block :: xml
``<filter type="polar" bins="0.0 0.6283 1.2566 1.8850 2.5132 3.1416"/>``
.. code-block:: xml
<filter type="polar" bins="0.0 0.6283 1.2566 1.8850 2.5132 3.1416"/>
Alternatively, if only one value is provided as a bin, OpenMC will
interpret this to mean the complete range of :math:`\[0,\pi\]` should
interpret this to mean the complete range of :math:`[0,\pi]` should
be automatically subdivided in to the provided value for the bin.
That is, the above example of five equi-width bins spanning
:math:`\[0,\pi\]` can be instead written as:
:math:`[0,\pi]` can be instead written as:
.. code-block :: xml
``<filter type="polar" bins="5" />``.
.. code-block:: xml
<filter type="polar" bins="5" />
:azimuthal:
A monotonically increasing list of bounding particle azimuthal angles
which represents a portion of the possible values of :math:`\[-\pi,\pi\)`.
For example, spanning all of :math:`\[-\pi,\pi\)` with two equi-width
which represents a portion of the possible values of :math:`[-\pi,\pi)`.
For example, spanning all of :math:`[-\pi,\pi)` with two equi-width
bins can be specified as:
.. code-block :: xml
``<filter type="azimuthal" bins="0.0 3.1416 6.2832" />``
.. code-block:: xml
<filter type="azimuthal" bins="0.0 3.1416 6.2832" />
Alternatively, if only one value is provided as a bin, OpenMC will
interpret this to mean the complete range of :math:`\[-\pi,\pi\)` should
interpret this to mean the complete range of :math:`[-\pi,\pi)` should
be automatically subdivided in to the provided value for the bin.
That is, the above example of five equi-width bins spanning
:math:`\[-\pi,\pi\)` can be instead written as:
:math:`[-\pi,\pi)` can be instead written as:
.. code-block :: xml
``<filter type="azimuthal" bins="2" />``.
.. code-block:: xml
<filter type="azimuthal" bins="2" />
:mesh:
The ``id`` of a structured mesh to be tallied over.

View file

@ -1268,7 +1268,7 @@ class Tally(object):
elif 'energy' in filter.type:
bins = filter.bins
# Create strings for
# Create strings for dataFrame rows
template = '{0:.1e} - {1:.1e}'
filter_bins = []
for i in range(filter.num_bins):
@ -1284,13 +1284,13 @@ class Tally(object):
elif filter.type in ['mu', 'polar', 'azimuthal']:
bins = filter.bins
# Create strings for
# Create strings for dataFrame rows
template = '{0:1.2f} - {1:1.2f}'
filter_bins = []
for i in range(filter.num_bins):
filter_bins.append(template.format(bins[i], bins[i+1]))
# Tile the mu bins into a DataFrame column
# Tile the bins into a DataFrame column
filter_bins = np.repeat(filter_bins, filter.stride)
tile_factor = data_size / len(filter_bins)
filter_bins = np.tile(filter_bins, tile_factor)

View file

@ -2434,10 +2434,9 @@ contains
! Determine number of bins
if (check_for_node(node_filt, "bins")) then
if ((temp_str == 'energy' .or. &
temp_str == 'energyout') .or. &
(temp_str == 'mu' .or. temp_str == 'polar') .or. &
(temp_str == 'azimuthal')) then
if (temp_str == 'energy' .or. temp_str == 'energyout' .or. &
temp_str == 'mu' .or. temp_str == 'polar' .or. &
temp_str == 'azimuthal') then
n_words = get_arraysize_double(node_filt, "bins")
else
n_words = get_arraysize_integer(node_filt, "bins")
@ -2650,7 +2649,8 @@ contains
call get_node_array(node_filt, "bins", t % filters(j) % real_bins)
! Allow a user to input a lone number which will mean that
! you subivide [0,2pi] evenly with the input being the number of bins
! you sub-divide [-pi,pi) evenly with the input being the number of
! bins
if (n_words == 1) then
Nangle = int(t % filters(j) % real_bins(1))
if (Nangle > 1) then

View file

@ -387,13 +387,6 @@ contains
end if
! ! Check p % mu to ensure it falls within the expected range
! if (p % mu < -ONE) then
! p % mu = -ONE
! else if (p % mu > ONE) then
! p % mu = ONE
! end if
! Set event component
p % event = EVENT_SCATTER

View file

@ -21,7 +21,7 @@ class FilterAzimuthalTestHarness(PyAPITestHarness):
tally2.add_score('flux')
tally2.estimator = 'analog'
filt3 = openmc.Filter(type='azimuthal', bins=(5))
filt3 = openmc.Filter(type='azimuthal', bins=(5,))
tally3 = openmc.Tally(tally_id=3)
tally3.add_filter(filt3)
tally3.add_score('flux')
@ -31,7 +31,7 @@ class FilterAzimuthalTestHarness(PyAPITestHarness):
mesh.lower_left = [-182.07, -182.07]
mesh.upper_right = [182.07, 182.07]
mesh.dimension = [2, 2]
filt_mesh = openmc.Filter(type='mesh', bins=(1))
filt_mesh = openmc.Filter(type='mesh', bins=(1,))
tally4 = openmc.Tally(tally_id=4)
tally4.add_filter(filt3)
tally4.add_filter(filt_mesh)

View file

@ -16,7 +16,7 @@ class FilterMuTestHarness(PyAPITestHarness):
tally1.add_score('scatter')
tally1.add_score('nu-scatter')
filt2 = openmc.Filter(type='mu', bins=(5))
filt2 = openmc.Filter(type='mu', bins=(5,))
tally2 = openmc.Tally(tally_id=2)
tally2.add_filter(filt2)
tally2.add_score('scatter')
@ -26,7 +26,7 @@ class FilterMuTestHarness(PyAPITestHarness):
mesh.lower_left = [-182.07, -182.07]
mesh.upper_right = [182.07, 182.07]
mesh.dimension = [2, 2]
filt_mesh = openmc.Filter(type='mesh', bins=(1))
filt_mesh = openmc.Filter(type='mesh', bins=(1,))
tally3 = openmc.Tally(tally_id=3)
tally3.add_filter(filt2)
tally3.add_filter(filt_mesh)

View file

@ -21,7 +21,7 @@ class FilterPolarTestHarness(PyAPITestHarness):
tally2.add_score('flux')
tally2.estimator = 'analog'
filt3 = openmc.Filter(type='polar', bins=(5))
filt3 = openmc.Filter(type='polar', bins=(5,))
tally3 = openmc.Tally(tally_id=3)
tally3.add_filter(filt3)
tally3.add_score('flux')
@ -31,7 +31,7 @@ class FilterPolarTestHarness(PyAPITestHarness):
mesh.lower_left = [-182.07, -182.07]
mesh.upper_right = [182.07, 182.07]
mesh.dimension = [2, 2]
filt_mesh = openmc.Filter(type='mesh', bins=(1))
filt_mesh = openmc.Filter(type='mesh', bins=(1,))
tally4 = openmc.Tally(tally_id=4)
tally4.add_filter(filt3)
tally4.add_filter(filt_mesh)