<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Ubuntu">Thank you,<br>
<br>
I will try to use option 2 as you suggested.<br>
I'd prefer to implement the multigrid preconditioner directly
inside the code <br>
rather then using he command line options.<br>
Could you point me to an example where this (or something similar)
is done?<br>
<br>
Thank you,<br>
<br>
Michele<br>
<br>
<br>
</font>
<div class="moz-cite-prefix">On 07/30/2012 02:18 PM, Jed Brown
wrote:<br>
</div>
<blockquote
cite="mid:CAM9tzSk4SXeD5m7qXdQSSkU80cxJDnKuqCmMDEo4ii-RpogyqA@mail.gmail.com"
type="cite">
<div class="gmail_quote">On Mon, Jul 30, 2012 at 4:06 PM, Michele
Rosso <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:mrosso@uci.edu" target="_blank">mrosso@uci.edu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> <font face="Ubuntu">Hi,<br>
<br>
I am solving a variable coefficients Poisson equation with
periodic BCs.<br>
The equation is discretized by using the standard 5-points
stencil finite differencing scheme.<br>
I managed to solve the system successfully</font><font
face="Ubuntu"> with the PCG method and now I would like to
add<br>
a preconditioner to speed up the calculation. My idea is
to use the multigrid preconditioner.<br>
<br>
Example ex22f.F implements what I think I need. <br>
If I understand correctly example ex22f.F, the subroutines
"ComputeRHS" and "ComputeMatrix" define how the <br>
matrix and rhs-vector have to be computed at each level.<br>
In my case tough, both the jacobian and the rhs-vector
cannot be computed "analytically", that is, they depend on
variables<br>
whose values are available only at the finest grid.<br>
<br>
How can I overcome this difficulty? <br>
</font></div>
</blockquote>
<div><br>
</div>
<div>Two possibilities:<br>
<br>
1. homogenize on your own and rediscretize</div>
<div><br>
</div>
<div>2. use Galerkin coarse operators (possibly with algebraic
multigrid)</div>
<div><br>
</div>
<div><br>
</div>
<div>Option 2 is much more convenient because it never </div>
<div><br>
</div>
<div>For geometric multigrid using DMDA, just use -pc_type mg
-pc_mg_galerkin</div>
<div><br>
</div>
<div>For algebraic multigrid, use -pc_type gamg
-pc_gamg_agg_nsmooths 1</div>
</div>
</blockquote>
<br>
</body>
</html>