1 #ifndef __Teko_StratimikosFactory_hpp__
2 #define __Teko_StratimikosFactory_hpp__
6 #include "Thyra_PreconditionerFactoryBase.hpp"
7 #include "Teuchos_StandardCompositionMacros.hpp"
9 #include "Teko_RequestHandler.hpp"
10 #include "Teko_InverseLibrary.hpp"
11 #include "Teko_InverseFactory.hpp"
13 #ifdef TEKO_HAVE_EPETRA
14 #include "Thyra_EpetraOperatorViewExtractorBase.hpp"
15 #include "Epetra_Operator.h"
33 StratimikosFactory(
const Teuchos::RCP<Stratimikos::DefaultLinearSolverBuilder> &builder,
34 const Teuchos::RCP<Teko::RequestHandler> &rh);
36 #ifdef TEKO_HAVE_EPETRA
45 STANDARD_COMPOSITION_MEMBERS(Thyra::EpetraOperatorViewExtractorBase, epetraFwdOpViewExtractor);
54 bool isCompatible(
const Thyra::LinearOpSourceBase<double> &fwdOp)
const;
60 Teuchos::RCP<Thyra::PreconditionerBase<double> >
createPrec()
const;
62 void initializePrec(
const Teuchos::RCP<
const Thyra::LinearOpSourceBase<double> > &fwdOp,
63 Thyra::PreconditionerBase<double> *prec,
64 const Thyra::ESupportSolveUse supportSolveUse)
const;
67 Teuchos::RCP<
const Thyra::LinearOpSourceBase<double> > *fwdOp,
68 Thyra::ESupportSolveUse *supportSolveUse)
const;
76 void setParameterList(Teuchos::RCP<Teuchos::ParameterList>
const ¶mList);
100 Thyra::PreconditionerBase<double> *prec,
101 const Thyra::ESupportSolveUse supportSolveUse)
const;
103 #ifdef TEKO_HAVE_EPETRA
106 void initializePrec_Epetra(
const Teuchos::RCP<
const Thyra::LinearOpSourceBase<double> > &fwdOp,
107 Thyra::PreconditionerBase<double> *prec,
108 const Thyra::ESupportSolveUse supportSolveUse)
const;
123 #ifdef TEKO_HAVE_EPETRA
136 Teuchos::RCP<Epetra_Operator> buildWrappedEpetraOperator(
137 const Teuchos::RCP<const Epetra_Operator> &Jac,
138 const Teuchos::RCP<Epetra_Operator> &wrapInput, std::ostream &out)
const;
148 void buildStridedVectors(
const Epetra_Operator &Jac,
const std::vector<int> &decomp,
149 std::vector<std::vector<int> > &vars)
const;
150 #endif // TEKO_HAVE_EPETRA
152 Teuchos::RCP<Teuchos::ParameterList> paramList_;
154 mutable Teuchos::RCP<Teko::InverseLibrary> invLib_;
155 mutable Teuchos::RCP<Teko::InverseFactory> invFactory_;
156 Teuchos::RCP<Teko::RequestHandler> reqHandler_;
157 mutable std::vector<int> decomp_;
158 Teuchos::RCP<Stratimikos::DefaultLinearSolverBuilder>
169 void addTekoToStratimikosBuilder(Stratimikos::DefaultLinearSolverBuilder &builder,
170 const std::string &stratName =
"Teko");
179 void addTekoToStratimikosBuilder(Stratimikos::DefaultLinearSolverBuilder &builder,
180 const Teuchos::RCP<Teko::RequestHandler> &rh,
181 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