This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Query on "parameters.linear_algebra_backend = "uBLAS""

0 votes

These codes didn't work for my FEniCS program. I am not sure why. Could you give some suggestions

related to an answer for: How to read data from class Matrix?
asked Sep 18, 2015 by cwang FEniCS Novice (190 points)

1 Answer

+1 vote

In the latest release of FEniCS, uBLAS is no longer supported. Please use Eigen instead.

parameters['linear_algebra_backend'] = 'Eigen'
answered Sep 18, 2015 by chris_richardson FEniCS Expert (31,740 points)

Setting this to "Eigen", the command that worked for "uBLAS"

rows, cols, values = A.data()

fails with AttributeError: 'Matrix' object has no attribute 'data'

What is the command to use here?

Try:

 as_backend_type(A).data()

or to get a scipy sparse array:

as_backend_type(A).sparray()
how to extract sparse matrix from assembled form

That was quick. I made it a separate question - maybe that will be of interest for others as well.

...