Stratimikos Package Browser (Single Doxygen Collection) Version of the Day
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 
00039 namespace Teuchos { class ParameterList; }
00040 
00041 
00042 namespace Thyra {
00043 
00044 
00067 class AztecOOLinearOpWithSolveFactory : public LinearOpWithSolveFactoryBase<double> {
00068 public:
00069 
00072 
00074    AztecOOLinearOpWithSolveFactory(
00075      Teuchos::RCP<Teuchos::ParameterList> const& paramList = Teuchos::null
00076      );
00077   
00086   STANDARD_COMPOSITION_MEMBERS( EpetraOperatorViewExtractorBase, epetraFwdOpViewExtractor );
00087 
00089 
00093   bool acceptsPreconditionerFactory() const;
00095   void setPreconditionerFactory(
00096     const Teuchos::RCP<PreconditionerFactoryBase<double> >  &precFactory,
00097     const std::string  &precFactoryName
00098     );
00100   Teuchos::RCP<PreconditionerFactoryBase<double> > getPreconditionerFactory() const;
00102   void unsetPreconditionerFactory(
00103     Teuchos::RCP<PreconditionerFactoryBase<double> > *precFactory,
00104     std::string *precFactoryName
00105     );
00107   bool isCompatible( const LinearOpSourceBase<double> &fwdOpSrc ) const;
00109   Teuchos::RCP<LinearOpWithSolveBase<double> > createOp() const;
00111   void initializeOp(
00112     const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc,
00113     LinearOpWithSolveBase<double> *Op,
00114     const ESupportSolveUse supportSolveUse
00115     ) const;
00117   void initializeAndReuseOp(
00118     const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc,
00119     LinearOpWithSolveBase<double> *Op
00120     ) const;
00122   void uninitializeOp(
00123     LinearOpWithSolveBase<double> *Op,
00124     Teuchos::RCP<const LinearOpSourceBase<double> > *fwdOpSrc,
00125     Teuchos::RCP<const PreconditionerBase<double> > *prec,
00126     Teuchos::RCP<const LinearOpSourceBase<double> > *approxFwdOpSrc,
00127     ESupportSolveUse *supportSolveUse
00128     ) const;
00130   bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const;
00132   void initializePreconditionedOp(
00133     const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc,
00134     const Teuchos::RCP<const PreconditionerBase<double> > &prec,
00135     LinearOpWithSolveBase<double> *Op,
00136     const ESupportSolveUse supportSolveUse
00137     ) const;
00139   void initializeApproxPreconditionedOp(
00140     const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc,
00141     const Teuchos::RCP<const LinearOpSourceBase<double> > &approxFwdOpSrc,
00142     LinearOpWithSolveBase<double> *Op,
00143     const ESupportSolveUse supportSolveUse
00144     ) const;
00146 
00149 
00151   void setParameterList(Teuchos::RCP<Teuchos::ParameterList> const& paramList);
00153   Teuchos::RCP<Teuchos::ParameterList> getNonconstParameterList();
00155   Teuchos::RCP<Teuchos::ParameterList> unsetParameterList();
00157   Teuchos::RCP<const Teuchos::ParameterList> getParameterList() const;
00159   Teuchos::RCP<const Teuchos::ParameterList> getValidParameters() const;
00160 
00162 
00165 
00167   std::string description() const;
00168 
00170 
00171 private:
00172 
00173   // /////////////////////////
00174   // Private data members
00175 
00176   Teuchos::RCP<PreconditionerFactoryBase<double> > precFactory_;
00177   std::string precFactoryName_;
00178   Teuchos::RCP<Teuchos::ParameterList> thisValidParamList_;
00179   Teuchos::RCP<Teuchos::ParameterList> paramList_;
00180 
00181   int defaultFwdMaxIterations_;
00182   double defaultFwdTolerance_;
00183   int defaultAdjMaxIterations_;
00184   double defaultAdjTolerance_;
00185   bool outputEveryRhs_;
00186 
00187   bool useAztecPrec_;
00188 
00189   // /////////////////////////
00190   // Private member functions
00191 
00192   static Teuchos::RCP<const Teuchos::ParameterList> generateAndGetValidParameters();
00193   void updateThisValidParamList();
00194 
00195   void initializeOp_impl(
00196     const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc,
00197     const Teuchos::RCP<const PreconditionerBase<double> > &prec,
00198     const Teuchos::RCP<const LinearOpSourceBase<double> > &approxFwdOpSrc,
00199     const bool reusePrec,
00200     LinearOpWithSolveBase<double> *Op
00201     ) const;
00202 
00203 };
00204 
00206 
00207 } // namespace Thyra
00208 
00209 #endif // THYRA_AZTECOO_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines