openmc.data.Sum

class openmc.data.Sum(functions)[source]

Sum of multiple functions.

This class allows you to create a callable object which represents the sum of other callable objects. This is used for redundant reactions whereby the cross section is defined as the sum of other cross sections.

Parameters:

functions (Iterable of Callable) – Functions which are to be added together

Variables:

functions (Iterable of Callable) – Functions which are to be added together

classmethod from_hdf5(group)[source]

Generate sum of functions from an HDF5 group

Added in version 0.13.1.

Parameters:

group (h5py.Group) – Group to read from

Returns:

Functions read from the group

Return type:

openmc.data.Sum

to_hdf5(group, name='xy')[source]

Write sum of functions to an HDF5 group

Added in version 0.13.1.

Parameters:
  • group (h5py.Group) – HDF5 group to write to

  • name (str) – Name of the dataset to create