Hey Jed,<br>    I took a look through the link you provided and wanted to ask a couple<br>of questions to clarity a couple of things. <br><br>1) How well does the the preconditioner you describe work with the power <br>law rheology implemented? What is the maximum viscosity contrast between <br>
elements and across that box you've tried? <br><br>2) When you say you use AMG for the action of y = A^{-1} x, it appears from your<br>README that this is defined using hypre. Is this correct? Have you found boomeramg<br>
to be superior to ML for the A block? In the past I tried both preconditioners on the<br>A block for variable viscosity Stokes flow, but I never had much success. They <br>either required massive amounts of setup time or the solution time has not obtained <br>
in O(N). Was there something fancy in the options configuration required to make hypre<br>work for you?<br><br>Cheers,<br>    Dave<br><br><br><div class="gmail_quote">On Wed, Apr 30, 2008 at 1:14 AM, Jed Brown <<a href="mailto:jed@59a2.org">jed@59a2.org</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On Tue 2008-04-29 10:44, Lisandro Dalcin wrote:<br>
> Well, I've worked hard on similar methods, but for incompressible NS<br>
> equations (pressure-convection preconditioners, Elman et al.). I<br>
> abandoned temporarily this research, but I was not able to get decent<br>
> results. However, for Stokes flow it seens to work endeed, but never<br>
> studied this seriously.<br>
<br>
</div>My experiments with the Stokes problem shows that it takes about four times as<br>
long to solve the indefinite Stokes system as it takes to solve a poisson<br>
problem with the same number of degrees of freedom.  For instance, in 3D with<br>
half a million degrees of freedom, the Stokes problem takes 2 minutes on my<br>
laptop while the poisson problem takes 30 seconds (both are using algebraic<br>
multigrid as the preconditioner).  Note that these tests are for a Chebyshev<br>
spectral method where the (unformed because it is dense) system matrix is<br>
applied via DCT, but a low-order finite difference or finite element<br>
approximation on the collocation nodes is used to obtain a sparse matrix with<br>
equivalent spectral properties, to which AMG is applied.  With a finite<br>
difference discretization (src/ksp/ksp/examples/tutorials/ex22.c) the same sized<br>
3D poisson problem takes 13 seconds with AMG and 8 with geometric multigrid.<br>
This is not a surprise since the conditioning of the spectral system is much<br>
worse, O(p^4) versus O(n^2), since the collocation nodes are quadratically<br>
clustered.<br>
<br>
I've read Elman et al. 2002 ``Performance and analysis of saddle point<br>
preconditioners for the discrete steady-state Navier-Stokes equations'' but I<br>
haven't implemented anything there since I'm mostly interested in slow flow.<br>
Did your method work well for the Stokes problem, but poorly for NS?  I found<br>
that performance was quite dependent on the number of iterations at each level<br>
and the strength of the viscous preconditioner.  I thought my approach was<br>
completely naïve, but it seems to work reasonably well.  Certainly it is much<br>
faster than SPAI/ParaSails which is the alternative.<br>
<div class="Ih2E3d"><br>
> I'll comment you the degree of abstraction I could achieve. In my base<br>
> FEM code, I have a global [F, G; D C] matrix (I use stabilized<br>
> methods) built from standard linear elements and partitioned across<br>
> processors in a way inherited by the mesh partitioner (metis). So the<br>
> F, G, D, C entries are all 'interleaved' at each proc.<br>
><br>
> In order to extract the blocks as parallel matrices from the goblal<br>
> saddle-point parallel matrix, I used MatGetSubmatrix, for this I<br>
> needed to build two index set for momentum eqs and continuity eqs<br>
> local at each proc but in global numbering. Those index set are the<br>
> only input required (apart from the global matrix) to build the<br>
> preconditioner.<br>
<br>
</div>This seems like the right approach.  I am extending my collocation approach to a<br>
hp-element version, so the code you wrote might be very helpful.  How difficult<br>
would it be to extend to the case where the matrices could be MatShell?  That<br>
is, to form the preconditioners, we only need entries for approximations S' and<br>
F' to S and F respectively; the rest can be MatShell.  In my case, F' is a<br>
finite difference or Q1 finite element discretization on the collocation nodes<br>
and S' is the mass matrix (which is the identity for collocation).<br>
<br>
Would it be useful for me to strip my code down to make an example?  It's not<br>
parallel since it does DCTs of the entire domain, but it is a spectrally<br>
accurate, fully iterative solver for the 3D Stokes problem with nonlinear<br>
rheology.  I certainly learned a lot about PETSc while writing it and there<br>
aren't any examples which do something similar.<br>
<font color="#888888"><br>
Jed<br>
</font></blockquote></div><br>