On Tue, Apr 3, 2012 at 4:40 PM, RenZhengYong <span dir="ltr">&lt;<a href="mailto:renzhengyong@gmail.com">renzhengyong@gmail.com</a>&gt;</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">
Hi, Jed, <br>Thanks for your quick reply and have a nice day. <br><br>My problem is to solve a hybrid FEM-BEM problem, so one sub-matrix from BEM is fully dense and one from BEM-FEM is partially dense. I managed to used a multi-level fast multpole method to compute the product of my entire system matrix with a given vector. And I can find a quite good problem dependent approximation B to my system matrix <b>A</b>. <br>

<br>My next purpose to speed up the convergence rate of GMRES using this operator <b>B</b>.  In my code, the expensive of storage of the far field interaction from BEM part is avoided. And I can explicitly form the sparse matrix <b>B</b>.  So, could I ask you:<br>

how to give the sparse matrix <b>B</b> to petsc?. Because <b>B</b> is sparse, I prefer to fully LU decomposition to solve the preconditioned problem <b>B</b>z=c.   <br></blockquote><div><br></div><div>Give B as the preconditioner matrix,</div>
<div><br></div><div>  KSPSetOperators(ksp, A, B, ...)</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">Best wishes<br>
Zhengyong <br><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote">
On Tue, Apr 3, 2012 at 11:28 PM, Jed Brown <span dir="ltr">&lt;<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div class="gmail_quote">On Tue, Apr 3, 2012 at 14:25, RenZhengYong <span dir="ltr">&lt;<a href="mailto:renzhengyong@gmail.com" target="_blank">renzhengyong@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div>I have a question to ask for your suggestions which is to solve Ax=b using GMRES, <br>here A is partially dense.  Using petsc, I successfully used the matrix-free approach to solve<br>it so that the expensive storage of A is avoided.  My question is could I offer an matrix B <br>



(which is sparse matrix and good approximation to A) so that the convergence rate of <br>GMRES can be speed up. </div></blockquote></div><br></div><div>Certainly, but the challenge is to find this other operator. You could try sparse approximate methods to approximate either the operator or its inverse. Other approaches would typically involve further knowledge of your problem.</div>


</blockquote></div><br><br clear="all"><br></div></div><div class="HOEnZb"><div class="h5">-- <br>Zhengyong Ren<br>AUG Group, Institute of Geophysics<br>Department of Geosciences, ETH Zurich<br>NO H 47 Sonneggstrasse 5<br>
CH-8092, Zürich, Switzerland<br>Tel: +41 44 633 37561<br>
e-mail: <a href="mailto:zhengyong.ren@aug.ig.erdw.ethz.ch" target="_blank">zhengyong.ren@aug.ig.erdw.ethz.ch</a><br>Gmail: <a href="mailto:renzhengyong@gmail.com" target="_blank">renzhengyong@gmail.com</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <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>