openmc.lib.RectilinearMesh

class openmc.lib.RectilinearMesh(uid=None, new=True, index=None)[source]

RectilinearMesh stored internally.

This class exposes a mesh that is stored internally in the OpenMC library. To obtain a view of a mesh with a given ID, use the openmc.lib.meshes mapping.

Parameters

index (int) – Index in the meshes array.

Variables
  • id (int) – ID of the mesh

  • dimension (iterable of int) – The number of mesh cells in each direction.

  • lower_left (numpy.ndarray) – The lower-left corner of the structured mesh.

  • upper_right (numpy.ndarray) – The upper-right corner of the structrued mesh.

  • width (numpy.ndarray) – The width of mesh cells in each direction.

  • n_elements (int) – Total number of mesh elements.

  • volumes (numpy.ndarray) – Volume of each mesh element in [cm^3]

set_grid(x_grid, y_grid, z_grid)[source]

Set grid values

Parameters
  • x_grid (iterable of float) – Mesh boundary points along the x-axis

  • y_grid (iterable of float) – Mesh boundary points along the y-axis

  • z_grid (iterable of float) – Mesh boundary points along the z-axis