Stratimikos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_AmesosLinearOpWithSolve.hpp
Go to the documentation of this file.
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_AMESOS_LINEAR_OP_WITH_SOLVE_HPP
11 #define THYRA_AMESOS_LINEAR_OP_WITH_SOLVE_HPP
12 
13 #include "Thyra_LinearOpWithSolveBase.hpp"
14 #include "Thyra_LinearOpSourceBase.hpp"
16 #include "Epetra_LinearProblem.h"
17 #include "Amesos_BaseSolver.h"
18 
19 
20 namespace Thyra {
21 
22 
36 class AmesosLinearOpWithSolve : virtual public LinearOpWithSolveBase<double>
37 {
38 public:
39 
42 
45 
48  const Teuchos::RCP<const LinearOpBase<double> > &fwdOp,
49  const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc,
50  const Teuchos::RCP<Epetra_LinearProblem> &epetraLP,
51  const Teuchos::RCP<Amesos_BaseSolver> &amesosSolver,
52  const EOpTransp amesosSolverTransp,
53  const double amesosSolverScalar
54  );
55 
96  void initialize(
97  const Teuchos::RCP<const LinearOpBase<double> > &fwdOp,
98  const Teuchos::RCP<const LinearOpSourceBase<double> > &fwdOpSrc,
99  const Teuchos::RCP<Epetra_LinearProblem> &epetraLP,
100  const Teuchos::RCP<Amesos_BaseSolver> &amesosSolver,
101  const EOpTransp amesosSolverTransp,
102  const double amesosSolverScalar
103  );
104 
113 
116 
119 
122 
125 
127  EOpTransp get_amesosSolverTransp() const;
128 
130  double get_amesosSolverScalar() const;
131 
134  void uninitialize(
135  Teuchos::RCP<const LinearOpBase<double> > *fwdOp = NULL,
136  Teuchos::RCP<const LinearOpSourceBase<double> > *fwdOpSrc = NULL,
137  Teuchos::RCP<Epetra_LinearProblem> *epetraLP = NULL,
138  Teuchos::RCP<Amesos_BaseSolver> *amesosSolver = NULL,
139  EOpTransp *amesosSolverTransp = NULL,
140  double *amesosSolverScalar = NULL
141  );
142 
144 
154 
158  std::string description() const;
160  void describe(
162  const Teuchos::EVerbosityLevel verbLevel
163  ) const;
165 
166 protected:
167 
171  virtual bool opSupportedImpl(EOpTransp M_trans) const;
173  virtual void applyImpl(
174  const EOpTransp M_trans,
175  const MultiVectorBase<double> &X,
176  const Ptr<MultiVectorBase<double> > &Y,
177  const double alpha,
178  const double beta
179  ) const;
181 
185  virtual bool solveSupportsImpl(EOpTransp M_trans) const;
188  EOpTransp M_trans, const SolveMeasureType& solveMeasureType
189  ) const;
191  SolveStatus<double> solveImpl(
192  const EOpTransp M_trans,
193  const MultiVectorBase<double> &B,
194  const Ptr<MultiVectorBase<double> > &X,
195  const Ptr<const SolveCriteria<double> > solveCriteria
196  ) const;
198 
199 private:
200 
207 
208  void assertInitialized() const;
209 
210 };
211 
212 // ///////////////////////////
213 // Inline members
214 
215 inline
218 {
219  return fwdOp_;
220 }
221 
222 inline
225 {
226  return fwdOpSrc_;
227 }
228 
229 inline
232 {
233  return epetraLP_;
234 }
235 
236 inline
239 {
240  return amesosSolver_;
241 }
242 
243 inline
245 {
246  return amesosSolverTransp_;
247 }
248 
249 inline
251 {
252  return amesosSolverScalar_;
253 }
254 
255 } // namespace Thyra
256 
257 #endif // THYRA_AMESOS_LINEAR_OP_WITH_SOLVE_HPP
Teuchos::RCP< Epetra_LinearProblem > epetraLP_
Teuchos::RCP< const LinearOpSourceBase< double > > extract_fwdOpSrc()
Extract the LinearOpSourceBase&lt;double&gt; object so that it can be modified.
Teuchos::RCP< Amesos_BaseSolver > amesosSolver_
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
virtual bool opSupportedImpl(EOpTransp M_trans) const
Teuchos::RCP< Amesos_BaseSolver > get_amesosSolver() const
virtual bool solveSupportsImpl(EOpTransp M_trans) const
SolveStatus< double > solveImpl(const EOpTransp M_trans, const MultiVectorBase< double > &B, const Ptr< MultiVectorBase< double > > &X, const Ptr< const SolveCriteria< double > > solveCriteria) const
Teuchos::RCP< const VectorSpaceBase< double > > range() const
Teuchos::RCP< const LinearOpSourceBase< double > > fwdOpSrc_
virtual bool solveSupportsSolveMeasureTypeImpl(EOpTransp M_trans, const SolveMeasureType &solveMeasureType) const
void initialize(const Teuchos::RCP< const LinearOpBase< double > > &fwdOp, const Teuchos::RCP< const LinearOpSourceBase< double > > &fwdOpSrc, const Teuchos::RCP< Epetra_LinearProblem > &epetraLP, const Teuchos::RCP< Amesos_BaseSolver > &amesosSolver, const EOpTransp amesosSolverTransp, const double amesosSolverScalar)
First initialization.
Concrete LinearOpWithSolveBase subclass that adapts any Amesos_BaseSolver object. ...
Teuchos::RCP< const LinearOpBase< double > > get_fwdOp() const
void uninitialize(Teuchos::RCP< const LinearOpBase< double > > *fwdOp=NULL, Teuchos::RCP< const LinearOpSourceBase< double > > *fwdOpSrc=NULL, Teuchos::RCP< Epetra_LinearProblem > *epetraLP=NULL, Teuchos::RCP< Amesos_BaseSolver > *amesosSolver=NULL, EOpTransp *amesosSolverTransp=NULL, double *amesosSolverScalar=NULL)
Uninitialize.
Teuchos::RCP< const LinearOpSourceBase< double > > get_fwdOpSrc() const
virtual void applyImpl(const EOpTransp M_trans, const MultiVectorBase< double > &X, const Ptr< MultiVectorBase< double > > &Y, const double alpha, const double beta) const
Teuchos::RCP< const LinearOpBase< double > > fwdOp_
Teuchos::RCP< const LinearOpBase< double > > clone() const
Teuchos::RCP< Epetra_LinearProblem > get_epetraLP() const
Teuchos::RCP< const VectorSpaceBase< double > > domain() const
AmesosLinearOpWithSolve()
Construct to uninitialized.