/[escript]/branches/diaplayground/ripley/src/RipleySystemMatrix.h
ViewVC logotype

Diff of /branches/diaplayground/ripley/src/RipleySystemMatrix.h

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

revision 5064 by caltinay, Thu May 15 07:00:46 2014 UTC revision 5065 by caltinay, Fri Jun 20 05:49:52 2014 UTC
# Line 22  Line 22 
22    
23  #include <ripley/Ripley.h>  #include <ripley/Ripley.h>
24    
25    namespace cusp {
26    template <typename IndexType, typename ValueType, class MemorySpace> class dia_matrix;
27    }
28    
29    namespace escript {
30    class SolverBuddy;
31    }
32    
33    #ifdef USE_CUDA
34    #define THRUST_DEVICE_SYSTEM THRUST_DEVICE_SYSTEM_CUDA
35    #elif defined _OPENMP
36    #define THRUST_DEVICE_SYSTEM THRUST_DEVICE_SYSTEM_OMP
37    #else
38    #define THRUST_DEVICE_SYSTEM THRUST_DEVICE_SYSTEM_CPP
39    #endif
40    
41    #include <cusp/dia_matrix.h>
42    
43  namespace ripley {  namespace ripley {
44    
45    typedef cusp::dia_matrix<int, double, cusp::host_memory> HostMatrixType;
46    typedef cusp::dia_matrix<int, double, cusp::device_memory> DeviceMatrixType;
47    typedef cusp::array1d<double, cusp::host_memory> HostVectorType;
48    typedef cusp::array1d<double, cusp::device_memory> DeviceVectorType;
49    
50  class SystemMatrix : public escript::AbstractSystemMatrix  class SystemMatrix : public escript::AbstractSystemMatrix
51  {  {
52  public:  public:
   
53      SystemMatrix();      SystemMatrix();
54    
55      SystemMatrix(int blocksize, const escript::FunctionSpace& fs,      SystemMatrix(int blocksize, const escript::FunctionSpace& fs,
# Line 52  public: Line 74  public:
74      inline int getBlockSize() const { return getRowBlockSize(); }      inline int getBlockSize() const { return getRowBlockSize(); }
75    
76  private:  private:
77      void cg(double* x, const double* b) const;      template<class LinearOperator, class Vector>
78        void runSolver(LinearOperator& A, Vector& x, Vector& b,
79                       escript::SolverBuddy& sb) const;
80    
81      virtual void setToSolution(escript::Data& out, escript::Data& in,      virtual void setToSolution(escript::Data& out, escript::Data& in,
82                                 boost::python::object& options) const;                                 boost::python::object& options) const;
83    
84      virtual void ypAx(escript::Data& y, escript::Data& x) const;      virtual void ypAx(escript::Data& y, escript::Data& x) const;
85    
86      int numRows;      HostMatrixType mat;
87      std::vector<int> offsets;      //int numRows;
88      std::vector<double> values;      //std::vector<int> offsets;
89        //std::vector<double> values;
90  };  };
91    
92  } // namespace ripley  } // namespace ripley

Legend:
Removed from v.5064  
changed lines
  Added in v.5065

  ViewVC Help
Powered by ViewVC 1.1.26