armi.bookkeeping.visualization.utils module

Utility classes/functions for visualization.

Most of these are derived from the VTK format, which tends to be general enough to support other formats. Most of the work goes into figuring out where the vertices should be for a given block/assembly shape. If this coupling becomes problematic, abstractions for primitive shapes should be created.

class armi.bookkeeping.visualization.utils.VtkMesh(vertices, connectivity, offsets, cellTypes)[source]

Bases: object

Container for VTK unstructured mesh data.

This provides a container for the necessary data to describe a mesh to VTK (vertex locations, connectivity, offsets, cell types). It supports appending one set of mesh data onto another, handling the necessary index offsets.

While the specifics are somewhat specific to the VTK format, the concept of storing a bunch of vertices and their connectivity is a relatively general one, so this may be of use to other formats as well.

Parameters:
  • vertices (numpy array) – An Nx3 numpy array with one row per (x,y,z) vertex

  • connectivity (numpy array) – A 1-D array containing the vertex indices belonging to each cell

  • offsets (numpy array) – A 1-D array containing the index of the first vertex for the next cell

  • cellTypes (numpy array) – A 1-D array contining the cell type ID for each cell

static empty()[source]
property x
property y
property z
append(other)[source]

Add more cells to the mesh.

write(path, data) str[source]

Write this mesh and the passed data to a VTK file. Returns the base path, plus relevant extension.

armi.bookkeeping.visualization.utils.createReactorBlockMesh(r: Reactor) VtkMesh[source]
armi.bookkeeping.visualization.utils.createReactorAssemMesh(r: Reactor) VtkMesh[source]
armi.bookkeeping.visualization.utils.createBlockMesh(b: Block) VtkMesh[source]
armi.bookkeeping.visualization.utils.createAssemMesh(a: Assembly) VtkMesh[source]