openmc.RectilinearMesh¶
- class openmc.RectilinearMesh(mesh_id: Optional[int] = None, name: str = '')[source]¶
A 3D rectilinear Cartesian mesh
- Parameters
- Variables
id (int) – Unique identifier for the mesh
name (str) – Name of the mesh
dimension (Iterable of int) – The number of mesh cells in each direction (x, y, z).
n_dimension (int) – Number of mesh dimensions (always 3 for a RectilinearMesh).
x_grid (numpy.ndarray) – 1-D array of mesh boundary points along the x-axis.
y_grid (numpy.ndarray) – 1-D array of mesh boundary points along the y-axis.
z_grid (numpy.ndarray) – 1-D array of mesh boundary points along the z-axis.
indices (Iterable of tuple) – An iterable of mesh indices for each mesh element, e.g. [(1, 1, 1), (2, 1, 1), …]
bounding_box (openmc.BoundingBox) – Axis-aligned bounding box of the mesh as defined by the upper-right and lower-left coordinates.
- classmethod from_hdf5(group: Group)[source]¶
Create mesh from HDF5 group
- Parameters
group (h5py.Group) – Group in HDF5 file
- Returns
Instance of a MeshBase subclass
- Return type
openmc.MeshBase
- classmethod from_xml_element(elem: Element)[source]¶
Generate a rectilinear mesh from an XML element
- Parameters
elem (lxml.etree._Element) – XML element
- Returns
Rectilinear mesh object
- Return type
- to_xml_element()[source]¶
Return XML representation of the mesh
- Returns
element – XML element containing mesh data
- Return type
lxml.etree._Element
- property volumes¶
Return Volumes for every mesh cell
- Returns
volumes – Volumes
- Return type