[petsc-dev] Integrating PFLOTRAN, PETSC & SAMRAI

Barry Smith bsmith at mcs.anl.gov
Mon Jun 6 16:23:12 CDT 2011


  Jed,

     Though VecRestoreArray() does increase the Vector state,  we also have our base Vec class methods (and MatMult and friends) ALSO increase the state on appropriate Vec arguments (so for built-in Vec classes like VECSEQ the state is increased twice) . So for all of those routines there is no reason for an alternative Vec class to manage the state itself. Thus is it not completely unreasonable for Boyce (and people in similar situations) to ask that they never need to manage the state themselves.  They do need to because of SNESComputeFunction(). 

   Barry


Since VecRestoreArray() increases the state one could argument that we should remove all the state increase calls in the Vec base classes and Mat and always rely on VecRestoreArray(). And hence require all other Vec implementations to manage the state completely themselves?  







On Jun 6, 2011, at 4:05 PM, Jed Brown wrote:

> On Mon, Jun 6, 2011 at 23:01, Boyce Griffith <griffith at cims.nyu.edu> wrote:
>    d_petsc_vector->data = /* pointer to SAMRAI vector object */;
> 
> 
> There must be a function somewhere with prototype along the lines of
> 
> SAMRAI_Stuff VecGetStuff(Vec);
> 
> and maybe a corresponding restore. You mutate SAMRAI_Stuff somehow. Just make the state get incremented somewhere in here.




More information about the petsc-dev mailing list