[petsc-users] matrix-matrix addition

Boyce Griffith griffith at cims.nyu.edu
Mon Sep 27 11:38:58 CDT 2010


OK, well if I get something working before you all do, I will send along 
the code.

Thanks,

-- Boyce

On 9/27/10 12:34 PM, Barry Smith wrote:
>
>     Boyce,
>
>     Don't mess with this bad advice. It is just making your live complicated.  Use a fast MatAXPY() either write it yourself or wait for use.
>
>     Barry
>
> On Sep 27, 2010, at 11:30 AM, Boyce Griffith wrote:
>
>>
>>
>> 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