57 #ifdef HAVE_IFPACK_AMESOS
60 #ifdef HAVE_IFPACK_HIPS
63 #ifdef HAVE_IFPACK_SUPERLU
66 #ifdef HAVE_IFPACK_SUPPORTGRAPH
76 #include "Teuchos_CommandLineProcessor.hpp"
77 #include "Teuchos_StringToIntMap.hpp"
78 #include "Epetra_CrsMatrix.h"
94 ,POINT_RELAXATION_STAND_ALONE
96 ,BLOCK_RELAXATION_STAND_ALONE
97 ,BLOCK_RELAXATION_STAND_ALONE_ILU
98 ,BLOCK_RELAXATION_STAND_ALONE_ILUT
99 ,BLOCK_RELAXATION_STAND_ALONE_IC
100 #ifdef HAVE_IFPACK_SUPERLU
101 ,BLOCK_RELAXATION_STAND_ALONE_SILU
103 #ifdef HAVE_IFPACK_AMESOS
104 ,BLOCK_RELAXATION_STAND_ALONE_AMESOS
105 ,BLOCK_RELAXATION_AMESOS
108 #endif // HAVE_IFPACK_AMESOS
117 #ifdef HAVE_IFPACK_SPARSKIT
119 #endif // HAVE_IFPACK_SPARSKIT
120 #ifdef HAVE_IFPACK_HIPS
126 #ifdef HAVE_IFPACK_SUPERLU
129 #if defined (HAVE_IFPACK_SUPPORTGRAPH) && defined (HAVE_IFPACK_AMESOS)
132 #ifdef HAVE_IFPACK_SUPPORTGRAPH
141 ,TRIDI_RELAXATION_STAND_ALONE
148 ,
"point relaxation stand-alone"
150 ,
"block relaxation stand-alone"
151 ,
"block relaxation stand-alone (ILU)"
152 ,
"block relaxation stand-alone (ILUT)"
153 ,
"block relaxation stand-alone (IC)"
154 #ifdef HAVE_IFPACK_SUPERLU
155 ,
"block relaxation stand-alone (SILU)"
157 #ifdef HAVE_IFPACK_AMESOS
158 ,
"block relaxation stand-alone (Amesos)"
159 ,
"block relaxation (Amesos)"
161 ,
"Amesos stand-alone"
171 #ifdef HAVE_IFPACK_SPARSKIT
174 #ifdef HAVE_IFPACK_HIPS
180 #ifdef HAVE_IFPACK_SUPERLU
183 #if defined (HAVE_IFPACK_SUPPORTGRAPH) && defined (HAVE_IFPACK_AMESOS)
186 #ifdef HAVE_IFPACK_SUPPORTGRAPH
195 ,
"tridi relaxation stand-alone"
208 #ifdef HAVE_IFPACK_SUPERLU
211 #ifdef HAVE_IFPACK_AMESOS
225 #ifdef HAVE_IFPACK_SPARSKIT
228 #ifdef HAVE_IFPACK_HIPS
234 #ifdef HAVE_IFPACK_SUPERLU
237 #if defined (HAVE_IFPACK_SUPPORTGRAPH) && defined (HAVE_IFPACK_AMESOS)
240 #ifdef HAVE_IFPACK_SUPPORTGRAPH
254 Epetra_RowMatrix* Matrix,
256 bool overrideSerialDefault)
258 const bool serial = (Matrix->Comm().NumProc() == 1);
262 if (serial && !overrideSerialDefault)
269 if (serial && !overrideSerialDefault)
282 #ifdef HAVE_IFPACK_SUPERLU
283 case BLOCK_RELAXATION_STAND_ALONE_SILU:
286 #ifdef HAVE_IFPACK_AMESOS
287 case BLOCK_RELAXATION_STAND_ALONE_AMESOS:
289 case BLOCK_RELAXATION_AMESOS:
293 if (serial && !overrideSerialDefault)
297 case AMESOS_STAND_ALONE:
301 if (serial && !overrideSerialDefault)
308 if (serial && !overrideSerialDefault)
315 if (serial && !overrideSerialDefault)
322 if (serial && !overrideSerialDefault)
328 #ifdef HAVE_IFPACK_SPARSKIT
330 return(
new Ifpack_SPARSKIT(Matrix));
332 #ifdef HAVE_IFPACK_HIPS
334 return(
new Ifpack_HIPS(Matrix));
338 return(
new Ifpack_Hypre(Matrix));
340 #ifdef HAVE_IFPACK_SUPERLU
342 return(
new Ifpack_SILU(Matrix));
344 #if defined (HAVE_IFPACK_SUPPORTGRAPH) && defined (HAVE_IFPACK_AMESOS)
346 if (serial && !overrideSerialDefault)
351 #ifdef HAVE_IFPACK_SUPPORTGRAPH
353 if (serial && !overrideSerialDefault)
369 #ifdef HAVE_IFPACK_EPETRAEXT
371 return(
new Ifpack_IHSS(Matrix));
373 return(
new Ifpack_SORa(Matrix));
376 if (serial && !overrideSerialDefault)
394 Epetra_RowMatrix* Matrix,
396 bool overrideSerialDefault)
399 return Ifpack::Create(Teuchos::get<EPrecType>(::precTypeNameToIntMap,PrecType),Matrix,Overlap,overrideSerialDefault);
422 std::string ifp_prec_type =
"ILU";
423 CLP.
setOption(
"ifp-prec-type",&ifp_prec_type,
"Preconditioner type");
426 CLP.
setOption(
"ifp-overlap",&ifp_overlap,
"Overlap among processors");
428 std::string ifp_relax_type =
"Jacobi";
429 CLP.
setOption(
"ifp-relax-type",&ifp_relax_type,
"Relaxation type");
431 int ifp_relax_sweeps = 1;
433 &ifp_relax_sweeps,
"Number of sweeps for relaxation");
435 double ifp_relax_damping = 1.0;
437 &ifp_relax_damping,
"Damping for relaxation");
439 std::string ifp_part_type =
"greedy";
440 CLP.
setOption(
"ifp-part-type",&ifp_part_type,
"Partitioner type");
442 int ifp_part_local = 1;
443 CLP.
setOption(
"ifp-part-local",&ifp_part_local,
"number of local partitions");
448 CLP.
parse(argc,argv);
451 PrecType = ifp_prec_type;
452 Overlap = ifp_overlap;
455 List.
set(
"relaxation: type", ifp_relax_type);
456 List.
set(
"relaxation: sweeps", ifp_relax_sweeps);
457 List.
set(
"relaxation: damping factor", ifp_relax_damping);
458 List.
set(
"partitioner: type", ifp_part_type);
459 List.
set(
"partitioner: local parts", ifp_part_local);