TS/SNES/KSP should take two Das

Issue #182 new
BarryFSmith
created an issue

Matt writes

No. You want 2 DAs, 1 for evaluating residuals with s = 3, and one for making a Jacobian with s = 1. You give these two DAs to

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/DMDASNESSetFunctionLocal.html http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/DMDASNESSetJacobianLocal.html

and I think it should work as you want. Its too bad we cannot handle this case with SNESSetDM() since it only takes a single DM and there is no way to specialize the Jacobian.

Comments (3)

  1. Jed Brown

    I'd argue they should be able to nest, so DM could hold a "preconditioning DM". Too much confusion and interface complexity with two independent DMs; one should be subordinate to the other.

  2. BarryFSmith reporter

    This is a completely valid argument. However, a possible reason to still have the two DM is that matches the current pattern of TS/SNES/KSP which take exactly two matrix arguments.

    If we were starting from scratch we won't have the two matrix arguments either and would instead manage the pmat via nesting of operators.

    So, do we make the dramatic change of nesting the operators and removing pmat, or do we instead live with the less than ideal previous design of two operators (and hence two DM). Note that, of course, having 2 DM doesn't prevent users from doing their own internal nesting. Currently we have a mixed paradigm (1 DM user manually nests and 2 matrices), this is the worst of both worlds and could be alleviated by having the two DM.

  3. Matthew Knepley

    I think there is a good argument for nesting of preconditioning DMs. What about a DM for coefficients. I currently have a DM for the solution and a DM for the parameters. I wanted to promote this to the real interface (its handled by composition now). Do you think this should also be done by nesting?

    Thanks,

    Matt
    
  4. Log in to comment