The change in #1417 introduces a flush step for PETSc matrices during assembly. Since this is now required, some other things can. be changed:
- Split the assembly and row ident/zero calls in Python to still allow the lowest levels of control.
- Use a dedicated lambda function to zero rows and place 1 on the diagonal, e.g. in the case of PETSc capture
MatZeroRowsLocal.
- Reconsider if we still want to zero rows during assembly. The advantage of zeroing rows during assembly is that a call to subsequently set 1 on the diagonal can be strictly local and not require communication.