The new code is in https://gitlab.com/petsc/petsc/-/merge_requests/7293 and
retains the null space on the submatrices for both MatZeroRows() and
MatZeroRowsAndColumns() regardless of changes to the nonzero structure of the
matrix.
Barry
> On Feb 13, 2024, at 7:12 AM, Jeremy Theler
Pierre,
Please review
https://gitlab.com/petsc/petsc/-/merge_requests/7292#5479b9c001ff78d18f5236b7e21d8b1cb9acf476
I moved your checking PetscCheck((*C)->ops->productsymbolic,...) from
MatProduct_Private() to MatProductSymbolic() .
With this fix, you can run ex195 with
./ex195 -test_nest*nest
> On 13 Feb 2024, at 9:21 PM, Zhang, Hong via petsc-users
> wrote:
>
> Pierre,
> I can repeat your change in ex27.c on petsc-release. However, replacing
> +Mat D;
> +PetscCall(MatMatMult(C, C, MAT_INITIAL_MATRIX, PETSC_DECIDE, ));
> +PetscCall(MatDestroy());
> with
>
Pierre,
I can repeat your change in ex27.c on petsc-release. However, replacing
+Mat D;
+PetscCall(MatMatMult(C, C, MAT_INITIAL_MATRIX, PETSC_DECIDE, ));
+PetscCall(MatDestroy());
with
PetscCall(MatCreateNest(PETSC_COMM_WORLD, 2, NULL, 2, NULL, array, ));
+Mat D;
+
Thank you for the code.
A) By default MatZeroRows() does change the nonzero structure of the matrix
B) PCFIELDSPLIT loses the null spaces attached to the submatrices if the
nonzero structure of the matrix changes.
For the example code if one sets MatSetOption(A,MAT_KEEP_NONZERO_PATTERN,