On non-uniform simulation grids, Device currently only reliably supports design voxels specified in grid-cell counts (partial_voxel_grid_shape). When voxels are specified in physical units (partial_voxel_real_shape), matrix_voxel_grid_shape uses round(grid_shape / single_voxel_grid_shape) which assumes uniform cell sizes. This can produce a voxel count that doesn't tile the device evenly, leading to silent incorrect geometry or a "matrix got skewered" error.
A proper fix requires either:
- A resampling layer that maps a physical-unit voxel grid onto the non-uniform simulation cells
- Snapping physical voxel sizes to cell boundaries using the actual per-axis edge arrays from
RectilinearGrid
On non-uniform simulation grids,
Devicecurrently only reliably supports design voxels specified in grid-cell counts (partial_voxel_grid_shape). When voxels are specified in physical units (partial_voxel_real_shape),matrix_voxel_grid_shapeusesround(grid_shape / single_voxel_grid_shape)which assumes uniform cell sizes. This can produce a voxel count that doesn't tile the device evenly, leading to silent incorrect geometry or a "matrix got skewered" error.A proper fix requires either:
RectilinearGrid