On Fri, Feb 9, 2024 at 7:04 AM Jeremy Theler (External) <
[email protected]> 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
>
> i.e. the matrices associated with each of the sub-KSPs of a fieldsplit are
> destroyed and then re-created later.
> The thing is that one of these destroyed matrices had a near nullspace
> attached, which is lost because the new matrix does not have it anymore.
>
> Is this a bug or are we missing something?
>

I just want to get a clear picture. You create a PCFIELDSPLIT, set it up,
then pull out the matrices and attach a nullspace before the solve. At a
later time, you start another solve with this PC, and it has the
DIFFERENT_NONZERO_PATTERN flag, so it recreates these matrices and loses
your attached nullspace.

First, does the matrix really change?

Second, I had the same problem. I added callbacks to DM which allow a
nullspace to be automatically attached if you extract a certain subfield.
Are you using a DM?

  Thanks,

    Matt


> I'll need some time to come up with a MWE showing how the near nullspace
> is lost, but if its needed I can take a stab at it.
>
> --
> jeremy
>
>
> <https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/pc/impls/fieldsplit/fieldsplit.c?ref_type=heads#L692>
> src/ksp/pc/impls/fieldsplit/fieldsplit.c · main · PETSc / petsc · GitLab
> <https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/pc/impls/fieldsplit/fieldsplit.c?ref_type=heads#L692>
> PETSc, pronounced PET-see (the S is silent), is a suite of data structures
> and routines for the scalable (parallel) solution of scientific
> applications modeled by partial differential equations.
> gitlab.com
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>

Reply via email to