Stratimikos  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Thyra_BelosLinearOpWithSolve_decl.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_BELOS_LINEAR_OP_WITH_SOLVE_DECL_HPP
11 #define THYRA_BELOS_LINEAR_OP_WITH_SOLVE_DECL_HPP
12 
13 #include "Thyra_LinearOpWithSolveBase.hpp"
14 #include "Thyra_LinearOpSourceBase.hpp"
15 #include "BelosSolverManager.hpp"
16 #include "BelosThyraAdapter.hpp"
17 #include "Teuchos_StandardMemberCompositionMacros.hpp"
18 
19 
20 namespace Thyra {
21 
22 
30 template<class Scalar>
31 class BelosLinearOpWithSolve : virtual public LinearOpWithSolveBase<Scalar>
32 {
33 public:
34 
37 
42 
44 
47 
50 
90  void initialize(
92  const RCP<Teuchos::ParameterList> &solverPL,
93  const RCP<Belos::SolverManager<Scalar,MV_t,LO_t> > &iterativeSolver,
94  const RCP<const LinearOpSourceBase<Scalar> > &fwdOpSrc,
95  const RCP<const PreconditionerBase<Scalar> > &prec,
96  const bool isExternalPrec,
97  const RCP<const LinearOpSourceBase<Scalar> > &approxFwdOpSrc,
99  const int convergenceTestFrequency
100  );
101 
104 
107 
109  bool isExternalPrec() const;
110 
113 
116 
121  void uninitialize(
123  RCP<Teuchos::ParameterList> *solverPL = NULL,
124  RCP<Belos::SolverManager<Scalar,MV_t,LO_t> > *iterativeSolver = NULL,
125  RCP<const LinearOpSourceBase<Scalar> > *fwdOpSrc = NULL,
126  RCP<const PreconditionerBase<Scalar> > *prec = NULL,
127  bool *isExternalPrec = NULL,
128  RCP<const LinearOpSourceBase<Scalar> > *approxFwdOpSrc = NULL,
130  );
131 
133 
143 
147  std::string description() const;
149  void describe(
151  const Teuchos::EVerbosityLevel verbLevel
152  ) const;
154 
157 
159  void setParameterList(RCP<Teuchos::ParameterList> const& paramList);
168 
170 
171 protected:
172 
176  virtual bool opSupportedImpl(EOpTransp M_trans) const;
178  virtual void applyImpl(
179  const EOpTransp M_trans,
180  const MultiVectorBase<Scalar> &X,
181  const Ptr<MultiVectorBase<Scalar> > &Y,
182  const Scalar alpha,
183  const Scalar beta
184  ) const;
186 
190  virtual bool solveSupportsImpl(EOpTransp M_trans) const;
192  virtual bool solveSupportsNewImpl(EOpTransp transp,
193  const Ptr<const SolveCriteria<Scalar> > solveCriteria) const;
196  EOpTransp M_trans, const SolveMeasureType& solveMeasureType
197  ) const;
200  const EOpTransp transp,
201  const MultiVectorBase<Scalar> &B,
202  const Ptr<MultiVectorBase<Scalar> > &X,
203  const Ptr<const SolveCriteria<Scalar> > solveCriteria
204  ) const;
206 
207 private:
208 
209  // ///////////////////////////////
210  // Private data members
211 
212 
214  RCP<Teuchos::ParameterList> solverPL_;
216  int convergenceTestFrequency_;
217 
220  bool isExternalPrec_;
221  RCP<const LinearOpSourceBase<Scalar> > approxFwdOpSrc_;
222  ESupportSolveUse supportSolveUse_;
223 
225 
226  void assertInitialized() const;
227 
228  std::string label_, filenameLHS_, filenameRHS_;
229  mutable int counter_;
230 
231 };
232 
233 
234 } // namespace Thyra
235 
236 
237 #endif // THYRA_BELOS_LINEAR_OP_WITH_SOLVE_DECL_HPP
virtual bool solveSupportsImpl(EOpTransp M_trans) const
RCP< const VectorSpaceBase< Scalar > > domain() const
EOpTransp
RCP< const Teuchos::ParameterList > getValidParameters() const
virtual SolveStatus< Scalar > solveImpl(const EOpTransp transp, const MultiVectorBase< Scalar > &B, const Ptr< MultiVectorBase< Scalar > > &X, const Ptr< const SolveCriteria< Scalar > > solveCriteria) const
RCP< const LinearOpSourceBase< Scalar > > extract_approxFwdOpSrc()
void initialize(const RCP< Belos::LinearProblem< Scalar, MV_t, LO_t > > &lp, const RCP< Teuchos::ParameterList > &solverPL, const RCP< Belos::SolverManager< Scalar, MV_t, LO_t > > &iterativeSolver, const RCP< const LinearOpSourceBase< Scalar > > &fwdOpSrc, const RCP< const PreconditionerBase< Scalar > > &prec, const bool isExternalPrec, const RCP< const LinearOpSourceBase< Scalar > > &approxFwdOpSrc, const ESupportSolveUse &supportSolveUse, const int convergenceTestFrequency)
Initializes given precreated solver objects.
Concrete LinearOpWithSolveBase subclass in terms of Belos.
RCP< const PreconditionerBase< Scalar > > extract_prec()
virtual bool solveSupportsNewImpl(EOpTransp transp, const Ptr< const SolveCriteria< Scalar > > solveCriteria) const
RCP< const VectorSpaceBase< Scalar > > range() const
virtual void applyImpl(const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const
void setParameterList(RCP< Teuchos::ParameterList > const &paramList)
Thyra specializations of MultiVecTraits and OperatorTraits.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
ESupportSolveUse
RCP< const LinearOpSourceBase< Scalar > > extract_fwdOpSrc()
BelosLinearOpWithSolve()
Construct to unintialize.
void uninitialize(RCP< Belos::LinearProblem< Scalar, MV_t, LO_t > > *lp=NULL, RCP< Teuchos::ParameterList > *solverPL=NULL, RCP< Belos::SolverManager< Scalar, MV_t, LO_t > > *iterativeSolver=NULL, RCP< const LinearOpSourceBase< Scalar > > *fwdOpSrc=NULL, RCP< const PreconditionerBase< Scalar > > *prec=NULL, bool *isExternalPrec=NULL, RCP< const LinearOpSourceBase< Scalar > > *approxFwdOpSrc=NULL, ESupportSolveUse *supportSolveUse=NULL)
Uninitializes and returns stored quantities.
RCP< const LinearOpBase< Scalar > > clone() const
RCP< const Teuchos::ParameterList > getParameterList() const
RCP< Teuchos::ParameterList > unsetParameterList()
virtual bool opSupportedImpl(EOpTransp M_trans) const
virtual bool solveSupportsSolveMeasureTypeImpl(EOpTransp M_trans, const SolveMeasureType &solveMeasureType) const
RCP< Teuchos::ParameterList > getNonconstParameterList()

Generated on Thu Nov 21 2024 09:22:16 for Stratimikos by doxygen 1.8.5