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

behzad baghapour behzad.baghapour at gmail.com
Sat Oct 1 10:23:50 CDT 2011


I meant by MatAssembly, the global indices of matrix elements (related to a
dense format) which is changed into sparse one. So what would be right
pattern to read the content of the Matrix from MatGetArray if I know that
the original matrix is created by AIJ?



On Sat, Oct 1, 2011 at 4:21 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

>  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().
>



-- 
==================================
Behzad Baghapour
Ph.D. Candidate, Mechecanical Engineering
University of Tehran, Tehran, Iran
https://sites.google.com/site/behzadbaghapour
Fax: 0098-21-88020741
==================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111001/7340b27a/attachment.htm>


More information about the petsc-users mailing list