[petsc-dev] Integrating PFLOTRAN, PETSC & SAMRAI

Boyce Griffith griffith at cims.nyu.edu
Mon Jun 6 15:41:56 CDT 2011



On 6/6/11 4:31 PM, Jed Brown wrote:
> On Mon, Jun 6, 2011 at 22:21, Boyce Griffith <griffith at cims.nyu.edu
> <mailto:griffith at cims.nyu.edu>> wrote:
>
>     Could calls to PetscObjectStateIncrease be added to SNES so that
>     they are not needed anywhere in wrapper/application code?
>
>
> For the vector?

Yes.

Well, ideally, everything --- Vec's, Mat's, PC's, ... :-)

> The matrix has its state increased in MatAssemblyEnd(). The API is to
> always call MatAssemblyBegin/End even if the specific format doesn't
> "need" it.

At least in my code, and I expect in Bobby's too, all Mat and PC objects 
are just shells.  So the only non-PETSc objects are Vec wrapper objects.

At least at some point in history, it was necessary to call 
PetscObjectStateIncrease on the "output" vectors in calls to MatVecMult 
/ MatVecMultAdd / etc.

Because screwed up norm caching can ruin your day, I use it pretty 
liberally.  But because PetscObjectStateIncrease() doesn't appear to be 
intended to be used in user code, it can also be a source of headaches 
when changing PETSc versions.

-- Boyce



More information about the petsc-dev mailing list