Address #871 comments: incremented statepoint revision, updated documented tallies.xml format, updated tallies RELAX NG schema

This commit is contained in:
amandalund 2017-05-23 13:07:40 -05:00
parent cd58aaefa7
commit 70cc2f63c3
8 changed files with 190 additions and 161 deletions

View file

@ -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.
**/**

View file

@ -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 ``<tally>``, ``<mesh>``,
and ``<assume_separate>``.
The five valid elements in the tallies.xml file are ``<tally>``, ``<filter>``,
``<mesh>``, ``<derivative>``, and ``<assume_separate>``.
.. _tally:
@ -35,42 +35,8 @@ The ``<tally>`` 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 ``<filter>`` 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 ``<tally>`` element accepts the following sub-elements:
*Default*: None
--------------------
``<filter>`` 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

View file

@ -9,7 +9,7 @@ import h5py
import openmc
import openmc.checkvalue as cv
_VERSION_STATEPOINT = 16
_VERSION_STATEPOINT = 17
class StatePoint(object):

View file

@ -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:

View file

@ -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)

View file

@ -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]

View file

@ -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" }+ }
}? &

View file

@ -151,6 +151,120 @@
</interleave>
</element>
</zeroOrMore>
<zeroOrMore>
<element name="filter">
<interleave>
<choice>
<element name="id">
<data type="int"/>
</element>
<attribute name="id">
<data type="int"/>
</attribute>
</choice>
<choice>
<interleave>
<choice>
<element name="type">
<choice>
<value>cell</value>
<value>cellborn</value>
<value>material</value>
<value>universe</value>
<value>surface</value>
<value>distribcell</value>
<value>mesh</value>
<value>energy</value>
<value>energyout</value>
<value>mu</value>
<value>polar</value>
<value>azimuthal</value>
<value>delayedgroup</value>
<value>energyfunction</value>
</choice>
</element>
<attribute name="type">
<choice>
<value>cell</value>
<value>cellborn</value>
<value>material</value>
<value>universe</value>
<value>surface</value>
<value>distribcell</value>
<value>mesh</value>
<value>energy</value>
<value>energyout</value>
<value>mu</value>
<value>polar</value>
<value>azimuthal</value>
<value>delayedgroup</value>
<value>energyfunction</value>
</choice>
</attribute>
</choice>
<choice>
<element name="bins">
<list>
<oneOrMore>
<data type="double"/>
</oneOrMore>
</list>
</element>
<attribute name="bins">
<list>
<oneOrMore>
<data type="double"/>
</oneOrMore>
</list>
</attribute>
</choice>
</interleave>
<interleave>
<choice>
<element name="type">
<value>energyfunction</value>
</element>
<attribute name="type">
<value>energyfunction</value>
</attribute>
</choice>
<choice>
<element name="energy">
<list>
<oneOrMore>
<data type="double"/>
</oneOrMore>
</list>
</element>
<attribute name="energy">
<list>
<oneOrMore>
<data type="double"/>
</oneOrMore>
</list>
</attribute>
</choice>
<choice>
<element name="y">
<list>
<oneOrMore>
<data type="double"/>
</oneOrMore>
</list>
</element>
<attribute name="y">
<list>
<oneOrMore>
<data type="double"/>
</oneOrMore>
</list>
</attribute>
</choice>
</interleave>
</choice>
</interleave>
</element>
</zeroOrMore>
<zeroOrMore>
<element name="tally">
<interleave>
@ -194,110 +308,24 @@
</attribute>
</choice>
</optional>
<zeroOrMore>
<element name="filter">
<choice>
<interleave>
<choice>
<element name="type">
<choice>
<value>cell</value>
<value>cellborn</value>
<value>material</value>
<value>universe</value>
<value>surface</value>
<value>distribcell</value>
<value>mesh</value>
<value>energy</value>
<value>energyout</value>
<value>mu</value>
<value>polar</value>
<value>azimuthal</value>
<value>delayedgroup</value>
<value>energyfunction</value>
</choice>
</element>
<attribute name="type">
<choice>
<value>cell</value>
<value>cellborn</value>
<value>material</value>
<value>universe</value>
<value>surface</value>
<value>distribcell</value>
<value>mesh</value>
<value>energy</value>
<value>energyout</value>
<value>mu</value>
<value>polar</value>
<value>azimuthal</value>
<value>delayedgroup</value>
<value>energyfunction</value>
</choice>
</attribute>
</choice>
<choice>
<element name="bins">
<list>
<oneOrMore>
<data type="double"/>
</oneOrMore>
</list>
</element>
<attribute name="bins">
<list>
<oneOrMore>
<data type="double"/>
</oneOrMore>
</list>
</attribute>
</choice>
</interleave>
<interleave>
<choice>
<element name="type">
<value>energyfunction</value>
</element>
<attribute name="type">
<value>energyfunction</value>
</attribute>
</choice>
<choice>
<element name="energy">
<list>
<oneOrMore>
<data type="double"/>
</oneOrMore>
</list>
</element>
<attribute name="energy">
<list>
<oneOrMore>
<data type="double"/>
</oneOrMore>
</list>
</attribute>
</choice>
<choice>
<element name="y">
<list>
<oneOrMore>
<data type="double"/>
</oneOrMore>
</list>
</element>
<attribute name="y">
<list>
<oneOrMore>
<data type="double"/>
</oneOrMore>
</list>
</attribute>
</choice>
</interleave>
</choice>
</element>
</zeroOrMore>
<optional>
<choice>
<element name="filters">
<list>
<oneOrMore>
<data type="int"/>
</oneOrMore>
</list>
</element>
<attribute name="filters">
<list>
<oneOrMore>
<data type="int"/>
</oneOrMore>
</list>
</attribute>
</choice>
</optional>
<optional>
<element name="nuclides">
<list>