openmc.Trigger

class openmc.Trigger(trigger_type: str, threshold: float, ignore_zeros: bool = False)[source]

A criterion for when to finish a simulation based on tally uncertainties.

Parameters
  • trigger_type ({'variance', 'std_dev', 'rel_err'}) – Determine whether to trigger on the variance, standard deviation, or relative error of scores.

  • threshold (float) – The threshold for the trigger type.

  • ignore_zeros (bool) –

    Whether to allow zero tally bins to be ignored. Note that this option can cause the trigger to fire prematurely if there are zero scores in any bin at the first evaluation.

    New in version 0.14.1.

Variables
  • trigger_type ({'variance', 'std_dev', 'rel_err'}) – Determine whether to trigger on the variance, standard deviation, or relative error of scores.

  • threshold (float) – The threshold for the trigger type.

  • scores (list of str) – Scores which should be checked against the trigger

  • ignore_zeros (bool) – Whether to allow zero tally bins to be ignored.

classmethod from_xml_element(elem: Element)[source]

Generate trigger object from an XML element

Parameters

elem (lxml.etree._Element) – XML element

Returns

Trigger object

Return type

openmc.Trigger

to_xml_element()[source]

Return XML representation of the trigger

Returns

element – XML element containing trigger data

Return type

lxml.etree._Element