Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

Thyra_MLPreconditionerFactory.hpp

00001 /*@HEADER
00002 // ***********************************************************************
00003 // 
00004 //       Ifpack: Object-Oriented Algebraic Preconditioner Package
00005 //                 Copyright (2002) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 //@HEADER
00028 */
00029 
00030 #ifndef THYRA_ML_PRECONDITIONER_FACTORY_DECL_HPP
00031 #define THYRA_ML_PRECONDITIONER_FACTORY_DECL_HPP
00032 
00033 
00034 #include "Thyra_PreconditionerFactoryBase.hpp"
00035 #include "Thyra_EpetraOperatorViewExtractorBase.hpp"
00036 #include "Teuchos_StandardCompositionMacros.hpp"
00037 
00038 namespace Thyra {
00039 
00040   using Teuchos::ParameterList;
00041   using Teuchos::RefCountPtr;
00042 
00044   enum EMLProblemType {ML_SmoothedAggregation, 
00045                        ML_DomainDecomposition,
00046                        ML_DomainDecompositionML,
00047                        ML_Maxwell};
00048 
00053 class MLPreconditionerFactory : public PreconditionerFactoryBase<double> {
00054 public:
00055 
00058 
00060   MLPreconditionerFactory();
00061 
00063   MLPreconditionerFactory(const RefCountPtr<ParameterList>& params);
00064 
00066   MLPreconditionerFactory(const EMLProblemType& probType,
00067                           const ParameterList& revisions=ParameterList());
00068 
00070   MLPreconditionerFactory(const std::string& probType,
00071                           const ParameterList& revisions=ParameterList());
00072     
00081   STANDARD_COMPOSITION_MEMBERS( EpetraOperatorViewExtractorBase, epetraFwdOpViewExtractor )
00082 
00083   //@}
00084 
00085   
00087 
00089   bool isCompatible( const LinearOpSourceBase<double> &fwdOp ) const;
00091   bool applySupportsConj(EConj conj) const;
00093   bool applyTransposeSupportsConj(EConj conj) const;
00095   RefCountPtr<PreconditionerBase<double> > createPrec() const;
00097   void initializePrec(
00098     const RefCountPtr<const LinearOpSourceBase<double> >    &fwdOp
00099     ,PreconditionerBase<double>                                *prec
00100     ,const ESupportSolveUse                                    supportSolveUse
00101     ) const;
00103   void uninitializePrec(
00104     PreconditionerBase<double>                          *prec
00105     ,RefCountPtr<const LinearOpSourceBase<double> >  *fwdOp
00106     ,ESupportSolveUse                                   *supportSolveUse
00107     ) const;
00108 
00110 
00113 
00115   void setParameterList(RefCountPtr<ParameterList> const& paramList);
00117   RefCountPtr<ParameterList> getParameterList();
00119   RefCountPtr<ParameterList> unsetParameterList();
00121   RefCountPtr<const ParameterList> getParameterList() const;
00123   RefCountPtr<const Teuchos::ParameterList> getValidParameters() const;
00125 
00128 
00130   std::string description() const;
00131 
00133 
00134 private:
00135 
00136   RefCountPtr<ParameterList> reviseDefaultList(const ParameterList& defaults, 
00137                                                const ParameterList& revisions) const;
00138 
00139   std::string probToString(const EMLProblemType& probType) const ;
00140 
00141   RefCountPtr<ParameterList> defaultParameters(const EMLProblemType& probType) const ;
00142 
00143   RefCountPtr<ParameterList> defaultParameters(const string& probType) const ;
00144 
00145   // ////////////////////////////////
00146   // Private data members
00147 
00148   mutable RefCountPtr<ParameterList>  validPL_;
00149   RefCountPtr<ParameterList>          paramList_;
00150 
00151 
00152   // ////////////////////////////////
00153   // Private member functions
00154 
00155   static RefCountPtr<const ParameterList> generateAndGetValidParameters();
00156 
00157 };
00158 
00159 } // namespace Thyra
00160 
00161 #endif // THYRA_ML_PRECONDITIONER_FACTORY_DECL_HPP

Generated on Thu Sep 18 12:38:47 2008 for ML to Thyra Adapter Software by  doxygen 1.3.9.1