[Trilinos-Users] GMRES solver

Heroux, Mike MHeroux at csbsju.edu
Mon Sep 16 12:31:14 MDT 2013


Robert,

This particular example is intended to illustrate the situation where the user has an implicitly defined linear operator, but wants to form a explicit approximate linear operator that can be used with standard algebraic incomplete factorization preconditioners.

In this case, the operator is a trivial five-point stencil in 2D.  We don't form the sparse matrix, but just apply the action of the stencil to the input vector to produce the output vector.  The class also produces an explicitly formed tridiagonal approximation of the linear operator.  Since the tridiagonal operator provides matrix coefficients, we can use ILU or a similar incomplete factorization as the preconditioner.

I hope this helps.

Mike

From: Robert Simpson <Robert.Simpson.2 at glasgow.ac.uk<mailto:Robert.Simpson.2 at glasgow.ac.uk>>
Date: Monday, September 16, 2013 2:36 AM
To: Michael A Heroux <mheroux at csbsju.edu<mailto:mheroux at csbsju.edu>>, "trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandia.gov>" <trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandia.gov>>
Subject: Re: [Trilinos-Users] GMRES solver

Hi Mike,

That's exactly what I'm looking for, thanks.

While looking through the implementation of Poisson2dOperator, I'm confused by the implementation of the virtual function 'ApplyInverse()' - this function is simply a wrapper for the 'Apply()' function. What is the logic behind this?

Robert


On 13 Sep 2013, at 18:01, "Heroux, Mike" <MHeroux at csbsju.edu<mailto:MHeroux at csbsju.edu>> wrote:

Hi Robert,

This is something Trilinos supports very well.  You can use either GMRES
from Belos or from AztecOO (Belos is the more modern design, while AztecOO
is still widely used and very usable).  They both work with either the
Tpetra or Epetra data class packages (again Tpetra is the more modern
design, while Epetra is mature and widely used).

Tpetra and Epetra both support an abstract operator interface that permits
users to define a derived class that implements the linear operator, or
the preconditioner or both for the GMRES solver in either Belos or AztecOO.

For simplicity, I suggest you start with the AztecOO+Epetra option.  The
ramp up to understanding is quite a bit lower than Belos+Tpetra and once
you get AztecOO+Epetra work, translating to Belos+Tpetra is fairly
straightforward.

But of course the choice is yours.

For a concrete example of using AztecOO+Epetra, look in the following
example directory:

Trilinos/packages/aztecoo/example/AztecOO_UserOpUserMat

The class Poisson2dOperator is what you want to mimic.  You will need to
define the Apply operator such that your FMM operator is applied to a
vector (or more specifically a multi vector, which in your case only needs
to work with a RHS since you are using GMRES for a single RHS).  If you
also want to provide your own preconditioner, there is some illustration
of that as well.

If you want to go the route of Belos+Tpetra, let us know and I will try to
find a similar example.

One reason to go with the Belos+Tpetra option, at least at some point, is
that this path will include scalable manycore capabilities in the near
future.

Mike

On 9/13/13 2:22 AM, "Robert Simpson" <Robert.Simpson.2 at glasgow.ac.uk<mailto:Robert.Simpson.2 at glasgow.ac.uk>>
wrote:

Hi all,

This question relates to Trilinos GMRES solvers for solving the linear
system of equations Ax = b.

In the code I am developing I use an algorithm called the Fast Multipole
Method in tandem with the boundary element method. Using this algorithm,
it is possible to generate the vector Ax (where x is the solution for the
current iteration) very quickly. The algorithm never computes the matrix
A explicitly.

Looking through the Trilinos class documentation, all the GMRES classes I
have looked at so far require the matrix A to be passed in during
construction. I know that the GMRES algorithm can be written in such a
way that the vector Ax is used as an input, but I'm struggling to see if
this is possible using the Trilinos library. Does this type of GMRES
solver exist in Trilinos?

I believe that the GMRES algorithm is not too difficult to implement, so
if all else fails, I may simply code my own solver.

Many thanks for your help.

Robert Simpson
University of Glasgow





_______________________________________________
Trilinos-Users mailing list
Trilinos-Users at software.sandia.gov<mailto:Trilinos-Users at software.sandia.gov>
http://software.sandia.gov/mailman/listinfo/trilinos-users


Lecturer
School of Engineering
University of Glasgow

Tel. +44 (0)141 330 5200
R734 Rankine Building





More information about the Trilinos-Users mailing list