[Trilinos-Users] Comparing ML to BoomerAMG
Travis Austin
austin at txcorp.com
Thu Jan 3 15:36:22 MST 2013
I'm looking through EpetraExt, in particular the subdirectory, hypre, and it states that the EpetraExt_HypreIJMatrix is
meant to give Hypre users access to Trilinos solvers. Is this also meant to give access to hypre preconditioners to
AztecOO? I'd assume so but I'm not quite sure how to do it and was hoping for some hints before jumping right into it.
Here are my thoughts so far. I have the following code below for using ML as a preconditioner with gmres. I need a
SetPrecOperator that takes something like MLPrec which appears to be an EpetraOperator. However, I do not see
an EpetraOperator in EpetraExt_HypreIJMatrix but I do see the following:
int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y); (**)
This can be used to apply the preconditioner so perhaps this would be what I want to use ti apply a preconditioner from
hypre? Not sure. Upon looking some more it seems that you need to write a class that extends Epetra_Operator and
has an apply of the same form as (**) above.
======================= My current code ===========================
// ---------------------------------------
// Solve the system using Krylov solvers
// ---------------------------------------
Epetra_LinearProblem problem(&A,&uh,&f);
AztecOO solver(problem);
ML_Epetra::SetDefaults("SA",MLList);ML_Epetra::SetDefaults("SA",MLList);
MLList.set("smoother: type", "Gauss-Seidel");
MLList.set("ML output", 10);
ML_Epetra::MultiLevelPreconditioner * MLPrec = NULL;
MLPrec = new ML_Epetra::MultiLevelPreconditioner(A, MLList, true);
// tell AztecOO to use this preconditioner, then solve
solver.SetPrecOperator(MLPrec);
solver.SetAztecOption(AZ_solver, AZ_gmres);
int MaxIters = 1000;
solver.Iterate(MaxIters, 1e-12);
===============================
Travis Austin, Ph.D
VP, Computational Mathematics
Tech-X Corporation
5621 Arapahoe Ave
Boulder, CO 80303
austin at txcorp.com
===============================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20130103/e2bee5cb/attachment.html
More information about the Trilinos-Users
mailing list