On Sun, Sep 10, 2017 at 2:39 AM, Praveen C <[email protected]> wrote:
> Dear all > > I am solving 3 coupled first order PDE in 2-D with SNES. The stencil is > (3+1+3) in both directions due to weno scheme. I want to use matrix-free > gmres. For preconditioner, I will use first order scheme with stencil > (1+1+1) in both directions. I am using DMDA. > > Two things that I am looking for are: > > How to setup the matrix ? > > Since I have 3 variables at each grid point, how to fill the jacobian > matrix. > > Is there an existing example that comes close to this situation. My search > was not fruitful. > 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. Thanks, Matt Thank you > praveen > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener http://www.caam.rice.edu/~mk51/
