[petsc-users] How to efficiently represent a diagonal matrix?

Matthew Knepley knepley at gmail.com
Wed Feb 14 18:18:15 CST 2018


On Wed, Feb 14, 2018 at 7:11 PM, Fande Kong <fdkong.jd at gmail.com> wrote:

> On Wed, Feb 14, 2018 at 4:35 PM, Smith, Barry F. <bsmith at mcs.anl.gov>
> wrote:
>
>>
>>   What are you doing with the matrix?
>>
>
> We are doing an explicit method. PDEs are discretized using a finite
> element method, so there is a mass matrix. The mass matrix will be lumped,
> and it becomes diagonal. We want to compute the inverse of the lumped
> matrix, and also do a few of matrix-vector multiplications using  the
> lumped matrix or  its inverse.
>
> The specific implementation won't make this more efficient?
>

I am doing this for Pylith. I think you should just do Vec operations, and
pull the inverse mass matrix to the rhs.

   Matt


> Fande,
>
>
>>
>>   We don't have a diagonal matrix but it would be easy to add such a
>> beast if it was performance critical, which it probably isn't.
>>
>>   Barry
>>
>>
>>
>>
>> > On Feb 14, 2018, at 3:57 PM, Fande Kong <fdkong.jd at gmail.com> wrote:
>> >
>> > Hi All,
>> >
>> > If  a matrix is always diagonal, what a good way to represent the
>> matrix?  Still MPIAIJ, MPIBAIJ? Can we have a specific implementation for
>> this?
>> >
>> >
>> > Fande,
>>
>>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180214/f6dba37a/attachment.html>


More information about the petsc-users mailing list