Thyra_BelosLinearOpWithSolveFactoryDecl.hpp

00001 
00002 #ifndef THYRA_BELOS_LINEAR_OP_WITH_SOLVE_FACTORY_DECL_HPP
00003 #define THYRA_BELOS_LINEAR_OP_WITH_SOLVE_FACTORY_DECL_HPP
00004 
00005 #include "Thyra_LinearOpWithSolveFactoryBase.hpp"
00006 #include "Teuchos_StandardMemberCompositionMacros.hpp"
00007 #include "Teuchos_StandardCompositionMacros.hpp"
00008 
00009 namespace Teuchos { class ParameterList; }
00010 
00011 namespace Thyra {
00012 
00020 template<class Scalar>
00021 class BelosLinearOpWithSolveFactory : public LinearOpWithSolveFactoryBase<Scalar> {
00022 public:
00023 
00028   typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType  MagnitudeType;
00029 
00031 
00034 
00036   static const std::string  SolverType_name;
00038   static const std::string  SolverType_default;
00040   static const std::string  SolverTypes_name;
00042   static const std::string  BlockGMRES_name;
00044   static const std::string  PseudoBlockGMRES_name;
00046   static const std::string  BlockCG_name;
00047 
00049 
00052 
00054   BelosLinearOpWithSolveFactory();
00055 
00057   BelosLinearOpWithSolveFactory(
00058     const Teuchos::RCP<PreconditionerFactoryBase<Scalar> >      &precFactory
00059     );
00060 
00062 
00066   bool acceptsPreconditionerFactory() const;
00068   void setPreconditionerFactory(
00069     const Teuchos::RCP<PreconditionerFactoryBase<Scalar> >      &precFactory
00070     ,const std::string                                          &precFactoryName
00071     );
00073   Teuchos::RCP<PreconditionerFactoryBase<Scalar> > getPreconditionerFactory() const;
00075   void unsetPreconditionerFactory(
00076     Teuchos::RCP<PreconditionerFactoryBase<Scalar> >            *precFactory
00077     ,std::string                                                *precFactoryName
00078     );
00080   bool isCompatible( const LinearOpSourceBase<Scalar> &fwdOpSrc ) const;
00082   Teuchos::RCP<LinearOpWithSolveBase<Scalar> > createOp() const;
00084   void initializeOp(
00085     const Teuchos::RCP<const LinearOpSourceBase<Scalar> >       &fwdOpSrc
00086     ,LinearOpWithSolveBase<Scalar>                              *Op
00087     ,const ESupportSolveUse                                     supportSolveUse
00088     ) const;
00090   void initializeAndReuseOp(
00091     const Teuchos::RCP<const LinearOpSourceBase<Scalar> >       &fwdOpSrc
00092     ,LinearOpWithSolveBase<Scalar>                              *Op
00093     ) const;
00095   void uninitializeOp(
00096     LinearOpWithSolveBase<Scalar>                               *Op
00097     ,Teuchos::RCP<const LinearOpSourceBase<Scalar> >            *fwdOpSrc
00098     ,Teuchos::RCP<const PreconditionerBase<Scalar> >            *prec
00099     ,Teuchos::RCP<const LinearOpSourceBase<Scalar> >            *approxFwdOpSrc
00100     ,ESupportSolveUse                                           *supportSolveUse
00101     ) const;
00103   bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const;
00105   void initializePreconditionedOp(
00106     const Teuchos::RCP<const LinearOpSourceBase<Scalar> >       &fwdOpSrc
00107     ,const Teuchos::RCP<const PreconditionerBase<Scalar> >      &prec
00108     ,LinearOpWithSolveBase<Scalar>                              *Op
00109     ,const ESupportSolveUse                                     supportSolveUse
00110     ) const;
00112   void initializeApproxPreconditionedOp(
00113     const Teuchos::RCP<const LinearOpSourceBase<Scalar> >       &fwdOpSrc
00114     ,const Teuchos::RCP<const LinearOpSourceBase<Scalar> >      &approxFwdOpSrc
00115     ,LinearOpWithSolveBase<Scalar>                              *Op
00116     ,const ESupportSolveUse                                     supportSolveUse
00117     ) const;
00119 
00122 
00124   void setParameterList(Teuchos::RCP<Teuchos::ParameterList> const& paramList);
00126   Teuchos::RCP<Teuchos::ParameterList> getNonconstParameterList();
00128   Teuchos::RCP<Teuchos::ParameterList> unsetParameterList();
00130   Teuchos::RCP<const Teuchos::ParameterList> getParameterList() const;
00132   Teuchos::RCP<const Teuchos::ParameterList> getValidParameters() const;
00133 
00135 
00138 
00140   std::string description() const;
00141 
00143 
00144 private:
00145 
00146   // /////////////////////////
00147   // Private types
00148 
00149   enum ESolverType {
00150     SOLVER_TYPE_BLOCK_GMRES,
00151     SOLVER_TYPE_PSEUDO_BLOCK_GMRES,
00152     SOLVER_TYPE_BLOCK_CG,
00153     SOLVER_TYPE_GCRODR
00154   };
00155 
00156   // /////////////////////////
00157   // Private data members
00158 
00159   Teuchos::RCP<PreconditionerFactoryBase<Scalar> >  precFactory_;
00160   std::string                                       precFactoryName_;
00161   Teuchos::RCP<Teuchos::ParameterList>              thisValidParamList_;
00162   Teuchos::RCP<Teuchos::ParameterList>              paramList_;
00163   ESolverType solverType_;
00164 
00165   // /////////////////////////
00166   // Private member functions
00167 
00168   static Teuchos::RCP<const Teuchos::ParameterList> generateAndGetValidParameters();
00169 
00170   void updateThisValidParamList();
00171 
00172   void initializeOpImpl(
00173     const Teuchos::RCP<const LinearOpSourceBase<Scalar> >       &fwdOpSrc
00174     ,const Teuchos::RCP<const LinearOpSourceBase<Scalar> >      &approxFwdOpSrc
00175     ,const Teuchos::RCP<const PreconditionerBase<Scalar> >      &prec
00176     ,const bool                                                 reusePrec
00177     ,LinearOpWithSolveBase<Scalar>                              *Op
00178     ,const ESupportSolveUse                                     supportSolveUse
00179     ) const;
00180 
00181 };
00182 
00184 
00185 } // namespace Thyra
00186 
00187 #endif // THYRA_BELOS_LINEAR_OP_WITH_SOLVE_FACTORY_DECL_HPP

Generated on Wed Jul 22 12:56:30 2009 for Stratimikos by  doxygen 1.5.8