[petsc-users] SNES test with a nested matrix

Jed Brown jed at jedbrown.org
Thu Apr 17 09:56:16 CDT 2014


Norihiro Watanabe <norihiro.w at gmail.com> writes:

> Hi, I wonder whether "-snes_type test" option can work also with a nested
> matrix. I got the following error in my program and am not sure if there is
> a problem in my codes or just PETSc doesn't support it.

I believe -snes_compare_explicit should convert if necessary (it
provides similar functionality to -snes_type test).

> Testing hand-coded Jacobian, if the ratio is
> O(1.e-8), the hand-coded Jacobian is probably correct.
> Run with -snes_test_display to show difference
> of hand-coded and finite difference Jacobian.
> [0]PETSC ERROR: --------------------- Error Message
> ------------------------------------
> [0]PETSC ERROR: No support for this operation for this object type!
> [0]PETSC ERROR: Mat type nest!

We strongly recommend writing your code in a way that is agnostic to
matrix format (i.e., assemble using MatGetLocalSubMatrix).  Then just
use a monolithic format for comparisons like this and switch to MatNest
when trying to get the best performance out of a fieldsplit
preconditioner.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140417/da2a4dd2/attachment-0001.pgp>


More information about the petsc-users mailing list