Sierra Toolkit Version of the Day
AggregateLinearSystem.hpp
00001 /*------------------------------------------------------------------------*/
00002 /*                 Copyright 2010 Sandia Corporation.                     */
00003 /*  Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive   */
00004 /*  license for use of this work by or on behalf of the U.S. Government.  */
00005 /*  Export of this program may require a license from the                 */
00006 /*  United States Government.                                             */
00007 /*------------------------------------------------------------------------*/
00008 
00009 #ifndef stk_linsys_AggregateLinearSystem_hpp
00010 #define stk_linsys_AggregateLinearSystem_hpp
00011 
00012 #include <stk_linsys/FeiBaseIncludes.hpp>
00013 #include <stk_linsys/DofMapper.hpp>
00014 #include <stk_linsys/LinearSystemInterface.hpp>
00015 #include <stk_linsys/LinearSystem.hpp>
00016 
00017 #include <Teuchos_ParameterList.hpp>
00018 
00019 namespace stk {
00020 namespace linsys {
00021 
00032 class AggregateLinearSystem : public LinearSystemInterface {
00033  public:
00035   AggregateLinearSystem(MPI_Comm comm, fei::SharedPtr<fei::Factory> factory, size_t num_matrices, size_t num_rhsvecs);
00036 
00038   virtual ~AggregateLinearSystem();
00039 
00045   void synchronize_mappings_and_structure();
00046 
00051   void create_fei_LinearSystem();
00052 
00055   fei::SharedPtr<fei::Matrix> get_matrix(size_t index);
00056 
00059   fei::SharedPtr<fei::Vector> get_rhsvec(size_t index);
00060 
00065   void aggregate_system(const std::vector<double>& mat_scalars,
00066                         const std::vector<double>& rhs_scalars);
00067 
00075   void finalize_assembly();
00076 
00078   const DofMapper& get_DofMapper() const;
00079 
00081   DofMapper& get_DofMapper();
00082 
00084   const fei::SharedPtr<fei::MatrixGraph> get_fei_MatrixGraph() const;
00085 
00087   fei::SharedPtr<fei::MatrixGraph> get_fei_MatrixGraph();
00088 
00090   const fei::SharedPtr<fei::LinearSystem> get_fei_LinearSystem() const;
00091 
00093   fei::SharedPtr<fei::LinearSystem> get_fei_LinearSystem();
00094 
00111   int solve(int & status, const Teuchos::ParameterList & params);
00112 
00113  private:
00114 
00115   fei::SharedPtr<fei::Factory> m_fei_factory;
00116   stk::linsys::LinearSystem m_linear_system;
00117 
00118   std::vector<fei::SharedPtr<fei::Matrix> > m_matrices;
00119   std::vector<fei::SharedPtr<fei::Vector> > m_rhsvecs;
00120 };//class AggregateLinearSystem
00121 
00122 }//namespace linsys
00123 }//namespace stk
00124 
00125 #endif
00126 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends