Linear Equation from FFC generated from variational formulation

Following Transform dolfinx assemble matrix to numpy array - #11 by Samuel_Groth, but adapted to legacy DOLFIN, I would do something along the lines of

from scipy.sparse import csr_matrix
ai, aj, av = as_backend_type(A).mat().getValuesCSR()
Asp = csr_matrix((av, aj, ai))

to get a SCIPY CSR matrix.

1 Like