Thyra_AztecOOLinearOpWithSolveFactory.hpp

Go to the documentation of this file.
00001 /*@HEADER
00002 // ***********************************************************************
00003 // 
00004 //        AztecOO: An Object-Oriented Aztec Linear Solver 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_AZTECOO_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
00031 #define THYRA_AZTECOO_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
00032 
00033 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
00034 #include "Thyra_EpetraOperatorViewExtractorBase.hpp"
00035 #include "Teuchos_StandardMemberCompositionMacros.hpp"
00036 #include "Teuchos_StandardCompositionMacros.hpp"
00037 
00038 namespace Teuchos { class ParameterList; }
00039 
00040 namespace Thyra {
00041 
00075 class AztecOOLinearOpWithSolveFactory : public LinearOpWithSolveFactoryBase<double> {
00076 public:
00077 
00080 
00082    AztecOOLinearOpWithSolveFactory();
00083     
00092   STANDARD_COMPOSITION_MEMBERS( EpetraOperatorViewExtractorBase, epetraFwdOpViewExtractor )
00093 
00094   //@}
00095 
00096   
00099   bool acceptsPreconditionerFactory() const;
00101   void setPreconditionerFactory(
00102     const Teuchos::RefCountPtr<PreconditionerFactoryBase<double> >  &precFactory
00103     ,const std::string                                              &precFactoryName
00104     );
00106   Teuchos::RefCountPtr<PreconditionerFactoryBase<double> > getPreconditionerFactory() const;
00108   void unsetPreconditionerFactory(
00109     Teuchos::RefCountPtr<PreconditionerFactoryBase<double> >  *precFactory
00110     ,std::string                                              *precFactoryName
00111     );
00113   bool isCompatible( const LinearOpSourceBase<double> &fwdOpSrc ) const;
00115   Teuchos::RefCountPtr<LinearOpWithSolveBase<double> > createOp() const;
00117   void initializeOp(
00118     const Teuchos::RefCountPtr<const LinearOpSourceBase<double> >    &fwdOpSrc
00119     ,LinearOpWithSolveBase<double>                                   *Op
00120     ,const ESupportSolveUse                                           supportSolveUse
00121     ) const;
00123   void initializeAndReuseOp(
00124     const Teuchos::RefCountPtr<const LinearOpSourceBase<double> >    &fwdOpSrc
00125     ,LinearOpWithSolveBase<double>                                   *Op
00126     ) const;
00128   void uninitializeOp(
00129     LinearOpWithSolveBase<double>                               *Op
00130     ,Teuchos::RefCountPtr<const LinearOpSourceBase<double> >    *fwdOpSrc
00131     ,Teuchos::RefCountPtr<const PreconditionerBase<double> >    *prec
00132     ,Teuchos::RefCountPtr<const LinearOpSourceBase<double> >    *approxFwdOpSrc
00133     ,ESupportSolveUse                                           *supportSolveUse
00134     ) const;
00136   bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const;
00138   void initializePreconditionedOp(
00139     const Teuchos::RefCountPtr<const LinearOpSourceBase<double> >       &fwdOpSrc
00140     ,const Teuchos::RefCountPtr<const PreconditionerBase<double> >      &prec
00141     ,LinearOpWithSolveBase<double>                                      *Op
00142     ,const ESupportSolveUse                                             supportSolveUse
00143     ) const;
00145   void initializeApproxPreconditionedOp(
00146     const Teuchos::RefCountPtr<const LinearOpSourceBase<double> >       &fwdOpSrc
00147     ,const Teuchos::RefCountPtr<const LinearOpSourceBase<double> >      &approxFwdOpSrc
00148     ,LinearOpWithSolveBase<double>                                      *Op
00149     ,const ESupportSolveUse                                             supportSolveUse
00150     ) const;
00152 
00155 
00157   void setParameterList(Teuchos::RefCountPtr<Teuchos::ParameterList> const& paramList);
00159   Teuchos::RefCountPtr<Teuchos::ParameterList> getParameterList();
00161   Teuchos::RefCountPtr<Teuchos::ParameterList> unsetParameterList();
00163   Teuchos::RefCountPtr<const Teuchos::ParameterList> getParameterList() const;
00165   Teuchos::RefCountPtr<const Teuchos::ParameterList> getValidParameters() const;
00166 
00168 
00171 
00173   std::string description() const;
00174 
00176 
00177 private:
00178 
00179   // /////////////////////////
00180   // Private data members
00181 
00182   Teuchos::RefCountPtr<PreconditionerFactoryBase<double> >  precFactory_;
00183   std::string                                               precFactoryName_;
00184   Teuchos::RefCountPtr<Teuchos::ParameterList>              thisValidParamList_;
00185   Teuchos::RefCountPtr<Teuchos::ParameterList>              paramList_;
00186 
00187   int                                           defaultFwdMaxIterations_;
00188   double                                        defaultFwdTolerance_;
00189   int                                           defaultAdjMaxIterations_;
00190   double                                        defaultAdjTolerance_;
00191   bool                                          outputEveryRhs_;
00192 
00193   bool useAztecPrec_;
00194 
00195   // /////////////////////////
00196   // Private member functions
00197 
00198   static Teuchos::RefCountPtr<const Teuchos::ParameterList> generateAndGetValidParameters();
00199   void updateThisValidParamList();
00200 
00201   void initializeOp_impl(
00202     const Teuchos::RefCountPtr<const LinearOpSourceBase<double> >       &fwdOpSrc
00203     ,const Teuchos::RefCountPtr<const PreconditionerBase<double> >      &prec
00204     ,const Teuchos::RefCountPtr<const LinearOpSourceBase<double> >      &approxFwdOpSrc
00205     ,const bool                                                         reusePrec
00206     ,LinearOpWithSolveBase<double>                                      *Op
00207     ) const;
00208 
00209 };
00210 
00212 
00213 } // namespace Thyra
00214 
00215 #endif // THYRA_AZTECOO_LINEAR_OP_WITH_SOLVE_FACTORY_HPP

Generated on Thu Sep 18 12:29:57 2008 for Aztecoo/Thyra Linear Solver Adapter Software by doxygen 1.3.9.1