Reorder matrices in canonical order
PETSc potentially reorders degrees of freedom when using multiple MPI ranks. For instance, this means that stiffness matrices computed using only a single rank potentially differ from stiffness matrices computed using multiple MPI ranks.
A function that reorders the elements of a matrix into the more easily interpretable "canonical order" would therefore help with debugging and with exporting data.