openmc.SpatialLegendreFilter

class openmc.SpatialLegendreFilter(order, axis, minimum, maximum, filter_id=None)[source]

Score Legendre expansion moments in space up to specified order.

This filter allows scores to be multiplied by Legendre polynomials of the the particle’s position along a particular axis, normalized to a given range, up to a user-specified order.

Parameters
  • order (int) – Maximum Legendre polynomial order

  • axis ({'x', 'y', 'z'}) – Axis along which to take the expansion

  • minimum (float) – Minimum value along selected axis

  • maximum (float) – Maximum value along selected axis

  • filter_id (int or None) – Unique identifier for the filter

Variables
  • order (int) – Maximum Legendre polynomial order

  • axis ({'x', 'y', 'z'}) – Axis along which to take the expansion

  • minimum (float) – Minimum value along selected axis

  • maximum (float) – Maximum value along selected axis

  • id (int) – Unique identifier for the filter

  • num_bins (int) – The number of filter bins

classmethod from_hdf5(group, **kwargs)[source]

Construct a new Filter instance from HDF5 data.

Parameters

group (h5py.Group) – HDF5 group to read from

Keyword Arguments

meshes (dict) – Dictionary mapping integer IDs to openmc.MeshBase objects. Only used for openmc.MeshFilter objects.

classmethod from_xml_element(elem, **kwargs)[source]

Generate a filter from an XML element

Parameters
  • elem (lxml.etree._Element) – XML element

  • **kwargs – Keyword arguments (e.g., mesh information)

Returns

Filter object

Return type

openmc.Filter

to_xml_element()[source]

Return XML Element representing the filter.

Returns

element – XML element containing Legendre filter data

Return type

lxml.etree._Element