Thyra_AztecOOLinearOpWithSolveFactory.hpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
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> getParameterList();
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
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
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 }
00208
00209 #endif // THYRA_AZTECOO_LINEAR_OP_WITH_SOLVE_FACTORY_HPP