<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Thanks a&nbsp;lot, Jed,<BR>
&nbsp;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I will try the algebric multigrid first. <BR>
&nbsp; <BR>
&nbsp;&nbsp;&nbsp;&nbsp; In order to&nbsp; configure PETSc with --download-ml and --download-hypre,which shell file in unix&nbsp;should I modify?<BR>
&nbsp;<BR>
&nbsp;&nbsp;&nbsp;&nbsp; Should I add some line in my current code to run with&nbsp;-pc_type ml or -pc_type hypre, or just use runtime option? <BR>
&nbsp;<BR>
&nbsp;&nbsp;&nbsp;&nbsp; I am solving a 2-D poisson equation with finite difference scheme. Please find the problem discription as attached if it is necessary. Thanks again.<BR>
&nbsp;&nbsp;&nbsp;&nbsp; <BR>
&nbsp;&nbsp;&nbsp; <BR>&nbsp;<BR>

<HR id=stopSpelling>
Date: Wed, 9 Feb 2011 17:54:19 +0100<BR>From: jed@59A2.org<BR>To: petsc-users@mcs.anl.gov<BR>Subject: Re: [petsc-users] questions about the multigrid framework<BR><BR>
<DIV class=ecxgmail_quote>On Wed, Feb 9, 2011 at 17:44, Peter Wang <SPAN dir=ltr>&lt;<A href="mailto:pengxwang@hotmail.com">pengxwang@hotmail.com</A>&gt;</SPAN> wrote:<BR>
<BLOCKQUOTE class=ecxgmail_quote style="PADDING-LEFT: 1ex; BORDER-LEFT: #ccc 1px solid">
<DIV>Did you mean All the Krylov methods alone will get worse with increasing grid&nbsp;number?</DIV></BLOCKQUOTE>
<DIV><BR></DIV>
<DIV>Yes, the number of Krylov iterations for second order elliptic problems with no preconditioner scales proportional to the number of grid points in any direction. You need a spectrally equivalent preconditioner, usually multigrid of some sort, to prevent this.</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE class=ecxgmail_quote style="PADDING-LEFT: 1ex; BORDER-LEFT: #ccc 1px solid">
<DIV>Since the finer grid has smaller size and more number of grid.<BR>&nbsp;<BR>&nbsp;&nbsp; Since I am a new user of PETSc, the easiest way for me is still keep in KSP solver. However, if the solver cannot satisfy the speed reqirement. I am thinking to use MG method. However, I don't have any experience on&nbsp;multigrid.&nbsp;Could you please give me some suggestion on it? <BR>&nbsp;<BR>&nbsp;1, Since I&nbsp; have built the Matrix and the vector for finite difference scheme in KSP solver, where should I start from to transfer to multigrid?&nbsp; I studied the example in: src/ksp/ksp/examples/tutorials/ex22f.F. Is it a good prototype to&nbsp;be&nbsp;based on to create my own code?&nbsp; Is DMMG is the best tool for&nbsp;my problem?<BR></DIV></BLOCKQUOTE>
<DIV><BR></DIV>
<DIV>Assuming you currently assemble a matrix, just configure PETSc with --download-ml and --download-hypre, then try running your code with -pc_type ml or -pc_type hypre. You can use geometric multigrid later to improve the constants or handle cases where algebraic multigrid (ML or BoomerAMG from Hypre) are having trouble.</DIV>
<DIV><BR></DIV>
<DIV>You need to tell us what equations you are solving if you want useful suggestions.</DIV></DIV>                                               </body>
</html>