openmc.MeshSource¶
- class openmc.MeshSource(mesh: MeshBase, sources: Sequence[SourceBase])[source]¶
A source with a spatial distribution over mesh elements
This class represents a mesh-based source in which random positions are uniformly sampled within mesh elements and each element can have independent angle, energy, and time distributions. The element sampled is chosen based on the relative strengths of the sources applied to the elements. The strength of the mesh source as a whole is the sum of all source strengths applied to the elements.
New in version 0.14.1.
- Parameters
mesh (openmc.MeshBase) – The mesh over which source sites will be generated.
sources (sequence of openmc.SourceBase) – Sources for each element in the mesh. Sources must be specified as either a 1-D array in the order of the mesh indices or a multidimensional array whose shape matches the mesh shape. If spatial distributions are set on any of the source objects, they will be ignored during source site sampling.
- Variables
- classmethod from_xml_element(elem: Element, meshes) MeshSource [source]¶
Generate MeshSource from an XML element
- Parameters
elem (lxml.etree._Element) – XML element
meshes (dict) – A dictionary with mesh IDs as keys and openmc.MeshBase instances as values
- Returns
MeshSource generated from the XML element
- Return type
- normalize_source_strengths()[source]¶
Update all element source strengths such that they sum to 1.0.