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

2024-02-14 Thread Jeremy Theler (External)
> 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. Thank you very much Barry. It works as expected. --

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] 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,

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

2024-02-12 Thread Barry Smith
7279 does change the code for MatZeroRowsColumns_MPIAIJ(). But perhaps that does not resolve the problem you are seeing? If that is the case we will need a reproducible example so we can determine exactly what else is happening in your code to cause the difficulties. Here is the diff for

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

2024-02-12 Thread Matthew Knepley
On Mon, Feb 12, 2024 at 7:10 AM Jeremy Theler (External) < jeremy.theler-...@ansys.com> wrote: > Hi Barry > > > The bug fix for 2 is availabel in > https://gitlab.com/petsc/petsc/-/merge_requests/7279 > > Note that our code goes through MatZeroRowsColumns_MPIAIJ() not through >

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

2024-02-12 Thread Jeremy Theler (External)
Hi Barry > The bug fix for 2 is availabel in > https://gitlab.com/petsc/petsc/-/merge_requests/7279 Note that our code goes through MatZeroRowsColumns_MPIAIJ() not through MatZeroRows_MPIAIJ() so this fix does not change anything for the case I mentioned. -- jeremy

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

2024-02-09 Thread Barry Smith
The bug fix for 2 is availabel in https://gitlab.com/petsc/petsc/-/merge_requests/7279 > On Feb 9, 2024, at 10:50 AM, Barry Smith wrote: > > > 1. Code going through line 692 looses the near nullspace of the matrices > attached to the sub-KSPs > 2. The call to MatZeroRowsColumns()

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

2024-02-09 Thread Barry Smith
1. Code going through line 692 looses the near nullspace of the matrices attached to the sub-KSPs 2. The call to MatZeroRowsColumns() changes then non-zero structure for MPIAIJ but not for SEQAIJ (unless MAT_KEEP_NONZERO_PATTERN is used) MatZeroRowsColumns() manual page states: Unlike

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

2024-02-09 Thread Jeremy Theler (External)
> > Because of a combination of settings, our code passes through this line: > > > > https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/pc/impls/fieldsplit/fieldsplit.c?ref_type=heads#L692 > > > > i.e. the matrices associated with each of the sub-KSPs of a fieldsplit are > > destroyed and then

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

2024-02-09 Thread Matthew Knepley
On Fri, Feb 9, 2024 at 7:04 AM Jeremy Theler (External) < jeremy.theler-...@ansys.com> wrote: > Hi all > > Because of a combination of settings, our code passes through this line: > > > https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/pc/impls/fieldsplit/fieldsplit.c?ref_type=heads#L692 > >