Dear Minh,
> I am trying to using the PETSC sequential sparse matrix in deal.II. > But I can not add the values to it if this matrix is initialized from > the sparsity parameter. But it is OK if I reinit it from m and n > parameters. I think you can add values if you call petsc_matrix.reinit (sparsity_pattern, true); which means that you preset the nonzero locations in the matrix given by the sparsity pattern, see the documentation http://www.dealii.org/developer/doxygen/deal.II/classPETScWrappers_1_1SparseMatrix.html#acd51c424f12409d89591cd3ec1ea4cf However, I'm not sure why there is a preset argument and why it defaults to false. In my opinion it does not make much sense to reinit a matrix from a sparsity pattern if we do not allocated the nonzero entries. And in particular, it is very odd that we cannot add any values. I changed the default value in the subversion, but it is a general question whether the parameter makes sense - at least in PETSc 3.0.0 it does make any sense at all. Best, Martin _______________________________________________ dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
