Stratimikos Version of the Day
Loading...
Searching...
No Matches
Thyra_AztecOOLinearOpWithSolveFactory.hpp
1// @HEADER
2// *****************************************************************************
3// Stratimikos: Thyra-based strategies for linear solvers
4//
5// Copyright 2006 NTESS and the Stratimikos contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef THYRA_AZTECOO_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
11#define THYRA_AZTECOO_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
12
13#include "Thyra_LinearOpWithSolveFactoryBase.hpp"
14#include "Thyra_EpetraOperatorViewExtractorBase.hpp"
15#include "Teuchos_StandardMemberCompositionMacros.hpp"
16#include "Teuchos_StandardCompositionMacros.hpp"
17
18
19namespace Teuchos { class ParameterList; }
20
21
22namespace Thyra {
23
24
47class AztecOOLinearOpWithSolveFactory : public LinearOpWithSolveFactoryBase<double> {
48public:
49
52
55 Teuchos::RCP<Teuchos::ParameterList> const& paramList = Teuchos::null
56 );
57
66 STANDARD_COMPOSITION_MEMBERS( EpetraOperatorViewExtractorBase, epetraFwdOpViewExtractor );
67
69
76 const Teuchos::RCP<PreconditionerFactoryBase<double> > &precFactory,
77 const std::string &precFactoryName
78 );
80 Teuchos::RCP<PreconditionerFactoryBase<double> > getPreconditionerFactory() const;
83 Teuchos::RCP<PreconditionerFactoryBase<double> > *precFactory,
84 std::string *precFactoryName
85 );
87 bool isCompatible( const LinearOpSourceBase<double> &fwdOpSrc ) const;
89 Teuchos::RCP<LinearOpWithSolveBase<double> > createOp() const;
91 void initializeOp(
92 const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc,
93 LinearOpWithSolveBase<double> *Op,
94 const ESupportSolveUse supportSolveUse
95 ) const;
98 const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc,
99 LinearOpWithSolveBase<double> *Op
100 ) const;
102 void uninitializeOp(
103 LinearOpWithSolveBase<double> *Op,
104 Teuchos::RCP<const LinearOpSourceBase<double> > *fwdOpSrc,
105 Teuchos::RCP<const PreconditionerBase<double> > *prec,
106 Teuchos::RCP<const LinearOpSourceBase<double> > *approxFwdOpSrc,
107 ESupportSolveUse *supportSolveUse
108 ) const;
110 bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const;
113 const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc,
114 const Teuchos::RCP<const PreconditionerBase<double> > &prec,
115 LinearOpWithSolveBase<double> *Op,
116 const ESupportSolveUse supportSolveUse
117 ) const;
120 const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc,
121 const Teuchos::RCP<const LinearOpSourceBase<double> > &approxFwdOpSrc,
122 LinearOpWithSolveBase<double> *Op,
123 const ESupportSolveUse supportSolveUse
124 ) const;
126
129
131 void setParameterList(Teuchos::RCP<Teuchos::ParameterList> const& paramList);
133 Teuchos::RCP<Teuchos::ParameterList> getNonconstParameterList();
135 Teuchos::RCP<Teuchos::ParameterList> unsetParameterList();
137 Teuchos::RCP<const Teuchos::ParameterList> getParameterList() const;
139 Teuchos::RCP<const Teuchos::ParameterList> getValidParameters() const;
140
142
145
147 std::string description() const;
148
150
151private:
152
153 // /////////////////////////
154 // Private data members
155
156 Teuchos::RCP<PreconditionerFactoryBase<double> > precFactory_;
157 std::string precFactoryName_;
158 Teuchos::RCP<Teuchos::ParameterList> thisValidParamList_;
159 Teuchos::RCP<Teuchos::ParameterList> paramList_;
160
161 int defaultFwdMaxIterations_;
162 double defaultFwdTolerance_;
163 int defaultAdjMaxIterations_;
164 double defaultAdjTolerance_;
165 bool outputEveryRhs_;
166
167 bool useAztecPrec_;
168
169 // /////////////////////////
170 // Private member functions
171
172 static Teuchos::RCP<const Teuchos::ParameterList> generateAndGetValidParameters();
173 void updateThisValidParamList();
174
175 void initializeOp_impl(
176 const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc,
177 const Teuchos::RCP<const PreconditionerBase<double> > &prec,
178 const Teuchos::RCP<const LinearOpSourceBase<double> > &approxFwdOpSrc,
179 const bool reusePrec,
180 LinearOpWithSolveBase<double> *Op
181 ) const;
182
183};
184
186
187} // namespace Thyra
188
189#endif // THYRA_AZTECOO_LINEAR_OP_WITH_SOLVE_FACTORY_HPP
LinearOpWithSolveFactoryBase subclass implemented in terms of AztecOO.
void unsetPreconditionerFactory(Teuchos::RCP< PreconditionerFactoryBase< double > > *precFactory, std::string *precFactoryName)
bool isCompatible(const LinearOpSourceBase< double > &fwdOpSrc) const
void setParameterList(Teuchos::RCP< Teuchos::ParameterList > const &paramList)
Teuchos::RCP< PreconditionerFactoryBase< double > > getPreconditionerFactory() const
void initializeApproxPreconditionedOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, const Teuchos::RCP< const LinearOpSourceBase< double > > &approxFwdOpSrc, LinearOpWithSolveBase< double > *Op, const ESupportSolveUse supportSolveUse) const
STANDARD_COMPOSITION_MEMBERS(EpetraOperatorViewExtractorBase, epetraFwdOpViewExtractor)
Set the strategy object used to extract an Epetra_Operator view of an input forward operator.
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
void initializeOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, LinearOpWithSolveBase< double > *Op, const ESupportSolveUse supportSolveUse) const
void initializeAndReuseOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, LinearOpWithSolveBase< double > *Op) const
void setPreconditionerFactory(const Teuchos::RCP< PreconditionerFactoryBase< double > > &precFactory, const std::string &precFactoryName)
void uninitializeOp(LinearOpWithSolveBase< double > *Op, Teuchos::RCP< const LinearOpSourceBase< double > > *fwdOpSrc, Teuchos::RCP< const PreconditionerBase< double > > *prec, Teuchos::RCP< const LinearOpSourceBase< double > > *approxFwdOpSrc, ESupportSolveUse *supportSolveUse) const
Teuchos::RCP< Teuchos::ParameterList > getNonconstParameterList()
Teuchos::RCP< Teuchos::ParameterList > unsetParameterList()
bool supportsPreconditionerInputType(const EPreconditionerInputType precOpType) const
Teuchos::RCP< LinearOpWithSolveBase< double > > createOp() const
Teuchos::RCP< const Teuchos::ParameterList > getParameterList() const
void initializePreconditionedOp(const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, const Teuchos::RCP< const PreconditionerBase< double > > &prec, LinearOpWithSolveBase< double > *Op, const ESupportSolveUse supportSolveUse) const

Generated for Stratimikos by doxygen 1.9.8