[petsc-dev] [petsc-maint #128159] MatGetArray

Barry Smith bsmith at mcs.anl.gov
Mon Aug 13 11:45:32 CDT 2012


   Jed,


     I propose to remove MatGetArray() from PETSc and insert MatSeqDenseGetArray()    for all the uses with in that case (where it appears often and is useful).

     What say you?

      Barry




On Aug 13, 2012, at 10:48 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> On Mon, Aug 13, 2012 at 9:06 AM, Phani Motamarri <phanim at umich.edu> wrote:
> 
>> Just like VecGetArray and MatGetArray gives local entries of a vector and
>> matrix on a given processor,
>> 
> 
> In general, this is not true of matrices. The MPI*AIJ formats return the
> "diagonal" part, but it's just a side-effect of the storage format.
> 
> 
>> is there any function that gives me the local
>> entries of a matrix which is of type "MATELEMENTAL". Unfortunately
>> MatGetArray does not work in this case.
>> 
> 
> Every time this comes up, I say that PETSc should remove the MatGetArray()
> call. If you want direct access to entries, include the private header and
> remember that what you are not using a public API. If you want structured
> access to entries, use MatGetSubMatrices()/MatGetSubMatrix() and use a
> format-specific accessor. In general, it is valuable to stop thinking about
> matrices as arrays of numbers and start thinking about them as linear
> operators.
> 




More information about the petsc-dev mailing list