<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 1, 2015 at 11:07 AM, bichinhoverde <span dir="ltr"><<a href="mailto:bichinhoverde@spwinternet.com.br" target="_blank">bichinhoverde@spwinternet.com.br</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif">The system I am trying to solve is a 2D Poisson equation, but split into 5 1D equations. Something like this:</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">p_xx + p_yy = f</div><div style="font-family:arial,helvetica,sans-serif">p_xx - d(p_x)/dx = 0</div><div style="font-family:arial,helvetica,sans-serif">p_yy - d(p_y)/dy = 0<br></div><div style="font-family:arial,helvetica,sans-serif"><div>p_x - d(p)/dx = 0</div><div>p_y - d(p)/dy = 0<br></div><div><br></div></div><div style="font-family:arial,helvetica,sans-serif">If I use standard finite differences, it works fine with gmres and jacobi. But when I switch to compact finite differences, only the direct solver works.</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">It is on a staggered mesh, so p, p_xx and p_yy are on the cell center and p_x and p_y are on the edges.</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">I recently submitted a paper and the reviewer complained about the direct linear solver. So I wanted to do a performance comparison.</div></div></blockquote><div><br></div><div>I am not sure why the direct solver is a problem, other than unthinking prejudice.</div><div><br></div><div>If you want to use an iterative solver here, you will likely need to use PCFIELDSPLIT since you have saddle-point</div><div>structure from the constraints (I think).</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"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 1, 2015 at 12:58 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 1, 2015 at 10:51 AM, bichinhoverde <span dir="ltr"><<a href="mailto:bichinhoverde@spwinternet.com.br" target="_blank">bichinhoverde@spwinternet.com.br</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif">I have a linear system which I can easily solve using the Pardiso library, which is a direct solver. But when I try Petsc, the solver does not converge. It reduces the norm a little but then gets stuck.</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">I tried several combinations of pc_type and ksp_type. It seems that pc=jacobi is better, since my linear system does not have the diagonal element in some rows.</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">Is there some advice you can give me? Some way to analyse the matrix and find out why it does not work?</div></div>
</blockquote></div><br>Without knowing anything about the system, there is nothing you can say.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Why do you want to change from using a direct solver?</div><div class="gmail_extra"><br></div><div class="gmail_extra">Have you looked in the literature for iterative solvers that work on this problem?</div><div class="gmail_extra"><br></div><div class="gmail_extra"> Thanks,</div><div class="gmail_extra"><br></div><div class="gmail_extra"> Matt<span class="HOEnZb"><font color="#888888"><span><font color="#888888"><br clear="all"><div><br></div>-- <br><div>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</div>
</font></span></font></span></div></div>
</blockquote></div><br></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">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</div>
</div></div>