[SciPy-User] How to assemble large sparse matrices effectively

cp3028 cp3028@googlemail....
Wed May 9 13:36:39 CDT 2012


Hello everyone,

I am working on an FEM project using Scipy. Now my problem is, that
the assembly of the sparse matrices is to slow. I compute the
contribution of every element in dense small matrices (one for each
element). For the assembly of the global matrices I loop over all
small dense matrices and set the matrice entries the following way:
...
[i,j] = someList[k][l]
Mglobal[i,j] = Mglobal[i,j] + Mlocal[k,l]
...

Mglobal is a lil_matrice of appropriate size, someList maps the
indexing variables.

Of course this is rather slow and consumes most of the matrice
assembly time. Is there a better way to assemble a large sparse matrix
from many small dense matrices? I tried scipy.weave but it doesn't
seem to work with sparse matrices

Yours,

cm


More information about the SciPy-User mailing list