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[])
82 MPI_Init(&argc,&argv);
88 Teuchos::ParameterList GaleriList;
90 GaleriList.set(
"n", n);
91 Teuchos::RefCountPtr<Epetra_Map> Map = Teuchos::rcp( Galeri::CreateMap64(
"Linear", Comm, GaleriList) );
92 Teuchos::RefCountPtr<Epetra_CrsMatrix> A = Teuchos::rcp( Galeri::CreateCrsMatrix(
"Minij", &*Map, GaleriList) );
95 Teuchos::RefCountPtr<Ifpack_Preconditioner> Prec;
97 Prec = Teuchos::rcp( Factory.
Create(
"point relaxation", &*A) );
98 assert (Prec != Teuchos::null);
103 Prec = Teuchos::rcp( Factory.
Create(
"point relaxation stand-alone", &*A) );
104 assert (Prec != Teuchos::null);
109 Prec = Teuchos::rcp( Factory.
Create(
"block relaxation", &*A) );
110 assert (Prec != Teuchos::null);
115 Prec = Teuchos::rcp( Factory.
Create(
"block relaxation stand-alone", &*A) );
116 assert (Prec != Teuchos::null);
121 Prec = Teuchos::rcp( Factory.
Create(
"IC", &*A) );
122 assert (Prec != Teuchos::null);
127 Prec = Teuchos::rcp( Factory.
Create(
"ICT", &*A) );
128 assert (Prec != Teuchos::null);
133 Prec = Teuchos::rcp( Factory.
Create(
"ILU", &*A) );
134 assert (Prec != Teuchos::null);
139 Prec = Teuchos::rcp( Factory.
Create(
"ILUT", &*A) );
140 assert (Prec != Teuchos::null);
145 Prec = Teuchos::rcp( Factory.
Create(
"IC stand-alone", &*A) );
146 assert (Prec != Teuchos::null);
151 Prec = Teuchos::rcp( Factory.
Create(
"ICT stand-alone", &*A) );
152 assert (Prec != Teuchos::null);
157 Prec = Teuchos::rcp( Factory.
Create(
"ILU stand-alone", &*A) );
158 assert (Prec != Teuchos::null);
163 Prec = Teuchos::rcp( Factory.
Create(
"ILUT stand-alone", &*A) );
164 assert (Prec != Teuchos::null);
169#ifdef HAVE_IFPACK_AMESOS
170 Prec = Teuchos::rcp( Factory.
Create(
"Amesos", &*A) );
171 assert (Prec != Teuchos::null);
176 Prec = Teuchos::rcp( Factory.
Create(
"Amesos stand-alone", &*A) );
177 assert (Prec != Teuchos::null);
183 Prec = Teuchos::rcp( Factory.
Create(
"Chebyshev", &*A) );
184 assert (Prec != Teuchos::null);
189 Prec = Teuchos::rcp( Factory.
Create(
"Polynomial", &*A) );
190 assert (Prec != Teuchos::null);
195 Prec = Teuchos::rcp( Factory.
Create(
"Krylov", &*A) );
196 assert (Prec != Teuchos::null);
205#if defined (HAVE_IFPACK_SUPPORTGRAPH) && defined (HAVE_IFPACK_AMESOS)
206 Prec = Teuchos::rcp( Factory.
Create(
"MSF Amesos", &*A) );
207 assert (Prec !=Teuchos::null);
217#ifdef HAVE_IFPACK_SUPPORTGRAPH
218 Prec = Teuchos::rcp( Factory.
Create(
"MSF IC", &*A) );
219 assert (Prec != Teuchos::null);
227 if (Comm.
MyPID() == 0)
228 cout <<
"Test `PrecondititonerFactory_LL.exe' passed!" << endl;
236 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[])