Is it possible to export the material ID of each grid cell so I can be sure that they’re being assigned properly in some viewer (e.g. Paraview)? If so, what would be the command for this?
Yes, in fact this is done in most examples by default.
e.g. for cylinder2d the SuperLatticeGeometry2D functor is exported as VTK for the 0th timestep. You only need to open the tmp/vtkData/geometry_iT0000000.vtm file in Paraview after executing the simulation.