#include "ml_config.h"
#include "ml_common.h"
#if defined(HAVE_ML_MLAPI) && defined(HAVE_ML_GALERI)
using namespace Teuchos;
int main(int argc, char *argv[])
{
#ifdef HAVE_MPI
MPI_Init(&argc,&argv);
#endif
try {
Init();
int NumGlobalElements = 100;
Space FineSpace(NumGlobalElements);
Operator FineMatrix = Gallery(
"Tridiag", FineSpace);
LHS = 0.0;
RHS = 1.0;
Teuchos::ParameterList MLList;
MLList.set("max levels",2);
MLList.set("increasing or decreasing","increasing");
MLList.set("aggregation: type", "Uncoupled");
MLList.set("aggregation: damping factor", 0.0);
MLList.set("smoother: type","symmetric Gauss-Seidel");
MLList.set("smoother: sweeps",1);
MLList.set("smoother: damping factor",1.0);
MLList.set("coarse: max size",3);
MLList.set("smoother: pre or post", "both");
MLList.set("coarse: type","Amesos-KLU");
MLList.set("krylov: solver", "gmres");
MLList.set("krylov: max iterations", 1550);
MLList.set("krylov: tolerance", 1e-9);
MLList.set("krylov: output level", 10);
Krylov(FineMatrix, LHS, RHS, Prec, MLList);
std::cout << Prec;
}
catch (const int e) {
std::cerr << "Caught exception, code = " << e << std::endl;
}
catch (...) {
std::cerr << "Caught exception..." << std::endl;
}
#ifdef HAVE_MPI
MPI_Finalize();
#endif
return(0);
}
#else
#include "ml_include.h"
int main(int argc, char *argv[])
{
#ifdef HAVE_MPI
MPI_Init(&argc,&argv);
#endif
puts("This MLAPI example requires the following configuration options:");
puts("\t--enable-epetra");
puts("\t--enable-teuchos");
puts("\t--enable-ifpack");
puts("\t--enable-amesos");
puts("\t--enable-galeri");
puts("Please check your configure line.");
#ifdef HAVE_MPI
MPI_Finalize();
#endif
return(0);
}
#endif
Overloaded operators for MultiVector's, Operator's, and InverseOpereator's.
MLAPI interface to the Galeri package.
MLAPI interface to AztecOO's solvers.
Standard smoothed aggregation multilevel preconditioner.
MLAPI wrapper for double vectors.
Basic class to define operators within MLAPI.
Class to specify the number and distribution among processes of elements.
Black-box multilevel smoothed aggregation preconditioner.
Definition MLAPI_MultiLevelSA.h:47
Basic class for distributed double-precision vectors.
Definition MLAPI_MultiVector.h:103
Operator: basic class to define operators within MLAPI.
Definition MLAPI_Operator.h:44
Specifies the number and distribution among processes of elements.
Definition MLAPI_Space.h:40
MLAPI: Default namespace for all MLAPI objects and functions.
Definition MLAPI_Aggregation.h:24
void Finalize()
Destroys the MLAPI workspace.