← Back to team overview

dolfin team mailing list archive

Re: Zeros in matrices

 



Garth N. Wells wrote:


Anders Logg wrote:
On Fri, Apr 27, 2007 at 05:24:34PM +0200, Garth N. Wells wrote:

Anders Logg wrote:
I'm comparing the entries in the Stokes systems between the new code
and the old and there seem to be quite a few more zeros in the sparse
matrix than before.

Strange. Have you counted the non-zeroes, or are you displaying the matrix?

Displaying the matrix and counting everything that looks like zero.
(Just looking at the numbers.)


There are about double the number of non-zeros (you can get the number by A.nnz()) for the Stokes example with the new version compared to version 0.6.4. For poisson and elasticity, the number of non-zeroes is the same as with version 0.6.4. The linear algebra looks fine - something is going on with the computation of the sparsity pattern for the Stokes problem.


This is due to the significant number of zeroes in the element matrix for the Stokes problem. Previously, for uBLAS matrices the stiffness matrix was assembled into a temporary matrix A_temp which was then copied to a compressed row matrix A

  A.assign(A_temp);

The assign operation removed all non-zero terms. We no longer assemble into the temporary matrix.

Perhaps FFC could produce something to indicate the non-zero terms in the element matrix, although this would make things more complicated.

Garth

Garth


/Anders


Garth

Could this have anything to do with the initialization of uBlas
matrices with a sparsity pattern and not using the temporary storage
as before? Did we have a check that removed zeros?

I haven't tried with PETSc.

/Anders
_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev


_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev






Follow ups

References