[petsc-users] matrix-matrix addition

Boyce Griffith griffith at cims.nyu.edu
Mon Sep 27 11:30:18 CDT 2010



On 9/27/10 10:47 AM, Hong Zhang wrote:
> Boyce,
>
>> The easiest way I can think of to handle this is to make P^T C P, then
>> extract the nonzero
>> structure with Mat with GetIJ() and create B. You would have to explicitly
>> put zeros in B
>> too or else AssemblyEnd() will shrink it. Maybe someone else can think of an
>> easier way.
>
> This is what I would suggest as well.

It looks like MatGetRowIJ will do the trick for SeqAIJ matrices, but it 
appears that similar functionality does not exist for MPIAIJ matrices. 
Is there an approach that you would recommend for the parallel case?

Thanks!

-- Boyce


More information about the petsc-users mailing list