[petsc-users] Nonzero I-j locations

Jed Brown jed at jedbrown.org
Wed May 29 23:46:05 CDT 2019


"Smith, Barry F." <bsmith at mcs.anl.gov> writes:

>   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.

I think the motivation was that it's actually a Mat implementation and
thus made sense as Developer level interface rather than a strictly
internal interface.  I don't know if we had in mind any use cases where
it could be useful to a general caller.  I don't have a strong opinion
at the moment about whether it makes sense to keep like this or make
internal.


More information about the petsc-users mailing list