Belos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BelosGmresPolySolMgr.hpp
Go to the documentation of this file.
1 //@HEADER
2 // ************************************************************************
3 //
4 // Belos: Block Linear Solvers Package
5 // Copyright 2004 Sandia Corporation
6 //
7 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8 // the U.S. Government retains certain rights in this software.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ************************************************************************
40 //@HEADER
41 //
42 
43 #ifndef BELOS_GMRES_POLY_SOLMGR_HPP
44 #define BELOS_GMRES_POLY_SOLMGR_HPP
45 
49 
50 #include "BelosConfigDefs.hpp"
51 #include "BelosTypes.hpp"
52 
53 #include "BelosLinearProblem.hpp"
54 #include "BelosSolverManager.hpp"
55 #include "BelosGmresPolyOp.hpp"
58 #include "Teuchos_as.hpp"
59 #ifdef BELOS_TEUCHOS_TIME_MONITOR
60 #include "Teuchos_TimeMonitor.hpp"
61 #endif
62 
63 
64 namespace Belos {
65 
67 
68 
76  GmresPolySolMgrLinearProblemFailure(const std::string& what_arg) : BelosError(what_arg)
77  {}};
78 
86  GmresPolySolMgrPolynomialFailure(const std::string& what_arg) : BelosError(what_arg)
87  {}};
88 
103 //
136 //
148 
149 template<class ScalarType, class MV, class OP>
150 class GmresPolySolMgr : public SolverManager<ScalarType,MV,OP> {
151 private:
152 
158 
159 public:
160 
162 
163 
169  GmresPolySolMgr();
170 
191 
193  virtual ~GmresPolySolMgr() {};
194 
198  }
200 
202 
203 
206  const LinearProblem<ScalarType,MV,OP>& getProblem() const override {
207  return *problem_;
208  }
209 
213 
217 
224  return Teuchos::tuple(timerPoly_);
225  }
226 
228  int getNumIters() const override {
229  return numIters_;
230  }
231 
235  bool isLOADetected() const override { return loaDetected_; }
236 
238 
240 
241 
243  void setProblem( const Teuchos::RCP<LinearProblem<ScalarType,MV,OP> > &problem ) override { problem_ = problem; }
244 
246  void setParameters( const Teuchos::RCP<Teuchos::ParameterList> &params ) override;
247 
249 
251 
260  void reset( const ResetType type ) override {
261  if ((type & Belos::Problem) && ! problem_.is_null ()) {
262  problem_->setProblem ();
264  poly_dim_ = 0; // Rebuild the GMRES polynomial
265  }
266  }
267 
269 
271 
289  ReturnType solve() override;
290 
292 
295 
297  std::string description() const override;
298 
300 
301 private:
302 
303  // Linear problem.
305 
306  // Output manager.
308 
309  // Current parameter list.
312 
313  // Default solver values.
314  static constexpr int maxDegree_default_ = 25;
315  static constexpr int verbosity_default_ = Belos::Errors;
316  static constexpr const char * label_default_ = "Belos";
317  static constexpr const char * outerSolverType_default_ = "";
318  static constexpr const char * polyType_default_ = "Arnoldi";
319  static constexpr const char * orthoType_default_ = "ICGS";
320  static constexpr bool addRoots_default_ = true;
321  static constexpr bool dampPoly_default_ = false;
322  static constexpr bool randomRHS_default_ = true;
323  static constexpr std::ostream * outputStream_default_ = &std::cout;
324 
325  // Current solver values.
331  bool damp_;
332  bool addRoots_;
333  std::string polyType_;
334  std::string outerSolverType_;
335  std::string orthoType_;
336 
337  // Polynomial storage
340 
341  // Timers.
342  std::string label_;
344 
345  // Internal state variables.
346  bool isSet_;
348 
351 };
352 
353 
354 template<class ScalarType, class MV, class OP>
356  outputStream_ (Teuchos::rcp(outputStream_default_,false)),
357  polyTol_ (DefaultSolverParameters::polyTol),
358  maxDegree_ (maxDegree_default_),
359  numIters_ (0),
360  verbosity_ (verbosity_default_),
361  hasOuterSolver_ (false),
362  randomRHS_ (randomRHS_default_),
363  damp_ (dampPoly_default_),
364  addRoots_ (addRoots_default_),
365  polyType_ (polyType_default_),
366  outerSolverType_ (outerSolverType_default_),
367  orthoType_ (orthoType_default_),
368  poly_dim_ (0),
369  label_ (label_default_),
370  isSet_ (false),
371  loaDetected_ (false)
372 {}
373 
374 
375 template<class ScalarType, class MV, class OP>
379  problem_ (problem),
380  outputStream_ (Teuchos::rcp(outputStream_default_,false)),
381  polyTol_ (DefaultSolverParameters::polyTol),
382  maxDegree_ (maxDegree_default_),
383  numIters_ (0),
384  verbosity_ (verbosity_default_),
385  hasOuterSolver_ (false),
386  randomRHS_ (randomRHS_default_),
387  damp_ (dampPoly_default_),
388  addRoots_ (addRoots_default_),
389  polyType_ (polyType_default_),
390  outerSolverType_ (outerSolverType_default_),
391  orthoType_ (orthoType_default_),
392  poly_dim_ (0),
393  label_ (label_default_),
394  isSet_ (false),
395  loaDetected_ (false)
396 {
398  problem_.is_null (), std::invalid_argument,
399  "Belos::GmresPolySolMgr: The given linear problem is null. "
400  "Please call this constructor with a nonnull LinearProblem argument, "
401  "or call the constructor that does not take a LinearProblem.");
402 
403  // If the input parameter list is null, then the parameters take
404  // default values.
405  if (! pl.is_null ()) {
406  setParameters (pl);
407  }
408 }
409 
410 
411 template<class ScalarType, class MV, class OP>
414 {
415  if (validPL_.is_null ()) {
416  Teuchos::RCP<Teuchos::ParameterList> pl = Teuchos::parameterList ();
417 
418  // The static_cast is to resolve an issue with older clang versions which
419  // would cause the constexpr to link fail. With c++17 the problem is resolved.
420  pl->set("Polynomial Type", static_cast<const char *>(polyType_default_),
421  "The type of GMRES polynomial that is used as a preconditioner: Roots, Arnoldi, or Gmres.");
422  pl->set("Polynomial Tolerance", static_cast<MagnitudeType>(DefaultSolverParameters::polyTol),
423  "The relative residual tolerance that used to construct the GMRES polynomial.");
424  pl->set("Maximum Degree", static_cast<int>(maxDegree_default_),
425  "The maximum degree allowed for any GMRES polynomial.");
426  pl->set("Outer Solver", static_cast<const char *>(outerSolverType_default_),
427  "The outer solver that this polynomial is used to precondition.");
428  pl->set("Verbosity", static_cast<int>(verbosity_default_),
429  "What type(s) of solver information should be outputted\n"
430  "to the output stream.");
431  pl->set("Output Stream", Teuchos::rcp(outputStream_default_,false),
432  "A reference-counted pointer to the output stream where all\n"
433  "solver output is sent.");
434  pl->set("Timer Label", static_cast<const char *>(label_default_),
435  "The string to use as a prefix for the timer labels.");
436  pl->set("Orthogonalization", static_cast<const char *>(orthoType_default_),
437  "The type of orthogonalization to use to generate polynomial: DGKS, ICGS, or IMGS.");
438  pl->set("Random RHS", static_cast<bool>(randomRHS_default_),
439  "Add roots to polynomial for stability.");
440  pl->set("Add Roots", static_cast<bool>(addRoots_default_),
441  "Add roots to polynomial for stability.");
442  pl->set("Damp Poly", static_cast<bool>(dampPoly_default_),
443  "Damp polynomial for ill-conditioned problems.");
444  validPL_ = pl;
445  }
446  return validPL_;
447 }
448 
449 
450 template<class ScalarType, class MV, class OP>
453 {
454  // Create the internal parameter list if ones doesn't already exist.
455  if (params_.is_null ()) {
456  params_ = Teuchos::parameterList (*getValidParameters ());
457  }
458  else {
459  params->validateParameters (*getValidParameters ());
460  }
461 
462  // Check which Gmres polynomial to use
463  if (params->isParameter("Polynomial Type")) {
464  polyType_ = params->get("Polynomial Type", polyType_default_);
465  }
466 
467  // Update the outer solver in our list.
468  params_->set("Polynomial Type", polyType_);
469 
470  // Check if there is an outer solver for this Gmres Polynomial
471  if (params->isParameter("Outer Solver")) {
472  outerSolverType_ = params->get("Outer Solver", outerSolverType_default_);
473  }
474 
475  // Update the outer solver in our list.
476  params_->set("Outer Solver", outerSolverType_);
477 
478  // Check if there is a parameter list for the outer solver
479  if (params->isSublist("Outer Solver Params")) {
480  outerParams_ = Teuchos::parameterList( params->get<Teuchos::ParameterList>("Outer Solver Params") );
481  }
482 
483  // Check for maximum polynomial degree
484  if (params->isParameter("Maximum Degree")) {
485  maxDegree_ = params->get("Maximum Degree",maxDegree_default_);
486  }
487 
488  // Update parameter in our list.
489  params_->set("Maximum Degree", maxDegree_);
490 
491  // Check to see if the timer label changed.
492  if (params->isParameter("Timer Label")) {
493  std::string tempLabel = params->get("Timer Label", label_default_);
494 
495  // Update parameter in our list and solver timer
496  if (tempLabel != label_) {
497  label_ = tempLabel;
498 #ifdef BELOS_TEUCHOS_TIME_MONITOR
499  std::string polyLabel = label_ + ": GmresPolyOp creation time";
500  timerPoly_ = Teuchos::TimeMonitor::getNewCounter(polyLabel);
501 #endif
502  }
503  }
504 
505  // Update timer label
506  params_->set("Timer Label", label_);
507 
508  // Check if the orthogonalization changed.
509  if (params->isParameter("Orthogonalization")) {
510  std::string tempOrthoType = params->get("Orthogonalization",orthoType_default_);
512  // Ensure that the specified orthogonalization type is valid.
513  if (! factory.isValidName (tempOrthoType)) {
514  std::ostringstream os;
515  os << "Belos::GCRODRSolMgr: Invalid orthogonalization name \""
516  << tempOrthoType << "\". The following are valid options "
517  << "for the \"Orthogonalization\" name parameter: ";
518  factory.printValidNames (os);
519  throw std::invalid_argument (os.str());
520  }
521  if (tempOrthoType != orthoType_) {
522  orthoType_ = tempOrthoType;
523  }
524  }
525 
526  params_->set("Orthogonalization", orthoType_);
527 
528  // Check for a change in verbosity level
529  if (params->isParameter("Verbosity")) {
530  if (Teuchos::isParameterType<int>(*params,"Verbosity")) {
531  verbosity_ = params->get("Verbosity", verbosity_default_);
532  } else {
533  verbosity_ = (int)Teuchos::getParameter<Belos::MsgType>(*params,"Verbosity");
534  }
535  }
536 
537  // Update parameter in our list.
538  params_->set("Verbosity", verbosity_);
539 
540  // output stream
541  if (params->isParameter("Output Stream")) {
542  outputStream_ = Teuchos::getParameter<Teuchos::RCP<std::ostream> >(*params,"Output Stream");
543  }
544 
545  // Update parameter in our list.
546  params_->set("Output Stream", outputStream_);
547 
548  // Convergence
549  // Check for polynomial convergence tolerance
550  if (params->isParameter("Polynomial Tolerance")) {
551  if (params->isType<MagnitudeType> ("Polynomial Tolerance")) {
552  polyTol_ = params->get ("Polynomial Tolerance",
553  static_cast<MagnitudeType> (DefaultSolverParameters::polyTol));
554  }
555  else {
556  polyTol_ = params->get ("Polynomial Tolerance", DefaultSolverParameters::polyTol);
557  }
558  }
559 
560  // Update parameter in our list and residual tests.
561  params_->set("Polynomial Tolerance", polyTol_);
562 
563  // Check for maximum polynomial degree
564  if (params->isParameter("Random RHS")) {
565  randomRHS_ = params->get("Random RHS",randomRHS_default_);
566  }
567 
568  // Update parameter in our list.
569  params_->set("Random RHS", randomRHS_);
570 
571 
572  // Check for polynomial damping
573  if (params->isParameter("Damped Poly")) {
574  damp_ = params->get("Damped Poly",dampPoly_default_);
575  }
576  // Update parameter in our list.
577  params_->set("Damped Poly", damp_);
578 
579  // Check: Should we add roots for stability if needed?
580  if (params->isParameter("Add Roots")) {
581  addRoots_ = params->get("Add Roots",addRoots_default_);
582  }
583 
584  // Update parameter in our list.
585  params_->set("Add Roots", addRoots_);
586 
587  // Create the timers if we need to.
588 #ifdef BELOS_TEUCHOS_TIME_MONITOR
589  if (timerPoly_ == Teuchos::null) {
590  std::string polyLabel = label_ + ": GmresPolyOp creation time";
591  timerPoly_ = Teuchos::TimeMonitor::getNewCounter(polyLabel);
592  }
593 #endif
594 
595  // Check if we are going to perform an outer solve.
596  if (outerSolverType_ != "") {
597  hasOuterSolver_ = true;
598  }
599 
600  // Inform the solver manager that the current parameters were set.
601  isSet_ = true;
602 }
603 
604 
605 template<class ScalarType, class MV, class OP>
607 {
608  using Teuchos::RCP;
609  using Teuchos::rcp;
610  using Teuchos::rcp_const_cast;
611 
612  // Assume convergence is achieved if user does not require strict convergence.
614 
615  // Set the current parameters if they were not set before. NOTE:
616  // This may occur if the user generated the solver manager with the
617  // default constructor and then didn't set any parameters using
618  // setParameters().
619  if (! isSet_) {
620  setParameters (Teuchos::parameterList (*getValidParameters ()));
621  }
622 
624  problem_.is_null (), GmresPolySolMgrLinearProblemFailure,
625  "Belos::GmresPolySolMgr::solve: The linear problem has not been set yet, "
626  "or was set to null. Please call setProblem() with a nonnull input before "
627  "calling solve().");
628 
630  ! problem_->isProblemSet (), GmresPolySolMgrLinearProblemFailure,
631  "Belos::GmresPolySolMgr::solve: The linear problem is not ready. Please "
632  "call setProblem() on the LinearProblem object before calling solve().");
633 
634  // If the GMRES polynomial has not been constructed for this
635  // (nmatrix, preconditioner) pair, generate it.
636  if (!poly_dim_ && maxDegree_) {
637 #ifdef BELOS_TEUCHOS_TIME_MONITOR
638  Teuchos::TimeMonitor slvtimer(*timerPoly_);
639 #endif
640  poly_Op_ = Teuchos::rcp( new gmres_poly_t( problem_, params_ ) );
641  poly_dim_ = poly_Op_->polyDegree();
642 
644  "Belos::GmresPolyOp: Failed to generate polynomial that satisfied requirements.");
645  }
646 
647 
648  // Solve the linear system using the polynomial
649  if (hasOuterSolver_ && maxDegree_) {
650 
651  // Then the polynomial will be used as an operator for an outer solver.
652  // Use outer solver parameter list passed in a sublist.
654  RCP<SolverManager<ScalarType, MultiVec<ScalarType>, Operator<ScalarType> > > solver = factory.create( outerSolverType_, outerParams_ );
655  TEUCHOS_TEST_FOR_EXCEPTION( solver == Teuchos::null, std::invalid_argument,
656  "Belos::GmresPolySolMgr::solve(): Selected solver is not valid.");
657 
658  // Create a copy of the linear problem that uses the polynomial as a preconditioner.
659  // The original initial solution and right-hand side are thinly wrapped in the gmres_poly_mv_t
660  RCP<gmres_poly_mv_t> new_lhs = rcp( new gmres_poly_mv_t( problem_->getLHS() ) );
661  RCP<gmres_poly_mv_t> new_rhs = rcp( new gmres_poly_mv_t( rcp_const_cast<MV>( problem_->getRHS() ) ) );
662  RCP<gmres_poly_t> A = rcp( new gmres_poly_t( problem_ ) ); // This just performs problem_->applyOp
663  RCP<LinearProblem<ScalarType,MultiVec<ScalarType>,Operator<ScalarType> > > newProblem =
664  rcp( new LinearProblem<ScalarType,MultiVec<ScalarType>,Operator<ScalarType> >( A, new_lhs, new_rhs ) );
665  std::string solverLabel = label_ + ": Hybrid Gmres";
666  newProblem->setLabel(solverLabel);
667 
668  // If the preconditioner is left preconditioner, use Gmres poly as a left preconditioner.
669  if (problem_->getLeftPrec() != Teuchos::null)
670  newProblem->setLeftPrec( poly_Op_ );
671  else
672  newProblem->setRightPrec( poly_Op_ );
673  // Set the initial residual vector, if it has already been set in the original problem.
674  // Don't set the preconditioned residual vector, because it is not the GmresPoly preconditioned residual vector.
675  if (problem_->getInitResVec() != Teuchos::null)
676  newProblem->setInitResVec( rcp( new gmres_poly_mv_t( rcp_const_cast<MV>( problem_->getInitResVec() ) ) ) );
677  newProblem->setProblem();
678 
679  solver->setProblem( newProblem );
680 
681  ret = solver->solve();
682  numIters_ = solver->getNumIters();
683  loaDetected_ = solver->isLOADetected();
684 
685  } // if (hasOuterSolver_ && maxDegree_)
686  else if (hasOuterSolver_) {
687 
688  // There is no polynomial, just create the outer solver with the outerSolverType_ and outerParams_.
690  RCP<SolverManager<ScalarType, MV, OP> > solver = factory.create( outerSolverType_, outerParams_ );
691  TEUCHOS_TEST_FOR_EXCEPTION( solver == Teuchos::null, std::invalid_argument,
692  "Belos::GmresPolySolMgr::solve(): Selected solver is not valid.");
693 
694  solver->setProblem( problem_ );
695 
696  ret = solver->solve();
697  numIters_ = solver->getNumIters();
698  loaDetected_ = solver->isLOADetected();
699 
700  }
701  else if (maxDegree_) {
702 
703  // Apply the polynomial to the current linear system
704  poly_Op_->ApplyPoly( *problem_->getRHS(), *problem_->getLHS() );
705 
706  }
707 
708  return ret;
709 }
710 
711 
712 template<class ScalarType, class MV, class OP>
714 {
715  std::ostringstream out;
716 
717  out << "\"Belos::GmresPolySolMgr\": {"
718  << "ScalarType: " << Teuchos::TypeNameTraits<ScalarType>::name ()
719  << ", Poly Degree: " << poly_dim_
720  << ", Poly Max Degree: " << maxDegree_
721  << ", Poly Tol: " << polyTol_;
722  out << "}";
723  return out.str ();
724 }
725 
726 } // namespace Belos
727 
728 #endif // BELOS_GMRES_POLY_SOLMGR_HPP
Teuchos::RCP< const Teuchos::ParameterList > getCurrentParameters() const override
Get a parameter list containing the current parameters for this object.
Collection of types and exceptions used within the Belos solvers.
Belos::GmresPolyOp< ScalarType, MV, OP > gmres_poly_t
Teuchos::RCP< gmres_poly_t > poly_Op_
Teuchos::RCP< const Teuchos::ParameterList > validPL_
Cached default (valid) parameters.
ReturnType solve() override
This method performs possibly repeated calls to the underlying linear solver&#39;s iterate() routine unti...
virtual ~GmresPolySolMgr()
Destructor.
Defines the GMRES polynomial operator hybrid-GMRES iterative linear solver.
Belos::GmresPolyMv< ScalarType, MV > gmres_poly_mv_t
bool isLOADetected() const override
Return whether a loss of accuracy was detected by this solver during the most current solve...
static constexpr const char * label_default_
T & get(ParameterList &l, const std::string &name)
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Teuchos::Array< Teuchos::RCP< Teuchos::Time > > getTimers() const
Return the timers for this object.
static RCP< Time > getNewCounter(const std::string &name)
static constexpr int maxDegree_default_
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::RCP< Teuchos::ParameterList > outerParams_
Teuchos::RCP< Teuchos::ParameterList > params_
static const double polyTol
Relative residual tolerance for matrix polynomial construction.
Definition: BelosTypes.hpp:296
Traits class which defines basic operations on multivectors.
bool isParameter(const std::string &name) const
static constexpr std::ostream * outputStream_default_
ResetType
How to reset the solver.
Definition: BelosTypes.hpp:206
Alternative run-time polymorphic interface for operators.
GmresPolySolMgrLinearProblemFailure is thrown when the linear problem is not setup (i...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Pure virtual base class which describes the basic interface for a solver manager. ...
bool is_null(const RCP< T > &p)
Teuchos::ScalarTraits< ScalarType > STS
static constexpr bool addRoots_default_
bool isValidName(const std::string &name) const
Whether this factory recognizes the MatOrthoManager with the given name.
bool isSublist(const std::string &name) const
std::ostream & printValidNames(std::ostream &out) const
Print all recognized MatOrthoManager names to the given ostream.
const LinearProblem< ScalarType, MV, OP > & getProblem() const override
Get current linear problem being solved for in this object.
A linear system to solve, and its associated information.
Class which describes the linear problem to be solved by the iterative solver.
void setProblem(const Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > &problem) override
Set the linear problem that needs to be solved.
MultiVecTraits< ScalarType, MV > MVT
The GMRES polynomial can be created in conjunction with any standard preconditioner.
static constexpr const char * orthoType_default_
int getNumIters() const override
Get the iteration count for the most recent call to solve().
ReturnType
Whether the Belos solve converged for all linear systems.
Definition: BelosTypes.hpp:155
The Belos::SolverManager is a templated virtual base class that defines the basic interface that any ...
Belos&#39;s class for applying the GMRES polynomial operator that is used by the hybrid-GMRES linear solv...
void reset(const ResetType type) override
Reset the solver.
Teuchos::RCP< Teuchos::Time > timerPoly_
void validateParameters(ParameterList const &validParamList, int const depth=1000, EValidateUsed const validateUsed=VALIDATE_USED_ENABLED, EValidateDefaults const validateDefaults=VALIDATE_DEFAULTS_ENABLED) const
std::string description() const override
Method to return description of the hybrid block GMRES solver manager.
static constexpr bool randomRHS_default_
GmresPolySolMgrPolynomialFailure is thrown when their is a problem generating the GMRES polynomial fo...
virtual Teuchos::RCP< solver_base_type > create(const std::string &solverName, const Teuchos::RCP< Teuchos::ParameterList > &solverParams)
Create, configure, and return the specified solver.
GmresPolySolMgrPolynomialFailure(const std::string &what_arg)
void setParameters(const Teuchos::RCP< Teuchos::ParameterList > &params) override
Set the parameters the solver manager should use to solve the linear problem.
bool isType(const std::string &name) const
Teuchos::ScalarTraits< ScalarType >::magnitudeType MagnitudeType
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const override
Get a parameter list containing the valid parameters for this object.
static constexpr const char * outerSolverType_default_
Interface for multivectors used by Belos&#39; linear solvers.
Teuchos::RCP< std::ostream > outputStream_
Parent class to all Belos exceptions.
Definition: BelosTypes.hpp:60
Default parameters common to most Belos solvers.
Definition: BelosTypes.hpp:283
GmresPolySolMgr()
Empty constructor for GmresPolySolMgr. This constructor takes no arguments and sets the default value...
static constexpr bool dampPoly_default_
Belos header file which uses auto-configuration information to include necessary C++ headers...
static constexpr int verbosity_default_
Teuchos::RCP< SolverManager< ScalarType, MV, OP > > clone() const override
clone for Inverted Injection (DII)
typename::Belos::Impl::SolverFactorySelector< SC, MV, OP >::type SolverFactory
GmresPolySolMgrLinearProblemFailure(const std::string &what_arg)
static constexpr const char * polyType_default_
Teuchos::RCP< LinearProblem< ScalarType, MV, OP > > problem_
static std::string name()