On Tue, Jun 7, 2011 at 10:20 PM, Xiang Hao <span dir="ltr"><<a href="mailto:haoxiang@yahoo.cn">haoxiang@yahoo.cn</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px"><div>
Hi all,</div><div><br></div><div>I need to solve a PDE ( basically a Poisson's equation with Neumann boundary condition ), and I solved it using a steepest descent method, which is very slow. Now I want to solve the PDE using GMRES. In addition, I do have the matrix A, but I have a function which computes Ax, so I also need to use the matrix free method.</div>
<div><br></div><div>I am very new to PETSc, so I am looking for examples on solving linear systems using GMRES and/or matrix-free method.</div></span></blockquote><div><br></div><div>You can look at SNES ex5 for the Poisson equation (after setting lambda = 0.0). SNES ex19 also shows how to use geometric Multigrid.</div>
<div>Its not hard to do this for Poisson.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px"><div>Thanks,</div><div>Xiang</div></span><font color="#888888"><br><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<br>