openmc.stats.MeshSpatial
- class openmc.stats.MeshSpatial(mesh, strengths=None, volume_normalized=True, bias: Sequence[float] | None = None)[source]
Spatial distribution for a mesh.
This distribution specifies a mesh to sample over with source strengths specified for each mesh element.
Added in version 0.13.3.
- Parameters:
mesh (openmc.MeshBase) – The mesh instance used for sampling
strengths (iterable of float, optional) – An iterable of values that represents the weights of each element. If no source strengths are specified, they will be equal for all mesh elements.
volume_normalized (bool, optional) – Whether or not the strengths will be multiplied by element volumes at runtime. Default is True.
bias (iterable of float, optional) – An iterable of values giving the selection weights assigned to each element during biased sampling.
- Variables:
mesh (openmc.MeshBase) – The mesh instance used for sampling
strengths (numpy.ndarray or None) – An array of source strengths for each mesh element
volume_normalized (bool) – Whether or not the strengths will be multiplied by element volumes at runtime.
bias (numpy.ndarray or None) – Distribution for biased sampling
- classmethod from_xml_element(elem, meshes)[source]
Generate spatial distribution 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:
Spatial distribution generated from XML element
- Return type: