[petsc-users] Sparse Matrix Matrix Multiply

Alfredo J Duarte Gomez aduarteg at utexas.edu
Thu Aug 12 09:43:59 CDT 2021


Good morning,

I am currently having some trouble in the creation of some matrices.

I am using structured dmda objects to create matrices using the DMCreate()
function.

One of these matrices will be the result of a matrix-matrix product of two
of these dm matrices.

I know that the matrix product will have more nonzero entries or at least a
bigger stencil than the original dm matrices, however I accounted for that
when I set the DMDA stencil width in the initial creation.

The problem is that even with that, the resulting matrix-matrix product has
a bigger stencil as evidenced by failure in subsequent matrix copy/addition
operations using SAME_NONZERO_PATTERN.

Judging by the difference of the nonzero entries I believe that initial
zero entries (the ones I initialized to eventually hold this
expaned stencil) on the original dm matrices are being combined to further
expand the stencil of the product matrix.

Is there any way of getting a matrix-matrix product that will keep the same
nonzero pattern as the dm matrices?

I have tried both MatMatMult() and the MatProductCreate() sequence so far,
but both produce nonzero patterns that do not match the dm nonzero pattern.

Thank you,

-Alfredo



-- 
Alfredo Duarte
Graduate Research Assistant
The University of Texas at Austin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210812/d301a57b/attachment.html>


More information about the petsc-users mailing list