[petsc-users] MatCreateSBAIJ

Sam Guo sam.guo at cd-adapco.com
Mon Mar 21 13:01:55 CDT 2022


Dear PETSc dev team,
   The documentation about MatCreateSBAIJ has following
"It is recommended that one use the MatCreate
<https://petsc.org/main/docs/manualpages/Mat/MatCreate.html#MatCreate>(),
MatSetType
<https://petsc.org/main/docs/manualpages/Mat/MatSetType.html#MatSetType>()
and/or MatSetFromOptions
<https://petsc.org/main/docs/manualpages/Mat/MatSetFromOptions.html#MatSetFromOptions>(),
MatXXXXSetPreallocation() paradigm instead of this routine directly.
[MatXXXXSetPreallocation() is, for example, MatSeqAIJSetPreallocation
<https://petsc.org/main/docs/manualpages/Mat/MatSeqAIJSetPreallocation.html#MatSeqAIJSetPreallocation>
]"
   I currently call MatCreateSBAIJ directly as follows:
MatCreateSBAIJ (with d_nnz and o_nnz)
MatSetValues (to add row by row)
MatAssemblyBegin(A,MAT_FINAL_ASSEMBLY);
MatAssemblyEnd(A,MAT_FINAL_ASSEMBLY);
MatSetOption(A, MAT_SYMMETRIC, PETSC_TRUE);

   Two questions:
   (1) I am wondering whether what I am doing is the most efficient.

   (2) I try to find out how the matrix vector multiplication is
implemented in PETSc for SBAIJ storage.

Thanks,
Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220321/3b60d1b4/attachment.html>


More information about the petsc-users mailing list