openmc.FileSource

class openmc.FileSource(path: Optional[Union[str, PathLike]] = None, strength=1.0)[source]

A source based on particles stored in a file

New in version 0.14.0.

Parameters
  • path (str or pathlib.Path) – Path to the source file from which sites should be sampled

  • strength (float) – Strength of the source (default is 1.0)

Variables
  • path (Pathlike) – Source file from which sites should be sampled

  • strength (float) – Strength of the source

  • type (str) – Indicator of source type: ‘file’

classmethod from_xml_element(elem: Element) FileSource[source]

Generate file source from an XML element

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

  • meshes (dict) – Dictionary with mesh IDs as keys and openmc.MeshBase instances as values

Returns

Source generated from XML element

Return type

openmc.FileSource

populate_xml_element(element)[source]

Add necessary file source information to an XML element

Returns

element – XML element containing source data

Return type

lxml.etree._Element