My question concerns the two-dimensional numpy
array A_array
generated by the following block of code:
from dolfin import *
nx = 3
ny = 3
mesh_obj = UnitSquareMesh(nx, ny)
V = FunctionSpace(mesh_obj, "CG", 1)
u = TrialFunction(V)
v = TrialFunction(V)
a = u*v*dx
# compute the stiffness/mass matrix associated with
# the bilinear form a
A = assemble(a)
A_array = A.array()
I would like to do further computations involving A_array
; it has been pointed out to me that the computations will run a lot faster if A_array
is sparse (as opposed to if it is dense).
Is there any way to ask FEniCS to produce a sparse matrix A_array
?