<div dir="ltr"><div dir="ltr">On Thu, Aug 12, 2021 at 10:44 AM Alfredo J Duarte Gomez <<a href="mailto:aduarteg@utexas.edu">aduarteg@utexas.edu</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Good morning,<div><br></div><div>I am currently having some trouble in the creation of some matrices.</div><div><br></div><div>I am using structured dmda objects to create matrices using the DMCreate() function.</div><div><br></div><div>One of these matrices will be the result of a matrix-matrix product of two of these dm matrices.</div><div><br></div><div>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.</div></div></blockquote><div><br></div><div>By default, we put zeros into those locations, so you would expand that stencil when doing MatMatMult(). You can use</div><div><br></div><div>  -dm_preallocate_only</div><div><br></div><div>to prevent the zeros from being included. However, then your target matrix would not have those locations, so you would</div><div>need to turn that off before creating the product matrix, or you could just make two DMDA with different stencils, since they</div><div>are really small. This later solutions sounds cleaner to me.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>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.</div><div><br></div><div>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. </div><div><br></div><div>Is there any way of getting a matrix-matrix product that will keep the same nonzero pattern as the dm matrices?</div><div><br></div><div>I have tried both MatMatMult() and the MatProductCreate() sequence so far, but both produce nonzero patterns that do not match the dm nonzero pattern.</div><div><br></div><div>Thank you,</div><div><br></div><div>-Alfredo</div><div><br></div><div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><font face="arial, sans-serif">Alfredo Duarte</font><div><font face="arial, sans-serif">Graduate Research Assistant</font></div><div><font face="arial, sans-serif">The University of Texas at Austin</font></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>