#include "ml_include.h"
#if defined(HAVE_ML_EPETRA) && defined(HAVE_ML_TEUCHOS) && defined(HAVE_ML_GALERI) && defined(HAVE_ML_AZTECOO)
#ifdef HAVE_MPI
#include "mpi.h"
#include "Epetra_MpiComm.h"
#else
#include "Epetra_SerialComm.h"
#endif
#include "Epetra_Map.h"
#include "Epetra_Vector.h"
#include "Epetra_VbrMatrix.h"
#include "Epetra_LinearProblem.h"
#include "AztecOO.h"
#include "Galeri_Maps.h"
#include "Galeri_CrsMatrices.h"
#include "Galeri_VbrMatrices.h"
#include "Galeri_Utils.h"
using namespace Teuchos;
using namespace Galeri;
int main(int argc, char *argv[])
{
#ifdef HAVE_MPI
MPI_Init(&argc,&argv);
#else
#endif
int NumPDEEqns = 5;
Teuchos::ParameterList GaleriList;
int nx = 32;
GaleriList.set("nx", nx);
GaleriList.set(
"ny", nx * Comm.
NumProc());
GaleriList.set("mx", 1);
GaleriList.set(
"my", Comm.
NumProc());
Epetra_Map* Map = CreateMap(
"Cartesian2D", Comm, GaleriList);
AztecOO solver(Problem);
GaleriList);
double* x_coord = (*Coord)[0];
double* y_coord = (*Coord)[1];
ParameterList MLList;
int *options = new int[AZ_OPTIONS_SIZE];
double *params = new double[AZ_PARAMS_SIZE];
MLList.set("max levels",3);
MLList.set("increasing or decreasing","increasing");
MLList.set("smoother: type", "symmetric Gauss-Seidel");
MLList.set("aggregation: type", "Uncoupled");
MLList.set("viz: output format", "vtk");
MLList.set("viz: enable", true);
MLList.set("x-coordinates", x_coord);
MLList.set("y-coordinates", y_coord);
MLList.set("z-coordinates", (double *)0);
MLList.set("viz: print starting solution", true);
delete MLPrec;
delete [] options;
delete [] params;
delete A;
delete Coord;
delete Map;
#ifdef HAVE_MPI
MPI_Finalize();
#endif
return(EXIT_SUCCESS);
}
#else
#include <stdlib.h>
#include <stdio.h>
#ifdef HAVE_MPI
#include "mpi.h"
#endif
int main(int argc, char *argv[])
{
#ifdef HAVE_MPI
MPI_Init(&argc,&argv);
#endif
puts("Please configure ML with:");
puts("--enable-epetra");
puts("--enable-teuchos");
puts("--enable-aztecoo");
puts("--enable-galeri");
#ifdef HAVE_MPI
MPI_Finalize();
#endif
return(EXIT_SUCCESS);
}
#endif
const Epetra_BlockMap & Map() const
MultiLevelPreconditioner: a class to define black-box multilevel preconditioners using aggregation me...
Definition ml_MultiLevelPreconditioner.h:241
int VisualizeSmoothers(int NumPrecCycles=1, int NumPostCycles=1)
Visualizes the effect of smoothers on a random std::vector.
Definition ml_MultiLevelPreconditioner_Viz.cpp:86
int VisualizeCycle(int NumCycles=1)
Visualizes the effect of the ML cycle on a random std::vector.
Definition ml_MultiLevelPreconditioner_Viz.cpp:120
int VisualizeAggregates()
Visualizes the shape of the aggregates.
Definition ml_MultiLevelPreconditioner_Viz.cpp:71
int SetDefaults(std::string ProblemType, Teuchos::ParameterList &List, int *options=0, double *params=0, const bool OverWrite=true)
Sets default parameters for aggregation-based preconditioners.