Good point. It is still strange, however, that SNES insists on using the same Mat obtained from DMGetMatrix for J and P. Dmitry. On Thu, Feb 9, 2012 at 11:46 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> On Thu, Feb 9, 2012 at 23:41, Dmitry Karpeev <karpeev at mcs.anl.gov> wrote: > >> Currently DMGetMatrix(DM dm, MatType mattype , Mat *J) is supposed to >> produce the system Jacobian, according to the docs. >> SNES will use it, but, since DMGetMatrix returns a single matrix, it >> can't use a different preconditioning matrix. >> Why not change this to DMGetMatrices(DM dm, MatType jtype, Mat *J, >> MatType ptype, Mat *P)? >> I'm not exactly sure what the best way of handling MatType should be >> (same MatType for J and P, separate types, how dm->mattype >> affects the result), but I think it can be sorted out, whereas the >> absence of P is a clear limitation. >> > > Umm, this doesn't put in values, it just creates a matrix of the right > size. You can make two if you want two different matrices. > > If you are talking about DMDAFormJacobianLocal(), that does actually > restrict what you can do, and you have to hack it a bit to use two > different matrices (except by MFFD because the library specifically > supports that). > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120209/872e018d/attachment.html>
