How to extract the the matrix A in crs format

29 views
Skip to first unread message

ztdep...@gmail.com

unread,
Oct 31, 2022, 11:16:12 AM10/31/22
to deal.II User Group
I want to extract the matrix A and rhs in crs format , and pass them to my own solver. Could you pleae give me some advices. 

Wolfgang Bangerth

unread,
Oct 31, 2022, 11:31:41 AM10/31/22
to dea...@googlegroups.com
On 10/31/22 09:16, ztdep...@gmail.com wrote:
> **
>
> I want to extract the matrix A and rhs in crs format , and pass them to my own
> solver. Could you pleae give me some advices.

The SparseMatrix class has various print functions that output the matrix in a
variety of ways. You can use those to obtain a representation of the matrix
that you can then read back in elsewhere.

Note that there is no "crs format" in the sense that there would be an
agreed-upon file format. CRS is a data structure, and it can be written into
files in many different ways. So if you're expecting a specific file format,
you have to state which one you mean and how it is defined.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/


Reply all
Reply to author
Forward
0 new messages