46 #include "Epetra_ConfigDefs.h"
49 #include "Epetra_MpiComm.h"
51 #include "Epetra_SerialComm.h"
53 #include "Epetra_Comm.h"
54 #include "Epetra_Map.h"
55 #include "Epetra_Time.h"
56 #include "Epetra_BlockMap.h"
57 #include "Epetra_MultiVector.h"
58 #include "Epetra_Vector.h"
59 #include "Epetra_Export.h"
61 #include "Galeri_Maps.h"
62 #include "Galeri_CrsMatrices.h"
65 #include "Teuchos_RefCountPtr.hpp"
78 return std::string(s);
84 return std::string(s);
89 int main(
int argc,
char *argv[]) {
92 MPI_Init(&argc,&argv);
98 int ierr=HIPS_Initialize(1);
99 HIPS_ExitOnError(ierr);
101 int MyPID = Comm.
MyPID();
103 if (MyPID==0) verbose =
true;
107 GaleriList.
set(
"nx", nx);
110 GaleriList.
set(
"mx", 1);
113 Teuchos::RefCountPtr<Epetra_Map> Map =
Teuchos::rcp( Galeri::CreateMap(
"Cartesian2D", Comm, GaleriList) );
114 Teuchos::RefCountPtr<Epetra_CrsMatrix>
A =
Teuchos::rcp( Galeri::CreateCrsMatrix(
"Laplace2D", &*Map, GaleriList) );
117 LHS->PutScalar(0.0); RHS->Random();
123 Teuchos::RefCountPtr<Ifpack_HIPS> RILU;
128 List.
set(
"hips: id",0);
129 List.
set(
"hips: setup output",2);
130 List.
set(
"hips: iteration output",0);
131 List.
set(
"hips: drop tolerance",5e-3);
132 List.
set(
"hips: graph symmetric",1);
133 RILU->SetParameters(List);
145 solver.SetUserMatrix(&*A);
146 solver.SetLHS(&*LHS);
147 solver.SetRHS(&*RHS);
148 solver.SetAztecOption(AZ_solver,AZ_gmres);
149 solver.SetPrecOperator(&*RILU);
150 solver.SetAztecOption(AZ_output, 1);
151 solver.Iterate(Niters, 1.0e-8);
153 int OldIters = solver.NumIters();
162 return(EXIT_SUCCESS);
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
std::string toString(const int &x)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
int main(int argc, char *argv[])