[petsc-users] MATNEST with shell matrices

Boyce Griffith griffith at cims.nyu.edu
Thu Feb 21 17:46:35 CST 2013



On 2/21/13 6:33 PM, Jed Brown wrote:
> That was called PetscExt. Dave and I wrote MatNest out of desire to do
> the sort of things that PetscExt did in a way that was more flexible and
> would interoperate better with the rest of PETSc. It, and PCFieldSplit
> should be a complete replacement for anything you might have used
> PetscExt for in the past.
>
> If you already have MatShells around for all the blocks, you can easily
> wire them together with MatNest.
>
> Note that MatNest does *not* depend on VecNest, and in general, I
> recommend not using VecNest. If you call VecGetSubVector() with a
> contiguous index set, you'll get a subvec back without a copy. This
> means that your residual evaluation only needs to provide a map from
> your non-contiguous local representation to a contiguous global
> representation. This should be no overhead and will interoperate better.

There are no index sets available for the SAMRAI vector data.  The 
interface only provides access to "capital-V Vector Space" operations 
(vector addition, scalar multiplication, dot product, etc.).

We've discussed this briefly before on some list --- petsc-dev? --- with 
Bobby Philip, but the basic story is that SAMRAI does patch-based AMR 
and separately allocates data for each patch as simple FORTRAN-style 
arrays (e.g. ghost cells are "co-mingled" with patch DOFs).  This makes 
it cumbersome to generate a Vec representation that plays nice with PETSc.

I am working on some code to make it feasible to map SAMRAI data onto a 
native PETSc Vec and to generate unique indices for the different data 
centerings provided by SAMRAI that we use regularly, but at least for 
now Amneet isn't trying to use that stuff.  (And by "working on", here I 
really mean thinking about working on while I am instead writing grant 
applications. ;-)

It also seems almost feasible to use one of the existing DMs to wrap the 
SAMRAI data.  I haven't thought about this in a while and don't remember 
what I thought sounded like it was feasible.

> But if you really want to use those other vector space wrappers, you can
> use VecNest.

Great --- this is what I had hoped and what Amneet was trying to figure out.

Thanks,

-- Boyce


More information about the petsc-users mailing list