<div class="gmail_quote">On Fri, Sep 21, 2012 at 5:21 PM, Shao-Ching Huang <span dir="ltr"><<a href="mailto:huangsc@gmail.com" target="_blank">huangsc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":5wa">In this particular finite volume discretization, the flux normal to a<br>
face involves the cell-center values on each side of the face (1),<br>
plus values from neighboring nodes (2) [due to non-orthogonal mesh<br>
cell shape]. The A1 part include coefficients from (1). A2 includes<br>
those in (2).</div></blockquote></div><div><br></div><div>1. Call KSPSetOperators(ksp,A,A1,flag)</div><div><br></div><div>You can make A in the above a MATSHELL that applies A1 + A2 matrix-free (or just the A2 part).</div>
<div><br></div><div>2. Use any Krylov method. The specific method -ksp_type richardson will do the defect-correction version of what you have written, but a real Krylov method will almost certainly perform much better. Note that A1^{-1} will be applied using whatever method you choose (via -pc_type). A V-cycle of algebraic multigrid should work very well.</div>