# HYPRE with multiple variables

Barry Smith bsmith at mcs.anl.gov
Wed Apr 25 11:35:28 CDT 2007

```  Nicolas,

On Wed, 25 Apr 2007, Nicolas Bathfield wrote:

> Dear Barry,
>
> Using MatSetBlockSize(A,5) improved my results greatly. Boomemramg is now
> solving the system of equations.

Good

> Still, the equations I solve are coupled, and my discretization scheme is
> meant for a non-segregated solver. As a consequence (I believe), boomeramg
> still diverges.

How can "Boomeramg be now solving the system of equations" but also
diverge? I am so confused.

>  I would therefore like to use the nodal relaxation in
> boomeramg (the hypre command is HYPRE_BOOMERAMGSetNodal) in order to
> couple the coarse grid choice for all my variables.

I can add this this afternoon.

I have to admit I do not understand the difference between
HYPRE_BOOMERAMGSetNodal() and hypre_BoomerAMGSetNumFunctions(). Do you?

Barry
>
> How can I achieve this from PETSc?
>
> Best regards,
>
> Nicolas
>
> >
> >   From PETSc MPIAIJ matrices you need to set the block size of the matrix
> > with MatSetBlockSize(A,5) after you have called MatSetType() or
> > MatCreateMPIAIJ(). Then HYPRE_BoomerAMGSetNumFunctions() is automatically
> > called by PETSc.
> >
> >    Barry
> >
> > The reason this is done this way instead of as
> > -pc_hypre_boomeramg_block_size <bs> is the idea that hypre will use the
> > properties of the matrix it is given in building the preconditioner so
> > the user does not have to pass those properties in seperately directly
> > to hypre.
> >
> >
> > On Fri, 13 Apr 2007, Shaman Mahmoudi wrote:
> >
> >> Hi,
> >>
> >> int HYPRE_BoomerAMGSetNumFunctions (.....)
> >>
> >> sets the size of the system of PDEs.
> >>
> >> With best regards, Shaman Mahmoudi
> >>
> >> On Apr 13, 2007, at 2:04 PM, Shaman Mahmoudi wrote:
> >>
> >> > Hi Nicolas,
> >> >
> >> > You are right. hypre has changed a lot since the version I used.
> >> >
> >> > I found this interesting information:
> >> >
> >> > int HYPRE_BOOMERAMGSetNodal(....)
> >> >
> >> > Sets whether to use the nodal systems version. Default is 0.
> >> >
> >> > Then information about smoothers:
> >> >
> >> > One interesting thing there is this,
> >> >
> >> > HYPRE_BoomerAMGSetDomainType(....)
> >> >
> >> > 0 - each point is a domain (default)
> >> > 1 each node is a domain (only of interest in systems AMG)
> >> > 2 ....
> >> >
> >> > I could not find how you define the nodal displacement ordering. But
> >> it
> >> > should be there somewhere.
> >> >
> >> > I read the reference manual for hypre 2.0
> >> >
> >> > With best regards, Shaman Mahmoudi
> >> >
> >> >
> >> > On Apr 13, 2007, at 1:40 PM, Nicolas Bathfield wrote:
> >> >
> >> > > Dear Shaman,
> >> > >
> >> > > As far as I could understand, there is a BoomerAMG?s systems AMG
> >> version
> >> > > available. This seems to be exactly what I am looking for, but I
> >> just
> >> > > don't know how to access it, either through PETSc or directly.
> >> > >
> >> > > Best regards,
> >> > >
> >> > > Nicolas
> >> > >
> >> > > > Hi,
> >> > > >
> >> > > > You want to exploit the structure of the model?
> >> > > > As far as I know, boomeramg can not treat a set of rows or blocks
> >> as
> >> > > > a molecule,  a so called block-smoother?
> >> > > > ML 2.0 smoothed aggregation does support it.
> >> > > >
> >> > > > With best regards, Shaman Mahmoudi
> >> > > >
> >> > > > On Apr 13, 2007, at 10:45 AM, Nicolas Bathfield wrote:
> >> > > >
> >> > > > > Hi,
> >> > > > >
> >> > > > > I am solving the Navier-stokes equations and try to use Hypre as
> >> > > > > preconditioner.
> >> > > > > Until now, I used PETSc as non-segregated solver and it worked
> >> > > > > perfectly.
> >> > > > > Things got worse when I decided to use Boomeramg (Hypre).
> >> > > > > As I solve a system of PDEs,  each cell is represented by 5 rows
> >> in my
> >> > > > > matrix (I solve for 5 variables). PETSc handles that without
> >> problem
> >> > > > > apparently, but the coarsening scheme of Boomeramg needs more
> >> input in
> >> > > > > order to work properly.
> >> > > > >
> >> > > > > Is there an option in PETSc to tell HYPRE that we are dealing
> >> with a
> >> > > > > system of PDEs? (something like:  -pc_hypre_boomeramg_...)
> >> > > > >
> >> > > > >
> >> > > > > Thanks for your help.
> >> > > > >
> >> > > > > Best regards,
> >> > > > >
> >> > > > > Nicolas
> >> > > > >
> >> > > > >
> >> > > > > --
> >> > > > > Nicolas BATHFIELD
> >> > > > > Chalmers University of Technology
> >> > > > > Shipping and Marine Technology
> >> > > > > phone: +46 (0)31 772 1476
> >> > > > > fax:   +46 (0)31 772 3699
> >> > > > >
> >> > > >
> >> > > >
> >> > >
> >> > >
> >> > > --
> >> > > Nicolas BATHFIELD
> >> > > Chalmers University of Technology
> >> > > Shipping and Marine Technology
> >> > > phone: +46 (0)31 772 1476
> >> > > fax:   +46 (0)31 772 3699
> >> > >
> >> >
> >>
>
>
>

```