[petsc-dev] Promote MatShellSetOperation() and MatShellSetContext() to Mat

Dmitry Karpeev karpeev at mcs.anl.gov
Mon Jun 6 10:54:03 CDT 2011


On Mon, Jun 6, 2011 at 6:48 AM, Jed Brown <jed at 59a2.org> wrote:
> On Mon, Jun 6, 2011 at 13:44, Dmitry Karpeev <karpeev at mcs.anl.gov> wrote:
>>
>> A related matter: should there be a way to reset the MatSetValuesLocal
>> method?
>
> PCShellSetOperation() can reset any operation.
>
>>
>> The setting of local values frequently depends on factors other than
>> the type of the matrix.
>
> That's what the ISLocalToGlobalMapping is for.

It my view, ISLocalToGlobalMapping isn't always sufficient.
In any event, overloading mat->ops->setvalueslocal allows one to handle the
most general case.

>
>>
>> The default implementation depends only on the class (Mat) rather than
>> the type (e.g., MATMPIAIJ)
>> of the matrix.
>
> The definition of the "local space" is something that should not depend on
> the implementation.
> It calls through mat->ops->setvalueslocal, so I don't understand your
> concern.

However, overloading mat->ops->setvalueslocal requires a new Mat type,
which is odd, since, as you just noted the "local space" should not depend
on the implementation.

Dmitry.



More information about the petsc-dev mailing list