[petsc-dev] [petsc-users] MATNEST with shell matrices

Jed Brown jedbrown at mcs.anl.gov
Fri Feb 22 16:49:26 CST 2013


On Fri, Feb 22, 2013 at 4:43 PM, Boyce Griffith <griffith at cims.nyu.edu>wrote:

> Sorry for the delay.  The thing that "owns" the data that the Vec
> represents also manages regridding and interpolation between grids.  So if
> you had something that did time stepping, the old Vec would get the rug
> pulled out from under it if YourSolver(X) regridded things.  (It doesn't
> have to be this way --- you could have different AMR grids floating around
> --- but this is how all of the transient solvers currently work in the
> code.)


Okay, so in light of this, I don't want to allow dynamically sized Vecs in
PETSc. I know it's complicated to have multiple AMR grids and try to
difference between them while preserving linear algebraic invariants so
unless there is a real code that works that way, it's just going to
encourage misuse. Instead, I'd like you to make the top-level interfaces
(beneath which regridding could occur) return new Vecs. (If you don't
regrid, you can return the old Vec.)

You can also keep a reference count on your old AMR grid so that if the
user holds any Vecs beyond the regridding and tries to use them for
anything that cannot be done after the "rug was pulled out from under it",
you'll be able to fail with a useful error message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130222/7ad7b087/attachment.html>


More information about the petsc-dev mailing list