50#include "Epetra_MpiComm.h"
52#include "Epetra_SerialComm.h"
54#include "Epetra_CrsMatrix.h"
55#include "Epetra_Vector.h"
56#include "Epetra_LinearProblem.h"
57#include "Epetra_Map.h"
58#include "Galeri_Maps.h"
59#include "Galeri_CrsMatrices.h"
60 #include "Teuchos_ParameterList.hpp"
61#include "Teuchos_RefCountPtr.hpp"
65#ifdef HAVE_IFPACK_AMESOS
76int main(
int argc,
char *argv[])
79 MPI_Init(&argc,&argv);
85 Teuchos::ParameterList GaleriList;
87 GaleriList.set(
"n", n);
88 Teuchos::RefCountPtr<Epetra_Map> Map = Teuchos::rcp( Galeri::CreateMap(
"Linear", Comm, GaleriList) );
89 Teuchos::RefCountPtr<Epetra_CrsMatrix> A = Teuchos::rcp( Galeri::CreateCrsMatrix(
"Minij", &*Map, GaleriList) );
92 Teuchos::RefCountPtr<Ifpack_Preconditioner> Prec;
94 Prec = Teuchos::rcp( Factory.
Create(
"point relaxation", &*A) );
95 assert (Prec != Teuchos::null);
100 Prec = Teuchos::rcp( Factory.
Create(
"point relaxation stand-alone", &*A) );
101 assert (Prec != Teuchos::null);
106 Prec = Teuchos::rcp( Factory.
Create(
"block relaxation", &*A) );
107 assert (Prec != Teuchos::null);
112 Prec = Teuchos::rcp( Factory.
Create(
"block relaxation stand-alone", &*A) );
113 assert (Prec != Teuchos::null);
118 Prec = Teuchos::rcp( Factory.
Create(
"IC", &*A) );
119 assert (Prec != Teuchos::null);
124 Prec = Teuchos::rcp( Factory.
Create(
"ICT", &*A) );
125 assert (Prec != Teuchos::null);
130 Prec = Teuchos::rcp( Factory.
Create(
"ILU", &*A) );
131 assert (Prec != Teuchos::null);
136 Prec = Teuchos::rcp( Factory.
Create(
"ILUT", &*A) );
137 assert (Prec != Teuchos::null);
142 Prec = Teuchos::rcp( Factory.
Create(
"IC stand-alone", &*A) );
143 assert (Prec != Teuchos::null);
148 Prec = Teuchos::rcp( Factory.
Create(
"ICT stand-alone", &*A) );
149 assert (Prec != Teuchos::null);
154 Prec = Teuchos::rcp( Factory.
Create(
"ILU stand-alone", &*A) );
155 assert (Prec != Teuchos::null);
160 Prec = Teuchos::rcp( Factory.
Create(
"ILUT stand-alone", &*A) );
161 assert (Prec != Teuchos::null);
166#ifdef HAVE_IFPACK_AMESOS
167 Prec = Teuchos::rcp( Factory.
Create(
"Amesos", &*A) );
168 assert (Prec != Teuchos::null);
173 Prec = Teuchos::rcp( Factory.
Create(
"Amesos stand-alone", &*A) );
174 assert (Prec != Teuchos::null);
180 Prec = Teuchos::rcp( Factory.
Create(
"Chebyshev", &*A) );
181 assert (Prec != Teuchos::null);
186 Prec = Teuchos::rcp( Factory.
Create(
"Polynomial", &*A) );
187 assert (Prec != Teuchos::null);
192 Prec = Teuchos::rcp( Factory.
Create(
"Krylov", &*A) );
193 assert (Prec != Teuchos::null);
202#if defined (HAVE_IFPACK_SUPPORTGRAPH) && defined (HAVE_IFPACK_AMESOS)
203 Prec = Teuchos::rcp( Factory.
Create(
"MSF Amesos", &*A) );
204 assert (Prec !=Teuchos::null);
214#ifdef HAVE_IFPACK_SUPPORTGRAPH
215 Prec = Teuchos::rcp( Factory.
Create(
"MSF IC", &*A) );
216 assert (Prec != Teuchos::null);
224 if (Comm.
MyPID() == 0)
225 cout <<
"Test `PrecondititonerFactory.exe' passed!" << endl;
233 return(EXIT_SUCCESS);
#define IFPACK_CHK_ERR(ifpack_err)
static Ifpack_Preconditioner * Create(EPrecType PrecType, Epetra_RowMatrix *Matrix, const int overlap=0, bool overrideSerialDefault=false)
Creates an instance of Ifpack_Preconditioner given the enum value of the preconditioner type (can not...
int main(int argc, char *argv[])