<div dir="ltr">This code looks fine to me and the code is in src/mat/impls/sbaij/seq/sbaij2.c</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 21, 2022 at 2:02 PM Sam Guo <<a href="mailto:sam.guo@cd-adapco.com">sam.guo@cd-adapco.com</a>> wrote:<br></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"><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">Dear PETSc dev team,</span><div><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">   The documentation about MatCreateSBAIJ has following</span></div><div><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">"It is recommended that one use the </span><a href="https://petsc.org/main/docs/manualpages/Mat/MatCreate.html#MatCreate" style="font-family:"Times New Roman";font-size:medium" target="_blank">MatCreate</a><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">(), </span><a href="https://petsc.org/main/docs/manualpages/Mat/MatSetType.html#MatSetType" style="font-family:"Times New Roman";font-size:medium" target="_blank">MatSetType</a><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">() and/or </span><a href="https://petsc.org/main/docs/manualpages/Mat/MatSetFromOptions.html#MatSetFromOptions" style="font-family:"Times New Roman";font-size:medium" target="_blank">MatSetFromOptions</a><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">(), MatXXXXSetPreallocation() paradigm instead of this routine directly. [MatXXXXSetPreallocation() is, for example, </span><a href="https://petsc.org/main/docs/manualpages/Mat/MatSeqAIJSetPreallocation.html#MatSeqAIJSetPreallocation" style="font-family:"Times New Roman";font-size:medium" target="_blank">MatSeqAIJSetPreallocation</a><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">]"</span><br></div><div><span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">   I currently call </span>MatCreateSBAIJ directly as follows:</div><div>MatCreateSBAIJ (with d_nnz and o_nnz)<br>MatSetValues (to add row by row)</div><div>MatAssemblyBegin(A,MAT_FINAL_ASSEMBLY);</div><div>MatAssemblyEnd(A,MAT_FINAL_ASSEMBLY);<br>MatSetOption(A, MAT_SYMMETRIC, PETSC_TRUE);<span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"><br></span></div><div><br></div><div>   Two questions:</div><div>   (1) I am wondering whether what I am doing is the most efficient. </div><div><br></div><div>   (2) I try to find out how the matrix vector multiplication is implemented in PETSc for SBAIJ storage.</div><div><br></div><div>Thanks,</div><div>Sam</div></div>
</blockquote></div>