|
Sierra Toolkit
Version of the Day
|
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_classic { 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=1, size_t num_rhsvecs=1); 00036 00038 virtual ~AggregateLinearSystem(); 00039 00040 void set_parameters(Teuchos::ParameterList& paramlist); 00041 00043 void set_num_matrices_rhsvecs(size_t num_matrices, size_t num_rhsvecs); 00044 00050 void synchronize_mappings_and_structure(); 00051 00056 void create_fei_LinearSystem(); 00057 00060 fei::SharedPtr<fei::Matrix> get_matrix(size_t index); 00061 00064 fei::SharedPtr<fei::Vector> get_rhsvec(size_t index); 00065 00070 void aggregate_system(const std::vector<double>& mat_scalars, 00071 const std::vector<double>& rhs_scalars); 00072 00080 void finalize_assembly(); 00081 00083 const DofMapper& get_DofMapper() const; 00084 00086 DofMapper& get_DofMapper(); 00087 00088 void reset_to_zero(); 00089 00091 const fei::SharedPtr<fei::MatrixGraph> get_fei_MatrixGraph() const; 00092 00094 fei::SharedPtr<fei::MatrixGraph> get_fei_MatrixGraph(); 00095 00097 const fei::SharedPtr<fei::LinearSystem> get_fei_LinearSystem() const; 00098 00100 fei::SharedPtr<fei::LinearSystem> get_fei_LinearSystem(); 00101 00102 void write_files(const std::string& base_name) const; 00103 00122 int solve(int & status, const Teuchos::ParameterList & params); 00123 00124 private: 00125 00126 fei::SharedPtr<fei::Factory> m_fei_factory; 00127 stk_classic::linsys::LinearSystem m_linear_system; 00128 00129 std::vector<fei::SharedPtr<fei::Matrix> > m_matrices; 00130 std::vector<fei::SharedPtr<fei::Vector> > m_rhsvecs; 00131 };//class AggregateLinearSystem 00132 00133 }//namespace linsys 00134 }//namespace stk_classic 00135 00136 #endif 00137