fei_LinProbMgr_EpetraBasic.hpp

00001 /*--------------------------------------------------------------------*/
00002 /*    Copyright 2006 Sandia Corporation.                              */
00003 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00004 /*    non-exclusive license for use of this work by or on behalf      */
00005 /*    of the U.S. Government.  Export of this program may require     */
00006 /*    a license from the United States Government.                    */
00007 /*--------------------------------------------------------------------*/
00008 
00009 #ifndef _fei_LinProbMgr_EpetraBasic_hpp_
00010 #define _fei_LinProbMgr_EpetraBasic_hpp_
00011 
00012 #include <fei_LinearProblemManager.hpp>
00013 
00014 #include <fei_Include_Trilinos.hpp>
00015 #include <fei_SharedPtr.hpp>
00016 
00017 #include <vector>
00018 
00019 class LinProbMgr_EpetraBasic : public fei::LinearProblemManager {
00020  public:
00021   LinProbMgr_EpetraBasic(MPI_Comm comm);
00022   virtual ~LinProbMgr_EpetraBasic();
00023 
00028   void setRowDistribution(const std::vector<int>& ownedGlobalRows);
00029 
00033   void setMatrixGraph(fei::SharedPtr<fei::SparseRowGraph> matrixGraph);
00034 
00037   void setMatrixValues(double scalar);
00038 
00046   void setVectorValues(double scalar, bool soln_vector);
00047 
00051   int getLocalNumRows();
00052 
00056   int getRowLength(int row);
00057 
00070   int copyOutMatrixRow(int row, int len,
00071                        double* coefs, int* indices);
00072 
00080   int insertMatrixValues(int numRows, const int* rows,
00081                          int numCols, const int* cols,
00082                          const double* const* values,
00083                          bool sum_into);
00084 
00107   int insertVectorValues(int numValues,
00108                          const int* globalIndices,
00109                          const double* values,
00110                          bool sum_into,
00111                          bool soln_vector,
00112                          int vectorIndex=0);
00113 
00117   int copyOutVectorValues(int numValues,
00118                            const int* globalIndices,
00119                            double* values,
00120                            bool soln_vector,
00121                            int vectorIndex=0);
00122 
00128   double* getLocalVectorValuesPtr(bool soln_vector,
00129                                   int vectorIndex=0);
00130 
00136   int globalAssemble();
00137 
00140   fei::SharedPtr<Epetra_CrsMatrix> get_A_matrix();
00141 
00144   fei::SharedPtr<Epetra_MultiVector> get_rhs_vector();
00145 
00148   fei::SharedPtr<Epetra_MultiVector> get_solution_vector();
00149 
00150  private:
00151   MPI_Comm comm_;
00152   std::vector<int> ownedRows_;
00153   fei::SharedPtr<Epetra_Comm> epetra_comm_;
00154   fei::SharedPtr<Epetra_Map> epetra_rowmap_;
00155   fei::SharedPtr<fei::SparseRowGraph> fei_srgraph_;
00156   fei::SharedPtr<Epetra_CrsGraph> crsgraph_;
00157   fei::SharedPtr<Epetra_CrsMatrix> A_;
00158   int numVectors_;
00159   fei::SharedPtr<Epetra_MultiVector> x_;
00160   fei::SharedPtr<Epetra_MultiVector> b_;
00161 };
00162 
00163 #endif // _LinProbMgr_EpetraBasic_hpp_
00164 

Generated on Tue Jul 13 09:27:45 2010 for FEI by  doxygen 1.4.7