[petsc-users] How to get Matrix from MatGetArray()

Jed Brown jedbrown at mcs.anl.gov
Sat Oct 1 07:51:40 CDT 2011


On Sat, Oct 1, 2011 at 00:39, behzad baghapour
<behzad.baghapour at gmail.com>wrote:

> I just be able to get right answer from MatGetArray( A, &a ) only if I
> define matrix in Dense fromat.
>
> How could I get the right Answer from this function when I define SparseAIJ
> matrix?
>

Depends what you mean by "right answer". This function accesses private
storage, so it's different for each matrix format. You might want to look at
MatView() or MatConvert().
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111001/e1ec825d/attachment.htm>


More information about the petsc-users mailing list