1 #ifndef __Teko_StratimikosFactory_hpp__
2 #define __Teko_StratimikosFactory_hpp__
6 #include "Thyra_PreconditionerFactoryBase.hpp"
7 #include "Thyra_EpetraOperatorViewExtractorBase.hpp"
8 #include "Teuchos_StandardCompositionMacros.hpp"
10 #include "Teko_RequestHandler.hpp"
11 #include "Teko_InverseLibrary.hpp"
12 #include "Teko_InverseFactory.hpp"
14 #include "Epetra_Operator.h"
32 StratimikosFactory(
const Teuchos::RCP<Stratimikos::DefaultLinearSolverBuilder> & builder,
33 const Teuchos::RCP<Teko::RequestHandler> & rh);
44 Thyra::EpetraOperatorViewExtractorBase, epetraFwdOpViewExtractor );
52 bool isCompatible(
const Thyra::LinearOpSourceBase<double> &fwdOp )
const;
58 Teuchos::RCP<Thyra::PreconditionerBase<double> >
createPrec()
const;
61 const Teuchos::RCP<
const Thyra::LinearOpSourceBase<double> > &fwdOp,
62 Thyra::PreconditionerBase<double> *prec,
63 const Thyra::ESupportSolveUse supportSolveUse
67 Thyra::PreconditionerBase<double> *prec
68 ,Teuchos::RCP<
const Thyra::LinearOpSourceBase<double> > *fwdOp
69 ,Thyra::ESupportSolveUse *supportSolveUse
79 Teuchos::RCP<Teuchos::ParameterList>
const& paramList);
103 const Teuchos::RCP<
const Thyra::LinearOpSourceBase<double> > &fwdOp,
104 Thyra::PreconditionerBase<double> *prec,
105 const Thyra::ESupportSolveUse supportSolveUse
111 const Teuchos::RCP<
const Thyra::LinearOpSourceBase<double> > &fwdOp,
112 Thyra::PreconditionerBase<double> *prec,
113 const Thyra::ESupportSolveUse supportSolveUse
119 { reqHandler_ = rh; }
124 {
return reqHandler_; }
144 Teuchos::RCP<Epetra_Operator> buildWrappedEpetraOperator(
145 const Teuchos::RCP<const Epetra_Operator> & Jac,
146 const Teuchos::RCP<Epetra_Operator> & wrapInput,
147 std::ostream & out)
const;
157 void buildStridedVectors(
const Epetra_Operator & Jac,
158 const std::vector<int> & decomp,
159 std::vector<std::vector<int> > & vars)
const;
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> builder_;
177 void addTekoToStratimikosBuilder(Stratimikos::DefaultLinearSolverBuilder & builder,
178 const std::string & stratName=
"Teko");
187 void addTekoToStratimikosBuilder(Stratimikos::DefaultLinearSolverBuilder & builder,
188 const Teuchos::RCP<Teko::RequestHandler> & rh,
189 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.
STANDARD_COMPOSITION_MEMBERS(Thyra::EpetraOperatorViewExtractorBase, epetraFwdOpViewExtractor)
Set the strategy object used to extract an Epetra_Operator view of an input forward operator...
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 initializePrec_Epetra(const Teuchos::RCP< const Thyra::LinearOpSourceBase< double > > &fwdOp, Thyra::PreconditionerBase< double > *prec, const Thyra::ESupportSolveUse supportSolveUse) const
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const ¶mList)
std::string description() const
Teuchos::RCP< Teko::RequestHandler > getRequestHandler() const