[petsc-users] Nonzero I-j locations

Smith, Barry F. bsmith at mcs.anl.gov
Wed May 29 23:27:47 CDT 2019


  Sorry, my mistake. I assumed that the naming would follow PETSc convention and there would be MatGetLocalSubMatrix_something() as there is MatGetLocalSubMatrix_IS() and MatGetLocalSubMatrix_Nest(). Instead MatGetLocalSubMatrix() is hardwired to call MatCreateLocalRef() if the 
method is not provide for the original matrix. 

  Now interestingly MatCreateLocalRef() has its own manual page which states: Most will use MatGetLocalSubMatrix(). I am not sure why MatCreateLocalRef() is a public function (that is why it would ever be called directly). Perhaps a note could be added to its manual page indicating why it is public. My inclination would be to make it private and call it MatGetLocalSubMatrix_Basic(). There is harm in having multiple similar public functions unless there is a true need for them.

  Barry

I don't remember the names of anything in PETSc, I only remember the naming conventions, hence when something is nonstandard I tend to get lost.


> On May 29, 2019, at 11:13 PM, Jed Brown <jed at jedbrown.org> wrote:
> 
> "Smith, Barry F. via petsc-users" <petsc-users at mcs.anl.gov> writes:
> 
>>   This is an interesting idea, but unfortunately not directly compatible with libMesh filling up the finite element part of the matrix. Plus it appears MatGetLocalSubMatrix() is only implemented for IS and Nest matrices :-(
> 
> Maybe I'm missing something, but MatGetLocalSubMatrix *is* implemented
> for arbitrary Mats; it returns a view that allows you to set entries
> using local submatrix indexing.  That was a key feature of the MatNest
> work from so many years ago and a paper on which you're coauthor.  ;-)



More information about the petsc-users mailing list