<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Dear Yuyun,<div>Here is the simple example that I wrote to test the function: <a href="https://petsc.org/release/src/mat/tests/ex248.c.html">https://petsc.org/release/src/mat/tests/ex248.c.html</a></div><div>You can stick to MatCreate(), but this will only work if the type of your Mat is indeed MatSeqAIJ.</div><div>If you need this for other types, let us know.</div><div><br></div><div>Thanks,</div><div>Pierre<br><div><br><blockquote type="cite"><div>On 5 Dec 2022, at 9:12 AM, Yuyun Yang <yyang85@alumni.stanford.edu> wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">Dear PETSc team,<o:p></o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"><o:p> </o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">Is there an example for using MatSeqAIJKron? I’m using MatCreate for all matrices in the code, and wonder if I need to switch to MatCreateSeqAIJ in order to use this function? Just want to compute simple Kronecker products of a sparse matrix with an identity matrix.<o:p></o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;"><o:p> </o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">Thank you,<o:p></o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Calibri, sans-serif;"><span style="font-size: 11pt;">Yuyun</span></div></div></div></blockquote></div><br></div></body></html>