Johan,

> I dont know how to adress this than to this page. The PetSc wrappers do
> not allow matrix addition, with add, copy_from, how to resolve this, i
> found this utterly strange, when you use the same sparsity matrix it
> would be a trivial to add up.
>
> So my question how to
>
> C=A+B?
>
> Where A-C could be vectors/matrix in Petsc wrapper enviroment.

The function sadd() that Toby recommended only exists for Vectors, so you 
won't be able to use for matrices.

And, yes, you are right: there are no such functions in 
PETScWrappers::MatrixBase or in the derived classes. It would probably be 
simple to add these functions to MatrixBase but apparently nobody ever had 
a need to do so. 

Why don't you try to add them yourself? You could use 
MatrixBase::operator*= as a template on how such a function would probably 
look. If you write a patch that adds this functionality, we'd be happy to 
include it into the next release!

Best
 Wolfgang

-------------------------------------------------------------------------
Wolfgang Bangerth                email:            [email protected]
                                 www: http://www.math.tamu.edu/~bangerth/

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to