openmc.Source

class openmc.Source(space: Optional[Spatial] = None, angle: Optional[UnitSphere] = None, energy: Optional[Univariate] = None, time: Optional[Univariate] = None, filename: Optional[str] = None, library: Optional[str] = None, parameters: Optional[str] = None, strength: float = 1.0, particle: str = 'neutron', domains: Optional[Sequence[Union[Cell, Material, Universe]]] = None)[source]

Distribution of phase space coordinates for source sites.

Parameters
  • space (openmc.stats.Spatial) – Spatial distribution of source sites

  • angle (openmc.stats.UnitSphere) – Angular distribution of source sites

  • energy (openmc.stats.Univariate) – Energy distribution of source sites

  • time (openmc.stats.Univariate) – time distribution of source sites

  • filename (str) – Source file from which sites should be sampled

  • library (str) – Path to a custom source library

  • parameters (str) –

    Parameters to be provided to the custom source library

    New in version 0.12.

  • strength (float) – Strength of the source

  • particle ({'neutron', 'photon'}) – Source particle type

  • domains (iterable of openmc.Cell, openmc.Material, or openmc.Universe) – Domains to reject based on, i.e., if a sampled spatial location is not within one of these domains, it will be rejected.

Variables
  • space (openmc.stats.Spatial or None) – Spatial distribution of source sites

  • angle (openmc.stats.UnitSphere or None) – Angular distribution of source sites

  • energy (openmc.stats.Univariate or None) – Energy distribution of source sites

  • time (openmc.stats.Univariate or None) – time distribution of source sites

  • file (str or None) – Source file from which sites should be sampled

  • library (str or None) – Path to a custom source library

  • parameters (str) – Parameters to be provided to the custom source library

  • strength (float) – Strength of the source

  • particle ({'neutron', 'photon'}) – Source particle type

  • ids (Iterable of int) – IDs of domains to use for rejection

  • domain_type ({'cell', 'material', 'universe'}) – Type of domain to use for rejection

classmethod from_xml_element(elem: Element, meshes=None) Source[source]

Generate source from an XML element

Parameters
Returns

Source generated from XML element

Return type

openmc.Source

to_xml_element() Element[source]

Return XML representation of the source

Returns

element – XML element containing source data

Return type

xml.etree.ElementTree.Element