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_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
00147
00148 mutable RefCountPtr<ParameterList> validPL_;
00149 RefCountPtr<ParameterList> paramList_;
00150
00151
00152
00153
00154
00155 static RefCountPtr<const ParameterList> generateAndGetValidParameters();
00156
00157 };
00158
00159 }
00160
00161 #endif // THYRA_ML_PRECONDITIONER_FACTORY_DECL_HPP