Teko Version of the Day
Teko_MLPreconditionerFactory.hpp
00001 #ifndef __Teko_MLPrecondtionerFactory_hpp__
00002 #define __Teko_MLPrecondtionerFactory_hpp__
00003 
00004 #include "Teko_BlockPreconditionerFactory.hpp"
00005 
00006 #include "ml_include.h"
00007 #include "ml_operator.h"
00008 
00009 namespace ML_Epetra {
00010    class MultiLevelPreconditioner;
00011 }
00012 
00013 namespace Teko {
00014 
00016 class MLPreconditionerState : public BlockPreconditionerState {
00017 public:
00018    MLPreconditionerState();
00019 
00021    Teuchos::RCP<ML_Epetra::MultiLevelPreconditioner> 
00022    constructMLPreconditioner(const Teuchos::ParameterList & mainList,
00023                              const std::vector<Teuchos::RCP<const Teuchos::ParameterList> > & coarseningParams);
00024 
00025    // Set functions
00027 
00029    void setMLComm(ML_Comm * comm);
00030 
00032    void setMLOperator(ML_Operator * op);
00033 
00035    void setIsFilled(bool value);
00036 
00038    void setAggregationMatrices(const std::vector<Epetra_RowMatrix *> & diags);
00039 
00040    // Get functions
00042 
00044    bool isFilled() const;
00045 
00046 protected:
00047    static void cleanup_ML_Comm(ML_Comm * mlComm);
00048    static void cleanup_ML_Operator(ML_Operator * mlComm);
00049 
00050    bool isFilled_;
00051    Teuchos::RCP<ML_Comm> mlComm_; // note that this has to be properly clean up!
00052    Teuchos::RCP<ML_Operator> mlOp_; // note that this has to be properly clean up!
00053 
00054    std::vector<Epetra_RowMatrix*> diagonalOps_; // patterns for setting up aggregation
00055    Teuchos::RCP<ML_Epetra::MultiLevelPreconditioner> mlPreconditioner_;
00056 };
00057 
00061 class MLPreconditionerFactory : public BlockPreconditionerFactory {
00062 public:
00063    MLPreconditionerFactory();
00064 
00068    virtual LinearOp buildPreconditionerOperator(BlockedLinearOp & blo,BlockPreconditionerState & state) const;
00069 
00073    virtual Teuchos::RCP<PreconditionerState> buildPreconditionerState() const;
00074 
00078    void initializeFromParameterList(const Teuchos::ParameterList & settings);
00079 
00080 protected:
00081    
00087    void fillMLPreconditionerState(const BlockedLinearOp & blo,MLPreconditionerState & mlState) const;
00088 
00089    int blockRowCount_;
00090    std::vector<Teuchos::RCP<const Teuchos::ParameterList> > coarseningParams_;
00091    Teuchos::ParameterList mainParams_;
00092 };
00093 
00094 } // end namespace Teko
00095 
00096 #endif
 All Classes Files Functions Variables