Bruno,

Thank you. So, I can get the matrix values by &system_matrix.begin() and 
the column indices by doing &sparsity_pattern.begin() but I am a bit 
confused as to how I get the row pointers. Or did I misunderstand something 
?

Thanks,
Pratik.

On Thursday, August 23, 2018 at 3:05:07 PM UTC+2, Bruno Turcksin wrote:
>
> Pratik,
>
> On Thursday, August 23, 2018 at 8:38:34 AM UTC-4, [email protected] 
> <javascript:> wrote:
>>
>> Essentially, it says the the member variable cols within system_matrix is 
>> private. Is there any other way or a remedy to this ? How do I access this 
>> matrix and rhs data ?
>>
> You can get the underlying data of the matrix using this function 
> <https://www.dealii.org/9.0.0/doxygen/deal.II/classSparseMatrix.html#a1370b39c0ae075f6617079a7e6e92cb4>.
>  
> To get the column indices, you first need to get the SparsityPattern of the 
> matrix, then you can get the underlying data using this 
> <https://www.dealii.org/developer/doxygen/deal.II/classSparsityPattern.html#ad368c80b8658fa995efa3d5f27088fae>.
>  
> This will give an iterator 
> <https://www.dealii.org/developer/doxygen/deal.II/classSparsityPatternIterators_1_1Iterator.html>
>  
> that you can dereference to an accessor. 
> <https://www.dealii.org/developer/doxygen/deal.II/classSparsityPatternIterators_1_1Accessor.html>
>  
> This gives you everything that you need. Another solution is to modify 
> deal.II directly. You could just make the variables public (the easiest but 
> also the dirtiest method) or make your own Matrix class a friend of 
> SparseMatrix.
>
> Best,
>
> Bruno
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to