Belos  Version of the Day
BelosSolverFactory.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 #ifndef __Belos_SolverFactory_hpp
43 #define __Belos_SolverFactory_hpp
44 
45 #include <BelosConfigDefs.hpp>
46 #include <BelosOutputManager.hpp>
47 #include <BelosSolverManager.hpp>
48 
49 #include <BelosBlockCGSolMgr.hpp>
51 #include <BelosGCRODRSolMgr.hpp>
55 #include <BelosLSQRSolMgr.hpp>
56 #include <BelosMinresSolMgr.hpp>
57 #include <BelosGmresPolySolMgr.hpp>
58 #include <BelosPCPGSolMgr.hpp>
59 #include <BelosRCGSolMgr.hpp>
60 #include <BelosTFQMRSolMgr.hpp>
63 #include <BelosBiCGStabSolMgr.hpp>
64 
65 #include <Teuchos_Array.hpp>
66 #include <Teuchos_Describable.hpp>
67 #include <Teuchos_StandardCatchMacros.hpp>
68 #include <Teuchos_TypeNameTraits.hpp>
69 
70 #include <algorithm>
71 #include <locale>
72 #include <map>
73 #include <sstream>
74 #include <stdexcept>
75 #include <vector>
76 
77 namespace Belos {
78 
79 namespace details {
80 
115 };
116 
117 } // namespace details
118 
229 template<class Scalar, class MV, class OP>
230 class SolverFactory : public Teuchos::Describable {
231 public:
238 
240  SolverFactory ();
241 
265  Teuchos::RCP<solver_base_type>
266  create (const std::string& solverName,
267  const Teuchos::RCP<Teuchos::ParameterList>& solverParams);
268 
274  int numSupportedSolvers () const;
275 
281  Teuchos::Array<std::string> supportedSolverNames () const;
282 
284  bool isSupported (const std::string& solverName) const;
285 
287 
288 
290  std::string description() const;
291 
297  void describe (Teuchos::FancyOStream& out,
298  const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const;
300 
301 private:
314  std::map<std::string, std::string> aliasToCanonicalName_;
315 
329  std::map<std::string, details::EBelosSolverType> canonicalNameToEnum_;
330 
336  void
337  reviseParameterListForAlias (const std::string& aliasName,
338  Teuchos::ParameterList& solverParams);
339 
341  Teuchos::Array<std::string> canonicalSolverNames () const;
342 
344  Teuchos::Array<std::string> solverNameAliases () const;
345 
347  static void
348  printStringArray (std::ostream& out,
349  const Teuchos::ArrayView<const std::string>& array)
350  {
351  typedef Teuchos::ArrayView<std::string>::const_iterator iter_type;
352 
353  out << "[";
354  for (iter_type iter = array.begin(); iter != array.end(); ++iter) {
355  out << "\"" << *iter << "\"";
356  if (iter + 1 != array.end()) {
357  out << ", ";
358  }
359  }
360  out << "]";
361  }
362 };
363 
364 
365 namespace details {
366 
385 template<class SolverManagerBaseType, class SolverManagerType>
386 Teuchos::RCP<SolverManagerBaseType>
387 makeSolverManagerTmpl (const Teuchos::RCP<Teuchos::ParameterList>& params);
388 
407 template<class Scalar, class MV, class OP>
408 Teuchos::RCP<SolverManager<Scalar, MV, OP> >
410  const Teuchos::RCP<Teuchos::ParameterList>& params)
411 {
412  typedef SolverManager<Scalar, MV, OP> base_type;
413 
414  switch (solverType) {
416  typedef BlockGmresSolMgr<Scalar, MV, OP> impl_type;
417  return makeSolverManagerTmpl<base_type, impl_type> (params);
418  break;
419  }
421  typedef PseudoBlockGmresSolMgr<Scalar, MV, OP> impl_type;
422  return makeSolverManagerTmpl<base_type, impl_type> (params);
423  break;
424  }
425  case SOLVER_TYPE_BLOCK_CG: {
426  typedef BlockCGSolMgr<Scalar, MV, OP> impl_type;
427  return makeSolverManagerTmpl<base_type, impl_type> (params);
428  break;
429  }
431  typedef PseudoBlockCGSolMgr<Scalar, MV, OP> impl_type;
432  return makeSolverManagerTmpl<base_type, impl_type> (params);
433  break;
434  }
435  case SOLVER_TYPE_GCRODR: {
436  typedef GCRODRSolMgr<Scalar, MV, OP> impl_type;
437  return makeSolverManagerTmpl<base_type, impl_type> (params);
438  break;
439  }
440  case SOLVER_TYPE_RCG: {
441  typedef RCGSolMgr<Scalar, MV, OP> impl_type;
442  return makeSolverManagerTmpl<base_type, impl_type> (params);
443  break;
444  }
445  case SOLVER_TYPE_MINRES: {
446  typedef MinresSolMgr<Scalar, MV, OP> impl_type;
447  return makeSolverManagerTmpl<base_type, impl_type> (params);
448  break;
449  }
450  case SOLVER_TYPE_LSQR: {
451  typedef LSQRSolMgr<Scalar, MV, OP> impl_type;
452  return makeSolverManagerTmpl<base_type, impl_type> (params);
453  break;
454  }
457  return makeSolverManagerTmpl<base_type, impl_type> (params);
458  }
459  case SOLVER_TYPE_TFQMR: {
460  typedef TFQMRSolMgr<Scalar, MV, OP> impl_type;
461  return makeSolverManagerTmpl<base_type, impl_type> (params);
462  }
464  typedef PseudoBlockTFQMRSolMgr<Scalar, MV, OP> impl_type;
465  return makeSolverManagerTmpl<base_type, impl_type> (params);
466  }
467  case SOLVER_TYPE_GMRES_POLY: {
468  typedef GmresPolySolMgr<Scalar, MV, OP> impl_type;
469  return makeSolverManagerTmpl<base_type, impl_type> (params);
470  }
471  case SOLVER_TYPE_PCPG: {
472  typedef PCPGSolMgr<Scalar, MV, OP> impl_type;
473  return makeSolverManagerTmpl<base_type, impl_type> (params);
474  }
476  typedef FixedPointSolMgr<Scalar, MV, OP> impl_type;
477  return makeSolverManagerTmpl<base_type, impl_type> (params);
478  }
479  case SOLVER_TYPE_BICGSTAB: {
480  typedef BiCGStabSolMgr<Scalar, MV, OP> impl_type;
481  return makeSolverManagerTmpl<base_type, impl_type> (params);
482  }
483  default: // Fall through; let the code below handle it.
484  TEUCHOS_TEST_FOR_EXCEPTION(
485  true, std::logic_error, "Belos::SolverFactory: Invalid EBelosSolverType "
486  "enum value " << solverType << ". Please report this bug to the Belos "
487  "developers.");
488  }
489 
490  // Compiler guard. This may result in a warning on some compilers
491  // for an unreachable statement, but it will prevent a warning on
492  // other compilers for a "missing return statement at end of
493  // non-void function."
494  return Teuchos::null;
495 }
496 
497 template<class SolverManagerBaseType, class SolverManagerType>
498 Teuchos::RCP<SolverManagerBaseType>
499 makeSolverManagerTmpl (const Teuchos::RCP<Teuchos::ParameterList>& params)
500 {
501  using Teuchos::ParameterList;
502  using Teuchos::parameterList;
503  using Teuchos::RCP;
504 
505  RCP<SolverManagerType> solver = rcp (new SolverManagerType);
506 
507  // Some solvers may not like to get a null ParameterList. If params
508  // is null, replace it with an empty parameter list. The solver
509  // will fill in default parameters for that case. Use the name of
510  // the solver's default parameters to name the new empty list.
511  RCP<ParameterList> pl;
512  if (params.is_null()) {
513  pl = parameterList (solver->getValidParameters ()->name ());
514  } else {
515  pl = params;
516  }
517  TEUCHOS_TEST_FOR_EXCEPTION(
518  pl.is_null(), std::logic_error,
519  "Belos::SolverFactory: ParameterList to pass to solver is null. This "
520  "should never happen. Please report this bug to the Belos developers.");
521  solver->setParameters (pl);
522  return solver;
523 }
524 
525 } // namespace details
526 
527 
528 template<class Scalar, class MV, class OP>
530 {
531  aliasToCanonicalName_["GMRES"] = "PSEUDOBLOCK GMRES";
532  // NOTE (mfh 29 Nov 2011) Accessing the flexible capability requires
533  // setting a parameter in the solver's parameter list. This affects
534  // the SolverFactory's interface, since using the "Flexible GMRES"
535  // alias requires modifying the user's parameter list if necessary.
536  // This is a good idea because users may not know about the
537  // parameter, or may have forgotten.
538  //
539  // NOTE (mfh 12 Aug 2015) The keys and values need to be all uppercase.
540  aliasToCanonicalName_["BLOCK GMRES"] = "BLOCK GMRES";
541  aliasToCanonicalName_["FLEXIBLE GMRES"] = "BLOCK GMRES";
542  aliasToCanonicalName_["CG"] = "PSEUDOBLOCK CG";
543  aliasToCanonicalName_["PSEUDOBLOCKCG"] = "PSEUDOBLOCK CG";
544  aliasToCanonicalName_["STOCHASTIC CG"] = "PSEUDOBLOCK STOCHASTIC CG";
545  aliasToCanonicalName_["RECYCLING CG"] = "RCG";
546  aliasToCanonicalName_["RECYCLING GMRES"] = "GCRODR";
547  // For compatibility with Stratimikos' Belos adapter.
548  aliasToCanonicalName_["PSEUDO BLOCK GMRES"] = "PSEUDOBLOCK GMRES";
549  aliasToCanonicalName_["PSEUDOBLOCKGMRES"] = "PSEUDOBLOCK GMRES";
550  aliasToCanonicalName_["PSEUDO BLOCK CG"] = "PSEUDOBLOCK CG";
551  aliasToCanonicalName_["PSEUDOBLOCKCG"] = "PSEUDOBLOCK CG";
552  aliasToCanonicalName_["TRANSPOSE-FREE QMR"] = "TFQMR";
553  aliasToCanonicalName_["PSEUDO BLOCK TFQMR"] = "PSEUDOBLOCK TFQMR";
554  aliasToCanonicalName_["PSEUDO BLOCK TRANSPOSE-FREE QMR"] = "PSEUDOBLOCK TFQMR";
555  aliasToCanonicalName_["GMRESPOLY"] = "HYBRID BLOCK GMRES";
556  aliasToCanonicalName_["SEED GMRES"] = "HYBRID BLOCK GMRES";
557  aliasToCanonicalName_["CGPOLY"] = "PCPG";
558  aliasToCanonicalName_["SEED CG"] = "PCPG";
559  aliasToCanonicalName_["FIXED POINT"] = "FIXED POINT";
560  aliasToCanonicalName_["BICGSTAB"] = "BICGSTAB";
561 
562  // Mapping from canonical solver name (a string) to its
563  // corresponding enum value. This mapping is one-to-one.
564  //
565  // NOTE (mfh 12 Aug 2015) The keys need to be all uppercase.
566  canonicalNameToEnum_["BLOCK GMRES"] = details::SOLVER_TYPE_BLOCK_GMRES;
567  canonicalNameToEnum_["PSEUDOBLOCK GMRES"] = details::SOLVER_TYPE_PSEUDO_BLOCK_GMRES;
568  canonicalNameToEnum_["BLOCK CG"] = details::SOLVER_TYPE_BLOCK_CG;
569  canonicalNameToEnum_["PSEUDOBLOCK CG"] = details::SOLVER_TYPE_PSEUDO_BLOCK_CG;
570  canonicalNameToEnum_["PSEUDOBLOCK STOCHASTIC CG"] = details::SOLVER_TYPE_STOCHASTIC_CG;
571  canonicalNameToEnum_["GCRODR"] = details::SOLVER_TYPE_GCRODR;
572  canonicalNameToEnum_["RCG"] = details::SOLVER_TYPE_RCG;
573  canonicalNameToEnum_["MINRES"] = details::SOLVER_TYPE_MINRES;
574  canonicalNameToEnum_["LSQR"] = details::SOLVER_TYPE_LSQR;
575  canonicalNameToEnum_["TFQMR"] = details::SOLVER_TYPE_TFQMR;
576  canonicalNameToEnum_["PSEUDOBLOCK TFQMR"] = details::SOLVER_TYPE_PSEUDO_BLOCK_TFQMR;
577  canonicalNameToEnum_["HYBRID BLOCK GMRES"] = details::SOLVER_TYPE_GMRES_POLY;
578  canonicalNameToEnum_["PCPG"] = details::SOLVER_TYPE_PCPG;
579  canonicalNameToEnum_["FIXED POINT"] = details::SOLVER_TYPE_FIXED_POINT;
580  canonicalNameToEnum_["BICGSTAB"] = details::SOLVER_TYPE_BICGSTAB;
581 }
582 
583 
584 template<class Scalar, class MV, class OP>
585 void
587 reviseParameterListForAlias (const std::string& aliasName,
588  Teuchos::ParameterList& solverParams)
589 {
590  if (aliasName == "FLEXIBLE GMRES") {
591  // "Gmres" uses title case in this solver's parameter list. For
592  // our alias, we prefer the all-capitals "GMRES" that the
593  // algorithm's authors (Saad and Schultz) used.
594  solverParams.set ("Flexible Gmres", true);
595  }
596 }
597 
598 
599 template<class Scalar, class MV, class OP>
600 Teuchos::RCP<typename SolverFactory<Scalar, MV, OP>::solver_base_type>
602 create (const std::string& solverName,
603  const Teuchos::RCP<Teuchos::ParameterList>& solverParams)
604 {
605  const char prefix[] = "Belos::SolverFactory: ";
606 
607  // Upper-case version of the input solver name.
608  std::string solverNameUC (solverName);
609  {
610  typedef std::string::value_type char_t;
611  typedef std::ctype<char_t> facet_type;
612  const facet_type& facet = std::use_facet<facet_type> (std::locale ());
613 
614  const std::string::size_type len = solverName.size ();
615  for (std::string::size_type k = 0; k < len; ++k) {
616  solverNameUC[k] = facet.toupper (solverName[k]);
617  }
618  }
619 
620  // Check whether the given name is an alias.
621  std::map<std::string, std::string>::const_iterator aliasIter =
622  aliasToCanonicalName_.find (solverNameUC);
623  const bool isAnAlias = (aliasIter != aliasToCanonicalName_.end());
624  const std::string candidateCanonicalName =
625  isAnAlias ? aliasIter->second : solverNameUC;
626 
627  // Get the canonical name.
628  std::map<std::string, details::EBelosSolverType>::const_iterator canonicalIter =
629  canonicalNameToEnum_.find (candidateCanonicalName);
630  const bool validCanonicalName = (canonicalIter != canonicalNameToEnum_.end());
631 
632  // Check whether we found a canonical name. If we didn't and the
633  // input name is a valid alias, that's a bug. Otherwise, the input
634  // name is invalid.
635  TEUCHOS_TEST_FOR_EXCEPTION
636  (! validCanonicalName && isAnAlias, std::logic_error,
637  prefix << "Valid alias \"" << solverName << "\" has candidate canonical "
638  "name \"" << candidateCanonicalName << "\", which is not a canonical "
639  "solver name. Please report this bug to the Belos developers.");
640  TEUCHOS_TEST_FOR_EXCEPTION
641  (! validCanonicalName && ! isAnAlias, std::invalid_argument,
642  prefix << "Invalid solver name \"" << solverName << "\".");
643 
644  // If the input list is null, we create a new list and use that.
645  // This is OK because the effect of a null parameter list input is
646  // to use default parameter values. Thus, we can always replace a
647  // null list with an empty list.
648  Teuchos::RCP<Teuchos::ParameterList> pl =
649  solverParams.is_null() ? Teuchos::parameterList() : solverParams;
650 
651  // Possibly modify the input parameter list as needed.
652  if (isAnAlias) {
653  reviseParameterListForAlias (solverNameUC, *pl);
654  }
655 
656  return details::makeSolverManagerFromEnum<Scalar, MV, OP> (canonicalIter->second, pl);
657 }
658 
659 
660 template<class Scalar, class MV, class OP>
661 std::string
663 {
664  using Teuchos::TypeNameTraits;
665 
666  std::ostringstream out;
667  out << "\"Belos::SolverFactory\": {";
668  if (this->getObjectLabel () != "") {
669  out << "Label: " << this->getObjectLabel () << ", ";
670  }
671  out << "Scalar: " << TypeNameTraits<Scalar>::name ()
672  << ", MV: " << TypeNameTraits<MV>::name ()
673  << ", OP: " << TypeNameTraits<OP>::name ()
674  << "}";
675  return out.str ();
676 }
677 
678 
679 template<class Scalar, class MV, class OP>
680 void
682 describe (Teuchos::FancyOStream& out,
683  const Teuchos::EVerbosityLevel verbLevel) const
684 {
685  using Teuchos::TypeNameTraits;
686  using std::endl;
687 
688  const Teuchos::EVerbosityLevel vl =
689  (verbLevel == Teuchos::VERB_DEFAULT) ? Teuchos::VERB_LOW : verbLevel;
690 
691  if (vl == Teuchos::VERB_NONE) {
692  return;
693  }
694 
695  // By convention, describe() always begins with a tab.
696  Teuchos::OSTab tab0 (out);
697  // The description prints in YAML format. The class name needs to
698  // be protected with quotes, so that YAML doesn't get confused
699  // between the colons in the class name and the colon separating
700  // (key,value) pairs.
701  out << "\"Belos::SolverFactory\":" << endl;
702  if (this->getObjectLabel () != "") {
703  out << "Label: " << this->getObjectLabel () << endl;
704  }
705  {
706  out << "Template parameters:" << endl;
707  Teuchos::OSTab tab1 (out);
708  out << "Scalar: " << TypeNameTraits<Scalar>::name () << endl
709  << "MV: " << TypeNameTraits<MV>::name () << endl
710  << "OP: " << TypeNameTraits<OP>::name () << endl;
711  }
712 
713  // At higher verbosity levels, print out the list of supported solvers.
714  if (vl > Teuchos::VERB_LOW) {
715  Teuchos::OSTab tab1 (out);
716  out << "Number of solvers: " << numSupportedSolvers ()
717  << endl;
718  out << "Canonical solver names: ";
719  printStringArray (out, canonicalSolverNames ());
720  out << endl;
721 
722  out << "Aliases to canonical names: ";
723  printStringArray (out, solverNameAliases ());
724  out << endl;
725  }
726 }
727 
728 template<class Scalar, class MV, class OP>
729 int
731 {
732  return static_cast<int> (canonicalNameToEnum_.size());
733 }
734 
735 template<class Scalar, class MV, class OP>
736 Teuchos::Array<std::string>
738 {
739  Teuchos::Array<std::string> canonicalNames;
740  typedef std::map<std::string, details::EBelosSolverType>::const_iterator iter_type;
741  for (iter_type iter = canonicalNameToEnum_.begin();
742  iter != canonicalNameToEnum_.end(); ++iter) {
743  canonicalNames.push_back (iter->first);
744  }
745  return canonicalNames;
746 }
747 
748 template<class Scalar, class MV, class OP>
749 Teuchos::Array<std::string>
751 {
752  Teuchos::Array<std::string> names;
753  {
754  typedef std::map<std::string, std::string>::const_iterator iter_type;
755  for (iter_type iter = aliasToCanonicalName_.begin();
756  iter != aliasToCanonicalName_.end(); ++iter) {
757  names.push_back (iter->first);
758  }
759  }
760  return names;
761 }
762 
763 template<class Scalar, class MV, class OP>
764 Teuchos::Array<std::string>
766 {
767  Teuchos::Array<std::string> names;
768  {
769  typedef std::map<std::string, std::string>::const_iterator iter_type;
770  for (iter_type iter = aliasToCanonicalName_.begin();
771  iter != aliasToCanonicalName_.end(); ++iter) {
772  names.push_back (iter->first);
773  }
774  }
775  {
776  typedef std::map<std::string, details::EBelosSolverType>::const_iterator iter_type;
777  for (iter_type iter = canonicalNameToEnum_.begin();
778  iter != canonicalNameToEnum_.end(); ++iter) {
779  names.push_back (iter->first);
780  }
781  }
782  return names;
783 }
784 
785 } // namespace Belos
786 
787 #endif // __Belos_SolverFactory_hpp
788 
Solver manager for the MINRES linear solver.
The Belos::FixedPointSolMgr provides a powerful and fully-featured solver manager over the FixedPoint...
Class which manages the output and verbosity of the Belos solvers.
The Belos::PseudoBlockCGSolMgr provides a solver manager for the BlockCG linear solver.
The Belos::PseudoBlockTFQMRSolMgr provides a solver manager for the pseudo-block TFQMR linear solver...
Teuchos::Array< std::string > supportedSolverNames() const
List of supported solver names.
Teuchos::RCP< SolverManager< Scalar, MV, OP > > makeSolverManagerFromEnum(const EBelosSolverType solverType, const Teuchos::RCP< Teuchos::ParameterList > &params)
Implementation of the RCG (Recycling Conjugate Gradient) iterative linear solver. ...
The Belos::BlockCGSolMgr provides a powerful and fully-featured solver manager over the CG and BlockC...
The Belos::FixedPointSolMgr provides a solver manager for the FixedPoint linear solver.
Declaration and definition of Belos::PCPGSolMgr (PCPG iterative linear solver).
Interface to Block GMRES and Flexible GMRES.
The Belos::PseudoBlockCGSolMgr provides a powerful and fully-featured solver manager over the pseudo-...
int numSupportedSolvers() const
Number of supported solvers.
Declaration and definition of Belos::GCRODRSolMgr, which implements the GCRODR (recycling GMRES) solv...
Pure virtual base class which describes the basic interface for a solver manager. ...
The Belos::BlockGmresSolMgr provides a solver manager for the BlockGmres linear solver.
MINRES linear solver solution manager.
Declaration and definition of Belos::GmresPolySolMgr (hybrid block GMRES linear solver).
The Belos::BiCGStabSolMgr provides a solver manager for the BiCGStab linear solver.
Teuchos::RCP< SolverManagerBaseType > makeSolverManagerTmpl(const Teuchos::RCP< Teuchos::ParameterList > &params)
Implementation of the GCRODR (Recycling GMRES) iterative linear solver.
The Belos::PseudoBlockTFQMRSolMgr provides a powerful and fully-featured solver manager over the pseu...
Interface to standard and "pseudoblock" GMRES.
The Belos::PseudoBlockStochasticCGSolMgr provides a solver manager for the stochastic BlockCG linear ...
Hybrid block GMRES iterative linear solver.
The Belos::SolverManager is a templated virtual base class that defines the basic interface that any ...
The Belos::TFQMRSolMgr provides a powerful and fully-featured solver manager over the TFQMR linear so...
The Belos::BlockCGSolMgr provides a solver manager for the BlockCG linear solver. ...
Teuchos::RCP< solver_base_type > create(const std::string &solverName, const Teuchos::RCP< Teuchos::ParameterList > &solverParams)
Create, configure, and return the specified solver.
LSQRSolMgr: interface to the LSQR method.
The Belos::BiCGStabSolMgr provides a powerful and fully-featured solver manager over the pseudo-block...
EBelosSolverType
1-to-1 enumeration of all supported SolverManager subclasses.
The Belos::PseudoBlockStochasticCGSolMgr provides a powerful and fully-featured solver manager over t...
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Describe this object.
PCPG iterative linear solver.
SolverManager< Scalar, MV, OP > solver_base_type
The type of the solver returned by create().
LSQR method (for linear systems and linear least-squares problems).
The Belos::RCGSolMgr provides a solver manager for the RCG (Recycling Conjugate Gradient) linear solv...
The Belos::PseudoBlockGmresSolMgr provides a solver manager for the BlockGmres linear solver...
SolverFactory()
Default constructor.
Factory for all solvers which Belos supports.
Belos header file which uses auto-configuration information to include necessary C++ headers...
The Belos::TFQMRSolMgr provides a solver manager for the TFQMR linear solver.
std::string description() const
A string description of this object.