Re: [petsc-users] Near nullspace lost in fieldsplit

2024-02-13 Thread Barry Smith
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

Re: [petsc-users] question on PCLSC with matrix blocks of type MATNEST

2024-02-13 Thread Zhang, Hong via petsc-users
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

Re: [petsc-users] question on PCLSC with matrix blocks of type MATNEST

2024-02-13 Thread Pierre Jolivet
> 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 >

Re: [petsc-users] question on PCLSC with matrix blocks of type MATNEST

2024-02-13 Thread Zhang, Hong via petsc-users
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; +

Re: [petsc-users] Near nullspace lost in fieldsplit

2024-02-13 Thread Barry Smith
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,