On Thu, Nov 15, 2018 at 2:03 PM Jed Brown via petsc-dev <
[email protected]> wrote:

> A user can currently get a sub-matrix of a MatNest and modify it without
> it updating the MatNest's state.  This may require a manual call to
> PetscObjectStateIncrease so that the PC knows that it needs to rebuild,
> but this is ugly/complicated/error-prone.  Some possible options off the
> top of my head:
>
> 1. Insist that the user call MatNestSetSubMats() after any modification.
>
> 2. Make MatNestRestoreSubMats and MatNest{Get,Restore}SubMatsRead so
> that mutable access is controlled.
>

I like 2. the best. Its the most like other PETSc interfaces and most
explicit. I don't
think its really any overhead from what we do now.

   Matt


> 3. Add a hook to PetscObjectStateGet that can traverse child objects in
> case its own state counter is stale.  This is the most automatic, but
> I'm concerned about its potential complexity.
>


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