[petsc-dev] Removing VecGetArrayPrivate3

Jed Brown jed at 59A2.org
Wed Nov 24 19:17:44 CST 2010

On Thu, Nov 25, 2010 at 01:45, Barry Smith <bsmith at mcs.anl.gov> wrote:

> I just don't want an API explosion.  You may be falling into the trap of
> "just add one more method and it will make live better", pretty soon you
> have 10,000 methods and your stuff is unusable (at least unusable to the
> average Joe).

Are you referring to this thread, or the SubVector/SubMatrix-related stuff?
 My goal is to

1. Not rely on the dirty and brittle VecPlaceArray as the only way to
extract parts of vectors.

2. Not necessarily make copies of everything within FieldSplit (I think all
users of FieldSplit complain that it costs so much memory at present).

3. Have a way of assembling matrices without top-level knowledge.

TS ex14 is rough at the moment, I'll clean it up tomorrow, but it solves a
pretty cool problem, and the same code can assemble a single MPIAIJ matrix,
or the constituent pieces as part of a matrix format that just holds
constituent parts.  And if the pieces are held separately, then the assembly
process uses blocking and takes advantage of (S)BAIJ, despite the fact that
not all parts have block structure, and it is different for different
physics.  That is, we have

J = [A B; C D]

where A is logically SBAIJ(2) and comes out of a 3D problem, B and C have no
particular block structure, and D is BAIJ(3) and comes out of a 2D problem.
 Being able to build both forms efficiently with a runtime option, while
reusing the assembly code for single-physics A and D *unmodified* is pretty
cool functionality, in my opinion.

Also note that most users of VecNest will never call its (small) API
themselves.  DMGetGlobalVector_Composite will call VecCreateNest (and no
other new functions) when the vec-type is VECNEST.  An upcoming MatNest will
be similar (essentially one function, which the user does not normally call
themselves).  MatNest is somewhat like MatDD, but has a more defined purpose
at the moment.  We can cherry-pick the best parts of each later.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20101125/3c94052f/attachment.html>

More information about the petsc-dev mailing list