Praveen C <[email protected]> writes: > 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.
I would recommend using a MatSetValuesBlocked interface. For a finite difference method, you'd typically set one block row at a time. So you'll create a 3x15 array and call MatSetValuesBlockedStencil indicating the stencils for the one block row and five block columns. > Is there an existing example that comes close to this situation. My search > was not fruitful. There are finite element examples, like SNES ex48.c, but I'm not sure if there is a SNES FD example. > Thank you > praveen
signature.asc
Description: PGP signature
