If you are using DMMGSetSNES you can do a similar thing. That is why there are two matrix arguments.
Barry On Sep 28, 2010, at 9:34 PM, Shao-Ching Huang wrote: > Thanks Barry. I will look into DMMGSetKSP and your suggestions. > > Shao-Ching > > On Tue, Sep 28, 2010 at 7:13 PM, Barry Smith <bsmith at mcs.anl.gov> wrote: >> >> If you are using DMMGSetKSP() then just have the third argument (func) >> compute A+B as the first matrix and A as the second matrix. Then the >> smoothing and coarse grid solve will >> only use the A entries. That is A+B will be preconditioned with geometric >> multigrid applied to A. >> >> But, I suspect that you will do just as well using A+B. >> >> Barry >> >> On Sep 28, 2010, at 8:19 PM, Shao-Ching Huang wrote: >> >>> Hi >>> >>> I can trying to solve a linear system >>> >>> (A+B)x=b >>> >>> where A is the standard finite difference Laplacian matrix and B has >>> only a few elements (i.e. B's number of non-zero entries is much much >>> smaller than A's). >>> Is it possible to precondition by applying DMMG on A (like in ex34.c) >>> in a KSP solver? Is there an example that I can follow to set this up? >>> >>> Thanks, >>> >>> Shao-Ching >> >>
