/[escript]/branches/trilinos_from_5897/trilinoswrap/src/TrilinosMatrixAdapter.h
ViewVC logotype

Diff of /branches/trilinos_from_5897/trilinoswrap/src/TrilinosMatrixAdapter.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 5913 by caltinay, Mon Feb 8 06:44:52 2016 UTC revision 5914 by caltinay, Wed Feb 10 06:15:12 2016 UTC
# Line 20  Line 20 
20  #include <escript/AbstractSystemMatrix.h>  #include <escript/AbstractSystemMatrix.h>
21  #include <escript/FunctionSpace.h>  #include <escript/FunctionSpace.h>
22    
23    #include <BelosSolverManager.hpp>
24  #include <Tpetra_CrsGraph.hpp>  #include <Tpetra_CrsGraph.hpp>
25  #include <Tpetra_CrsMatrix.hpp>  #include <Tpetra_CrsMatrix.hpp>
26    
27  namespace escript {  namespace escript {
28  class SolverBuddy;      class SolverBuddy;
29  }  }
30    
31  namespace esys_trilinos {  namespace esys_trilinos {
32    
33  /// Scalar Type  /// Scalar type
34  typedef double  ST;  typedef double  ST;
35  /// Global Ordinal Type  /// Global Ordinal type
36  typedef index_t GO;  typedef index_t GO;
37  /// Local Ordinal Type  /// Local Ordinal type
38  typedef index_t LO;  typedef index_t LO;
39    /// Kokkos Node type
40  typedef std::vector<GO> IndexVector;  #ifdef _OPENMP
41  typedef Tpetra::CrsGraph<LO,GO> GraphType;  typedef Kokkos::Compat::KokkosOpenMPWrapperNode NT;
42  typedef Tpetra::CrsMatrix<ST,LO,GO> MatrixType;  #elif USE_CUDA
43  typedef MatrixType::map_type MapType;  typedef Kokkos::Compat::KokkosCudaWrapperNode NT;
44  typedef Tpetra::MultiVector<ST,LO,GO> VectorType;  #else
45  typedef Tpetra::Import<LO,GO> ImportType;  typedef Kokkos::Compat::KokkosSerialWrapperNode NT;
46    #endif
47    
48    typedef Tpetra::CrsGraph<LO,GO,NT>                 GraphType;
49    typedef Tpetra::CrsMatrix<ST,LO,GO,NT>             MatrixType;
50    typedef Tpetra::MultiVector<ST,LO,GO,NT>           VectorType;
51    typedef Tpetra::Operator<ST,LO,GO,NT>              OpType;
52    typedef Belos::LinearProblem<ST,VectorType,OpType> ProblemType;
53    typedef Belos::SolverManager<ST,VectorType,OpType> SolverType;
54    typedef MatrixType::map_type                       MapType;
55    typedef Tpetra::Import<LO,GO,NT>                   ImportType;
56    
57  typedef Teuchos::RCP<MapType> TrilinosMap_ptr;  typedef Teuchos::RCP<MapType> TrilinosMap_ptr;
58  typedef Teuchos::RCP<const MapType> const_TrilinosMap_ptr;  typedef Teuchos::RCP<const MapType> const_TrilinosMap_ptr;
# Line 49  typedef Teuchos::RCP<const MapType> cons Line 60  typedef Teuchos::RCP<const MapType> cons
60  typedef Teuchos::RCP<GraphType> TrilinosGraph_ptr;  typedef Teuchos::RCP<GraphType> TrilinosGraph_ptr;
61  typedef Teuchos::RCP<const GraphType> const_TrilinosGraph_ptr;  typedef Teuchos::RCP<const GraphType> const_TrilinosGraph_ptr;
62    
63    
64  inline  inline
65  Teuchos::RCP<const Teuchos::Comm<int> > TeuchosCommFromEsysComm(MPI_Comm comm)  Teuchos::RCP<const Teuchos::Comm<int> > TeuchosCommFromEsysComm(MPI_Comm comm)
66  {  {
# Line 83  public: Line 95  public:
95      /// notifies the matrix that a set of changes has occured.      /// notifies the matrix that a set of changes has occured.
96      void fillComplete(bool localOnly = true);      void fillComplete(bool localOnly = true);
97    
98      void add(const IndexVector& rowIndex, const std::vector<double>& array);      void add(const std::vector<LO>& rowIndex, const std::vector<double>& array);
99    
100      inline int getBlockSize() const { return getRowBlockSize(); }      inline int getBlockSize() const { return getRowBlockSize(); }
101    
102  private:  private:
103        Teuchos::RCP<OpType> createPreconditioner(
104                                            const escript::SolverBuddy& sb) const;
105    
106        Teuchos::RCP<SolverType> createSolver(const escript::SolverBuddy& sb) const;
107    
108      virtual void setToSolution(escript::Data& out, escript::Data& in,      virtual void setToSolution(escript::Data& out, escript::Data& in,
109                                 boost::python::object& options) const;                                 boost::python::object& options) const;
110    

Legend:
Removed from v.5913  
changed lines
  Added in v.5914

  ViewVC Help
Powered by ViewVC 1.1.26