diff --git a/docs/source/io_formats/statepoint.rst b/docs/source/io_formats/statepoint.rst index b0321814f9..f0f2af59b2 100644 --- a/docs/source/io_formats/statepoint.rst +++ b/docs/source/io_formats/statepoint.rst @@ -4,7 +4,7 @@ State Point File Format ======================= -The current version of the statepoint file format is 16.0. +The current version of the statepoint file format is 17.0. **/** diff --git a/docs/source/io_formats/tallies.rst b/docs/source/io_formats/tallies.rst index 89468396e9..9c0a2515e1 100644 --- a/docs/source/io_formats/tallies.rst +++ b/docs/source/io_formats/tallies.rst @@ -18,8 +18,8 @@ filters can be used for a tally. The following types of filter are available: cell, universe, material, surface, birth region, pre-collision energy, post-collision energy, and an arbitrary structured mesh. -The three valid elements in the tallies.xml file are ````, ````, -and ````. +The five valid elements in the tallies.xml file are ````, ````, +````, ````, and ````. .. _tally: @@ -35,42 +35,8 @@ The ```` element accepts the following sub-elements: *Default*: "" - :filter: - Specify a filter that modifies tally behavior. Most tallies (e.g. ``cell``, - ``energy``, and ``material``) restrict the tally so that only particles - within certain regions of phase space contribute to the tally. Others - (e.g. ``delayedgroup`` and ``energyfunction``) can apply some other function - to the scored values. This element and its attributes/sub-elements are - described below. - - .. note:: - You may specify zero, one, or multiple filters to apply to the tally. To - specify multiple filters, you must use multiple ```` elements. - - The ``filter`` element has the following attributes/sub-elements: - - :type: - The type of the filter. Accepted options are "cell", "cellborn", - "material", "universe", "energy", "energyout", "mu", "polar", - "azimuthal", "mesh", "distribcell", "delayedgroup", and - "energyfunction". - - :bins: - A description of the bins for each type of filter can be found in - :ref:`filter_types`. - - :energy: - ``energyfunction`` filters multiply tally scores by an arbitrary - function. The function is described by a piecewise linear-linear set of - (energy, y) values. This entry specifies the energy values. The function - will be evaluated as zero outside of the bounds of this energy grid. - (Only used for ``energyfunction`` filters) - - :y: - ``energyfunction`` filters multiply tally scores by an arbitrary - function. The function is described by a piecewise linear-linear set of - (energy, y) values. This entry specifies the y values. (Only used - for ``energyfunction`` filters) + :filters: + A space-separated list of the IDs of ``filter`` elements. :nuclides: If specified, the scores listed will be for particular nuclides, not the @@ -144,6 +110,41 @@ The ```` element accepts the following sub-elements: *Default*: None + +-------------------- +```` Element +-------------------- + +Filters can be used to modify tally behavior. Most tallies (e.g. ``cell``, +``energy``, and ``material``) restrict the tally so that only particles +within certain regions of phase space contribute to the tally. Others +(e.g. ``delayedgroup`` and ``energyfunction``) can apply some other function +to the scored values. The ``filter`` element has the following +attributes/sub-elements: + + :type: + The type of the filter. Accepted options are "cell", "cellborn", + "material", "universe", "energy", "energyout", "mu", "polar", + "azimuthal", "mesh", "distribcell", "delayedgroup", and + "energyfunction". + + :bins: + A description of the bins for each type of filter can be found in + :ref:`filter_types`. + + :energy: + ``energyfunction`` filters multiply tally scores by an arbitrary + function. The function is described by a piecewise linear-linear set of + (energy, y) values. This entry specifies the energy values. The function + will be evaluated as zero outside of the bounds of this energy grid. + (Only used for ``energyfunction`` filters) + + :y: + ``energyfunction`` filters multiply tally scores by an arbitrary + function. The function is described by a piecewise linear-linear set of + (energy, y) values. This entry specifies the y values. (Only used + for ``energyfunction`` filters) + .. _filter_types: Filter Types diff --git a/openmc/statepoint.py b/openmc/statepoint.py index f42c772be4..543e8a302d 100644 --- a/openmc/statepoint.py +++ b/openmc/statepoint.py @@ -9,7 +9,7 @@ import h5py import openmc import openmc.checkvalue as cv -_VERSION_STATEPOINT = 16 +_VERSION_STATEPOINT = 17 class StatePoint(object): diff --git a/openmc/tallies.py b/openmc/tallies.py index 64bbe6f4a1..1641d6164d 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -1077,9 +1077,8 @@ class Tally(object): # Optional Tally filters if len(self.filters) > 0: - filters = ' '.join(str(f.id) for f in self.filters) subelement = ET.SubElement(element, "filters") - subelement.text = filters + subelement.text = ' '.join(str(f.id) for f in self.filters) # Optional Nuclides if len(self.nuclides) > 0: diff --git a/src/cmfd_input.F90 b/src/cmfd_input.F90 index 91f2e03b6d..d57c21beb8 100644 --- a/src/cmfd_input.F90 +++ b/src/cmfd_input.F90 @@ -378,11 +378,7 @@ contains ! Determine number of filters energy_filters = check_for_node(node_mesh, "energy") - if (energy_filters) then - n_cmfd_filters = 5 - else - n_cmfd_filters = 3 - end if + n_cmfd_filters = merge(5, 3, energy_filters) ! Extend filters array so we can add CMFD filters call add_filters(n_cmfd_filters) diff --git a/src/constants.F90 b/src/constants.F90 index c44896b316..27adee9893 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -16,7 +16,7 @@ module constants integer, parameter :: HDF5_VERSION(2) = [1, 0] ! Version numbers for binary files - integer, parameter :: VERSION_STATEPOINT(2) = [16, 0] + integer, parameter :: VERSION_STATEPOINT(2) = [17, 0] integer, parameter :: VERSION_PARTICLE_RESTART(2) = [2, 0] integer, parameter :: VERSION_TRACK(2) = [2, 0] integer, parameter :: VERSION_SUMMARY(2) = [5, 0] diff --git a/src/relaxng/tallies.rnc b/src/relaxng/tallies.rnc index 57f5f37478..4674fd4c03 100644 --- a/src/relaxng/tallies.rnc +++ b/src/relaxng/tallies.rnc @@ -32,15 +32,10 @@ element tallies { ) }* & - element tally { + element filter { (element id { xsd:int } | attribute id { xsd:int }) & - (element name { xsd:string { maxLength="52" } } | - attribute name { xsd:string { maxLength="52" } })? & - (element estimator { ( "analog" | "tracklength" | "collision" ) } | - attribute estimator { ( "analog" | "tracklength" | "collision" ) })? & - element filter { - ( - (element type { ( "cell" | "cellborn" | "material" | "universe" | + ( + ( (element type { ( "cell" | "cellborn" | "material" | "universe" | "surface" | "distribcell" | "mesh" | "energy" | "energyout" | "mu" | "polar" | "azimuthal" | "delayedgroup" | "energyfunction") } | attribute type { ( "cell" | "cellborn" | "material" | "universe" | @@ -57,7 +52,17 @@ element tallies { (element y { list { xsd:double+ } } | attribute y { list { xsd:double+ } }) ) - }* & + ) + }* & + + element tally { + (element id { xsd:int } | attribute id { xsd:int }) & + (element name { xsd:string { maxLength="52" } } | + attribute name { xsd:string { maxLength="52" } })? & + (element estimator { ( "analog" | "tracklength" | "collision" ) } | + attribute estimator { ( "analog" | "tracklength" | "collision" ) })? & + (element filters { list { xsd:int+ } } | + attribute filters { list { xsd:int+ } })? & element nuclides { list { xsd:string { maxLength = "12" }+ } }? & diff --git a/src/relaxng/tallies.rng b/src/relaxng/tallies.rng index fde06bac6c..1c68e57e83 100644 --- a/src/relaxng/tallies.rng +++ b/src/relaxng/tallies.rng @@ -151,6 +151,120 @@ + + + + + + + + + + + + + + + + + cell + cellborn + material + universe + surface + distribcell + mesh + energy + energyout + mu + polar + azimuthal + delayedgroup + energyfunction + + + + + cell + cellborn + material + universe + surface + distribcell + mesh + energy + energyout + mu + polar + azimuthal + delayedgroup + energyfunction + + + + + + + + + + + + + + + + + + + + + + + + energyfunction + + + energyfunction + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -194,110 +308,24 @@ - - - - - - - - cell - cellborn - material - universe - surface - distribcell - mesh - energy - energyout - mu - polar - azimuthal - delayedgroup - energyfunction - - - - - cell - cellborn - material - universe - surface - distribcell - mesh - energy - energyout - mu - polar - azimuthal - delayedgroup - energyfunction - - - - - - - - - - - - - - - - - - - - - - - - energyfunction - - - energyfunction - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +