10 #ifndef __Teko_StratimikosFactory_hpp__
11 #define __Teko_StratimikosFactory_hpp__
15 #include "Thyra_PreconditionerFactoryBase.hpp"
16 #include "Teuchos_StandardCompositionMacros.hpp"
18 #include "Teko_RequestHandler.hpp"
19 #include "Teko_InverseLibrary.hpp"
20 #include "Teko_InverseFactory.hpp"
22 #ifdef TEKO_HAVE_EPETRA
23 #include "Thyra_EpetraOperatorViewExtractorBase.hpp"
24 #include "Epetra_Operator.h"
42 StratimikosFactory(
const Teuchos::RCP<Stratimikos::DefaultLinearSolverBuilder> &builder,
43 const Teuchos::RCP<Teko::RequestHandler> &rh);
45 #ifdef TEKO_HAVE_EPETRA
54 STANDARD_COMPOSITION_MEMBERS(Thyra::EpetraOperatorViewExtractorBase, epetraFwdOpViewExtractor);
63 bool isCompatible(
const Thyra::LinearOpSourceBase<double> &fwdOp)
const;
69 Teuchos::RCP<Thyra::PreconditionerBase<double> >
createPrec()
const;
71 void initializePrec(
const Teuchos::RCP<
const Thyra::LinearOpSourceBase<double> > &fwdOp,
72 Thyra::PreconditionerBase<double> *prec,
73 const Thyra::ESupportSolveUse supportSolveUse)
const;
76 Teuchos::RCP<
const Thyra::LinearOpSourceBase<double> > *fwdOp,
77 Thyra::ESupportSolveUse *supportSolveUse)
const;
85 void setParameterList(Teuchos::RCP<Teuchos::ParameterList>
const ¶mList);
109 Thyra::PreconditionerBase<double> *prec,
110 const Thyra::ESupportSolveUse supportSolveUse)
const;
112 #ifdef TEKO_HAVE_EPETRA
115 void initializePrec_Epetra(
const Teuchos::RCP<
const Thyra::LinearOpSourceBase<double> > &fwdOp,
116 Thyra::PreconditionerBase<double> *prec,
117 const Thyra::ESupportSolveUse supportSolveUse)
const;
132 #ifdef TEKO_HAVE_EPETRA
145 Teuchos::RCP<Epetra_Operator> buildWrappedEpetraOperator(
146 const Teuchos::RCP<const Epetra_Operator> &Jac,
147 const Teuchos::RCP<Epetra_Operator> &wrapInput, std::ostream &out)
const;
157 void buildStridedVectors(
const Epetra_Operator &Jac,
const std::vector<int> &decomp,
158 std::vector<std::vector<int> > &vars)
const;
159 #endif // TEKO_HAVE_EPETRA
161 Teuchos::RCP<Teuchos::ParameterList> paramList_;
163 mutable Teuchos::RCP<Teko::InverseLibrary> invLib_;
164 mutable Teuchos::RCP<Teko::InverseFactory> invFactory_;
165 Teuchos::RCP<Teko::RequestHandler> reqHandler_;
166 mutable std::vector<int> decomp_;
167 Teuchos::RCP<Stratimikos::DefaultLinearSolverBuilder>
178 void addTekoToStratimikosBuilder(Stratimikos::DefaultLinearSolverBuilder &builder,
179 const std::string &stratName =
"Teko");
188 void addTekoToStratimikosBuilder(Stratimikos::DefaultLinearSolverBuilder &builder,
189 const Teuchos::RCP<Teko::RequestHandler> &rh,
190 const std::string &stratName =
"Teko");
bool applySupportsConj(Thyra::EConj conj) const
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
void setRequestHandler(const Teuchos::RCP< Teko::RequestHandler > &rh)
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
void initializePrec(const Teuchos::RCP< const Thyra::LinearOpSourceBase< double > > &fwdOp, Thyra::PreconditionerBase< double > *prec, const Thyra::ESupportSolveUse supportSolveUse) const
void uninitializePrec(Thyra::PreconditionerBase< double > *prec, Teuchos::RCP< const Thyra::LinearOpSourceBase< double > > *fwdOp, Thyra::ESupportSolveUse *supportSolveUse) const
const std::vector< int > & getDecomposition() const
Get the decomposition vector in use by this factory.
bool applyTransposeSupportsConj(Thyra::EConj conj) const
Teuchos::RCP< const Teuchos::ParameterList > getParameterList() const
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
void initializePrec_Thyra(const Teuchos::RCP< const Thyra::LinearOpSourceBase< double > > &fwdOp, Thyra::PreconditionerBase< double > *prec, const Thyra::ESupportSolveUse supportSolveUse) const
bool isCompatible(const Thyra::LinearOpSourceBase< double > &fwdOp) const
Teuchos::RCP< Thyra::PreconditionerBase< double > > createPrec() const
Concrete preconditioner factory subclass based on ML.
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const ¶mList)
std::string description() const
Teuchos::RCP< Teko::RequestHandler > getRequestHandler() const