ShyLU  Version of the Day
shylu_iterativesolver_interface_decl.hpp
1 #ifndef SHYLU_ITERATIVESOLVER_INTERFACE_DECL_HPP
2 #define SHYLU_ITERATIVESOLVER_INTERFACE_DECL_HPP
3 
4 #include "ShyLUCore_config.h"
5 
6 //ShyLU
7 #include <shylu.h>
8 #include <shylu_util.h>
9 
10 //Epetra
11 #include <Epetra_CrsMatrix.h>
12 #include <Epetra_MultiVector.h>
13 #include <Epetra_Vector.h>
14 #include <Epetra_Map.h>
15 #include <Epetra_LinearProblem.h>
16 
17 //Isorropia
18 #include <Isorropia_config.h>
19 #include <Isorropia_Epetra.hpp>
20 #include <Isorropia_EpetraProber.hpp>
21 #include <Isorropia_EpetraPartitioner.hpp>
22 #include <Isorropia_EpetraRedistributor.hpp>
23 
24 //Tperta
25 #ifdef HAVE_SHYLUCORE_TPETRA
26 #include <Tpetra_CrsMatrix_decl.hpp>
27 #include <Tpetra_CrsMatrix_def.hpp>
28 #include <BelosTpetraAdapter.hpp>
29 #endif
30 
31 //#include <Zoltan2_config.h>
32 #ifdef HAVE_SHYLUCORE_ZOLTAN2
33 #include <Zoltan2_XpetraCrsMatrixAdapter.hpp>
34 #include <Zoltan2_XpetraMultiVectorAdapter.hpp>
35 #include <Zoltan2_PartitioningProblem.hpp>
36 #endif
37 
38 #include <Teuchos_XMLParameterListHelpers.hpp>
39 
40 // Aztec
41 #include <Amesos.h>
42 #include <Amesos_BaseSolver.h>
43 
44 // Belos //May have to go back and add more
45 //#ifdef HAVE_SHYLUCORE_BELOS
46 #include <BelosConfigDefs.hpp>
47 #include <BelosSolverFactory.hpp>
48 #include <BelosLinearProblem.hpp>
49 #include <BelosBlockGmresSolMgr.hpp>
50 #include <BelosPseudoBlockGmresSolMgr.hpp>
51 //#endif
52 
53 namespace ShyLU
54 {
55 
56  template <class Matrix, class Vector>
58  {
59  //scalar type
60  /*
61 #ifdef HAVE_SHYLUCORE_TPETRA
62  typedef typename Matrix::scalar_type scalar_type;
63  typedef typename Matrix::local_ordinal_type local_ordinal_type;
64  typedef typename Matrix::global_ordinal_type global_ordinal_type;
65  typedef typename Matrix::node_type node_type;
66  typedef Tpetra::Operator<scalar_type, local_ordinal_type, global_ordinal_type, node_type> OP;
67 #else
68  //Nded to get the scaler type for the matrix
69  typedef double scalar_type;
70  typedef Teuchos::ScalarTraits<scalar_type> scalar_type_traits;
71  typedef scalar_type_traits::magnitudeType magnitude_type;
72  typedef Epetra_Operator OP;
73 #endif
74  */
75 
76 
77  public:
79 
80  //doxygen
82  IterativeSolverInterface(Matrix *inA, Teuchos::ParameterList *pList);
83  int init_matrix(Matrix *inA, Teuchos::ParameterList* pList);
84  int solve(Vector *b, Vector *x);
85 
87 
88  private:
89  //private functions ...
90  int solveAztec(Vector *b, Vector *x);
91  int solveBelos(Vector *b, Vector *x);
92 
93 
94  //private variables ..
95  Teuchos::ParameterList *pList;
96  Matrix *A;
97  int maxproc;
98 
99 
100  Epetra_LinearProblem e_problem;
101  AztecOO *solver_aztec;
102 
103 
104  //add ifdefs around this
105  //Belos::LinearProblem<scalar_type,Vector,OP> belos_problem;
106  //Belos::SolverManager<scalar_type,Vector,OP> *solver_belos;
107 
108  };
109 
110 }//end namespace ShyLU
111 
112 #endif
Utilities for ShyLU.
Main header file of ShyLU (Include main user calls)