Belos Package Browser (Single Doxygen Collection)  Development
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 
245 template<class Scalar, class MV, class OP>
246 class SolverFactory : public Teuchos::Describable {
247 public:
254 
256  SolverFactory ();
257 
281  Teuchos::RCP<solver_base_type>
282  create (const std::string& solverName,
283  const Teuchos::RCP<Teuchos::ParameterList>& solverParams);
284 
290  int numSupportedSolvers () const;
291 
297  Teuchos::Array<std::string> supportedSolverNames () const;
298 
300  bool isSupported (const std::string& solverName) const;
301 
303 
304 
306  std::string description() const;
307 
313  void describe (Teuchos::FancyOStream& out,
314  const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const;
316 
317 private:
330  std::map<std::string, std::string> aliasToCanonicalName_;
331 
345  std::map<std::string, details::EBelosSolverType> canonicalNameToEnum_;
346 
352  void
353  reviseParameterListForAlias (const std::string& aliasName,
354  Teuchos::ParameterList& solverParams);
355 
357  Teuchos::Array<std::string> canonicalSolverNames () const;
358 
360  Teuchos::Array<std::string> solverNameAliases () const;
361 
363  static void
364  printStringArray (std::ostream& out,
365  const Teuchos::ArrayView<const std::string>& array)
366  {
367  typedef Teuchos::ArrayView<std::string>::const_iterator iter_type;
368 
369  out << "[";
370  for (iter_type iter = array.begin(); iter != array.end(); ++iter) {
371  out << "\"" << *iter << "\"";
372  if (iter + 1 != array.end()) {
373  out << ", ";
374  }
375  }
376  out << "]";
377  }
378 };
379 
380 
381 namespace details {
382 
401 template<class SolverManagerBaseType, class SolverManagerType>
402 Teuchos::RCP<SolverManagerBaseType>
403 makeSolverManagerTmpl (const Teuchos::RCP<Teuchos::ParameterList>& params);
404 
423 template<class Scalar, class MV, class OP>
424 Teuchos::RCP<SolverManager<Scalar, MV, OP> >
426  const Teuchos::RCP<Teuchos::ParameterList>& params)
427 {
428  typedef SolverManager<Scalar, MV, OP> base_type;
429 
430  switch (solverType) {
432  typedef BlockGmresSolMgr<Scalar, MV, OP> impl_type;
433  return makeSolverManagerTmpl<base_type, impl_type> (params);
434  }
436  typedef PseudoBlockGmresSolMgr<Scalar, MV, OP> impl_type;
437  return makeSolverManagerTmpl<base_type, impl_type> (params);
438  }
439  case SOLVER_TYPE_BLOCK_CG: {
440  typedef BlockCGSolMgr<Scalar, MV, OP> impl_type;
441  return makeSolverManagerTmpl<base_type, impl_type> (params);
442  }
444  typedef PseudoBlockCGSolMgr<Scalar, MV, OP> impl_type;
445  return makeSolverManagerTmpl<base_type, impl_type> (params);
446  }
447  case SOLVER_TYPE_GCRODR: {
448  typedef GCRODRSolMgr<Scalar, MV, OP> impl_type;
449  return makeSolverManagerTmpl<base_type, impl_type> (params);
450  }
451  case SOLVER_TYPE_RCG: {
452  typedef RCGSolMgr<Scalar, MV, OP> impl_type;
453  return makeSolverManagerTmpl<base_type, impl_type> (params);
454  }
455  case SOLVER_TYPE_MINRES: {
456  typedef MinresSolMgr<Scalar, MV, OP> impl_type;
457  return makeSolverManagerTmpl<base_type, impl_type> (params);
458  }
459  case SOLVER_TYPE_LSQR: {
460  typedef LSQRSolMgr<Scalar, MV, OP> impl_type;
461  return makeSolverManagerTmpl<base_type, impl_type> (params);
462  }
465  return makeSolverManagerTmpl<base_type, impl_type> (params);
466  }
467  case SOLVER_TYPE_TFQMR: {
468  typedef TFQMRSolMgr<Scalar, MV, OP> impl_type;
469  return makeSolverManagerTmpl<base_type, impl_type> (params);
470  }
472  typedef PseudoBlockTFQMRSolMgr<Scalar, MV, OP> impl_type;
473  return makeSolverManagerTmpl<base_type, impl_type> (params);
474  }
475  case SOLVER_TYPE_GMRES_POLY: {
476  typedef GmresPolySolMgr<Scalar, MV, OP> impl_type;
477  return makeSolverManagerTmpl<base_type, impl_type> (params);
478  }
479  case SOLVER_TYPE_PCPG: {
480  typedef PCPGSolMgr<Scalar, MV, OP> impl_type;
481  return makeSolverManagerTmpl<base_type, impl_type> (params);
482  }
484  typedef FixedPointSolMgr<Scalar, MV, OP> impl_type;
485  return makeSolverManagerTmpl<base_type, impl_type> (params);
486  }
487  case SOLVER_TYPE_BICGSTAB: {
488  typedef BiCGStabSolMgr<Scalar, MV, OP> impl_type;
489  return makeSolverManagerTmpl<base_type, impl_type> (params);
490  }
491  default: // Fall through; let the code below handle it.
492  TEUCHOS_TEST_FOR_EXCEPTION(
493  true, std::logic_error, "Belos::SolverFactory: Invalid EBelosSolverType "
494  "enum value " << solverType << ". Please report this bug to the Belos "
495  "developers.");
496  }
497 
498  // Compiler guard. This may result in a warning on some compilers
499  // for an unreachable statement, but it will prevent a warning on
500  // other compilers for a "missing return statement at end of
501  // non-void function."
502  return Teuchos::null;
503 }
504 
505 template<class SolverManagerBaseType, class SolverManagerType>
506 Teuchos::RCP<SolverManagerBaseType>
507 makeSolverManagerTmpl (const Teuchos::RCP<Teuchos::ParameterList>& params)
508 {
509  using Teuchos::ParameterList;
510  using Teuchos::parameterList;
511  using Teuchos::RCP;
512 
513  RCP<SolverManagerType> solver = rcp (new SolverManagerType);
514 
515  // Some solvers may not like to get a null ParameterList. If params
516  // is null, replace it with an empty parameter list. The solver
517  // will fill in default parameters for that case. Use the name of
518  // the solver's default parameters to name the new empty list.
519  RCP<ParameterList> pl;
520  if (params.is_null()) {
521  pl = parameterList (solver->getValidParameters ()->name ());
522  } else {
523  pl = params;
524  }
525  TEUCHOS_TEST_FOR_EXCEPTION(
526  pl.is_null(), std::logic_error,
527  "Belos::SolverFactory: ParameterList to pass to solver is null. This "
528  "should never happen. Please report this bug to the Belos developers.");
529  solver->setParameters (pl);
530  return solver;
531 }
532 
533 } // namespace details
534 
535 
536 template<class Scalar, class MV, class OP>
538 {
539  aliasToCanonicalName_["GMRES"] = "PSEUDOBLOCK GMRES";
540  // NOTE (mfh 29 Nov 2011) Accessing the flexible capability requires
541  // setting a parameter in the solver's parameter list. This affects
542  // the SolverFactory's interface, since using the "Flexible GMRES"
543  // alias requires modifying the user's parameter list if necessary.
544  // This is a good idea because users may not know about the
545  // parameter, or may have forgotten.
546  //
547  // NOTE (mfh 12 Aug 2015) The keys and values need to be all uppercase.
548  aliasToCanonicalName_["BLOCK GMRES"] = "BLOCK GMRES";
549  aliasToCanonicalName_["FLEXIBLE GMRES"] = "BLOCK GMRES";
550  aliasToCanonicalName_["CG"] = "PSEUDOBLOCK CG";
551  aliasToCanonicalName_["PSEUDOBLOCKCG"] = "PSEUDOBLOCK CG";
552  aliasToCanonicalName_["STOCHASTIC CG"] = "PSEUDOBLOCK STOCHASTIC CG";
553  aliasToCanonicalName_["RECYCLING CG"] = "RCG";
554  aliasToCanonicalName_["RECYCLING GMRES"] = "GCRODR";
555  // For compatibility with Stratimikos' Belos adapter.
556  aliasToCanonicalName_["PSEUDO BLOCK GMRES"] = "PSEUDOBLOCK GMRES";
557  aliasToCanonicalName_["PSEUDOBLOCKGMRES"] = "PSEUDOBLOCK GMRES";
558  aliasToCanonicalName_["PSEUDO BLOCK CG"] = "PSEUDOBLOCK CG";
559  aliasToCanonicalName_["PSEUDOBLOCKCG"] = "PSEUDOBLOCK CG";
560  aliasToCanonicalName_["TRANSPOSE-FREE QMR"] = "TFQMR";
561  aliasToCanonicalName_["PSEUDO BLOCK TFQMR"] = "PSEUDOBLOCK TFQMR";
562  aliasToCanonicalName_["PSEUDO BLOCK TRANSPOSE-FREE QMR"] = "PSEUDOBLOCK TFQMR";
563  aliasToCanonicalName_["GMRESPOLY"] = "HYBRID BLOCK GMRES";
564  aliasToCanonicalName_["SEED GMRES"] = "HYBRID BLOCK GMRES";
565  aliasToCanonicalName_["CGPOLY"] = "PCPG";
566  aliasToCanonicalName_["SEED CG"] = "PCPG";
567  aliasToCanonicalName_["FIXED POINT"] = "FIXED POINT";
568  aliasToCanonicalName_["BICGSTAB"] = "BICGSTAB";
569 
570  // Mapping from canonical solver name (a string) to its
571  // corresponding enum value. This mapping is one-to-one.
572  //
573  // NOTE (mfh 12 Aug 2015) The keys need to be all uppercase.
574  canonicalNameToEnum_["BLOCK GMRES"] = details::SOLVER_TYPE_BLOCK_GMRES;
575  canonicalNameToEnum_["PSEUDOBLOCK GMRES"] = details::SOLVER_TYPE_PSEUDO_BLOCK_GMRES;
576  canonicalNameToEnum_["BLOCK CG"] = details::SOLVER_TYPE_BLOCK_CG;
577  canonicalNameToEnum_["PSEUDOBLOCK CG"] = details::SOLVER_TYPE_PSEUDO_BLOCK_CG;
578  canonicalNameToEnum_["PSEUDOBLOCK STOCHASTIC CG"] = details::SOLVER_TYPE_STOCHASTIC_CG;
579  canonicalNameToEnum_["GCRODR"] = details::SOLVER_TYPE_GCRODR;
580  canonicalNameToEnum_["RCG"] = details::SOLVER_TYPE_RCG;
581  canonicalNameToEnum_["MINRES"] = details::SOLVER_TYPE_MINRES;
582  canonicalNameToEnum_["LSQR"] = details::SOLVER_TYPE_LSQR;
583  canonicalNameToEnum_["TFQMR"] = details::SOLVER_TYPE_TFQMR;
584  canonicalNameToEnum_["PSEUDOBLOCK TFQMR"] = details::SOLVER_TYPE_PSEUDO_BLOCK_TFQMR;
585  canonicalNameToEnum_["HYBRID BLOCK GMRES"] = details::SOLVER_TYPE_GMRES_POLY;
586  canonicalNameToEnum_["PCPG"] = details::SOLVER_TYPE_PCPG;
587  canonicalNameToEnum_["FIXED POINT"] = details::SOLVER_TYPE_FIXED_POINT;
588  canonicalNameToEnum_["BICGSTAB"] = details::SOLVER_TYPE_BICGSTAB;
589 }
590 
591 
592 template<class Scalar, class MV, class OP>
593 void
595 reviseParameterListForAlias (const std::string& aliasName,
596  Teuchos::ParameterList& solverParams)
597 {
598  if (aliasName == "FLEXIBLE GMRES") {
599  // "Gmres" uses title case in this solver's parameter list. For
600  // our alias, we prefer the all-capitals "GMRES" that the
601  // algorithm's authors (Saad and Schultz) used.
602  solverParams.set ("Flexible Gmres", true);
603  }
604 }
605 
606 
607 template<class Scalar, class MV, class OP>
608 Teuchos::RCP<typename SolverFactory<Scalar, MV, OP>::solver_base_type>
610 create (const std::string& solverName,
611  const Teuchos::RCP<Teuchos::ParameterList>& solverParams)
612 {
613  const char prefix[] = "Belos::SolverFactory: ";
614 
615  // Upper-case version of the input solver name.
616  std::string solverNameUC (solverName);
617  {
618  typedef std::string::value_type char_t;
619  typedef std::ctype<char_t> facet_type;
620  const facet_type& facet = std::use_facet<facet_type> (std::locale ());
621 
622  const std::string::size_type len = solverName.size ();
623  for (std::string::size_type k = 0; k < len; ++k) {
624  solverNameUC[k] = facet.toupper (solverName[k]);
625  }
626  }
627 
628  // Check whether the given name is an alias.
629  std::map<std::string, std::string>::const_iterator aliasIter =
630  aliasToCanonicalName_.find (solverNameUC);
631  const bool isAnAlias = (aliasIter != aliasToCanonicalName_.end());
632  const std::string candidateCanonicalName =
633  isAnAlias ? aliasIter->second : solverNameUC;
634 
635  // Get the canonical name.
636  std::map<std::string, details::EBelosSolverType>::const_iterator canonicalIter =
637  canonicalNameToEnum_.find (candidateCanonicalName);
638  const bool validCanonicalName = (canonicalIter != canonicalNameToEnum_.end());
639 
640  // Check whether we found a canonical name. If we didn't and the
641  // input name is a valid alias, that's a bug. Otherwise, the input
642  // name is invalid.
643  TEUCHOS_TEST_FOR_EXCEPTION
644  (! validCanonicalName && isAnAlias, std::logic_error,
645  prefix << "Valid alias \"" << solverName << "\" has candidate canonical "
646  "name \"" << candidateCanonicalName << "\", which is not a canonical "
647  "solver name. Please report this bug to the Belos developers.");
648  TEUCHOS_TEST_FOR_EXCEPTION
649  (! validCanonicalName && ! isAnAlias, std::invalid_argument,
650  prefix << "Invalid solver name \"" << solverName << "\".");
651 
652  // If the input list is null, we create a new list and use that.
653  // This is OK because the effect of a null parameter list input is
654  // to use default parameter values. Thus, we can always replace a
655  // null list with an empty list.
656  Teuchos::RCP<Teuchos::ParameterList> pl =
657  solverParams.is_null() ? Teuchos::parameterList() : solverParams;
658 
659  // Possibly modify the input parameter list as needed.
660  if (isAnAlias) {
661  reviseParameterListForAlias (solverNameUC, *pl);
662  }
663 
664  return details::makeSolverManagerFromEnum<Scalar, MV, OP> (canonicalIter->second, pl);
665 }
666 
667 
668 template<class Scalar, class MV, class OP>
669 std::string
671 {
672  using Teuchos::TypeNameTraits;
673 
674  std::ostringstream out;
675  out << "\"Belos::SolverFactory\": {";
676  if (this->getObjectLabel () != "") {
677  out << "Label: " << this->getObjectLabel () << ", ";
678  }
679  out << "Scalar: " << TypeNameTraits<Scalar>::name ()
680  << ", MV: " << TypeNameTraits<MV>::name ()
681  << ", OP: " << TypeNameTraits<OP>::name ()
682  << "}";
683  return out.str ();
684 }
685 
686 
687 template<class Scalar, class MV, class OP>
688 void
690 describe (Teuchos::FancyOStream& out,
691  const Teuchos::EVerbosityLevel verbLevel) const
692 {
693  using Teuchos::TypeNameTraits;
694  using std::endl;
695 
696  const Teuchos::EVerbosityLevel vl =
697  (verbLevel == Teuchos::VERB_DEFAULT) ? Teuchos::VERB_LOW : verbLevel;
698 
699  if (vl == Teuchos::VERB_NONE) {
700  return;
701  }
702 
703  // By convention, describe() always begins with a tab.
704  Teuchos::OSTab tab0 (out);
705  // The description prints in YAML format. The class name needs to
706  // be protected with quotes, so that YAML doesn't get confused
707  // between the colons in the class name and the colon separating
708  // (key,value) pairs.
709  out << "\"Belos::SolverFactory\":" << endl;
710  if (this->getObjectLabel () != "") {
711  out << "Label: " << this->getObjectLabel () << endl;
712  }
713  {
714  out << "Template parameters:" << endl;
715  Teuchos::OSTab tab1 (out);
716  out << "Scalar: " << TypeNameTraits<Scalar>::name () << endl
717  << "MV: " << TypeNameTraits<MV>::name () << endl
718  << "OP: " << TypeNameTraits<OP>::name () << endl;
719  }
720 
721  // At higher verbosity levels, print out the list of supported solvers.
722  if (vl > Teuchos::VERB_LOW) {
723  Teuchos::OSTab tab1 (out);
724  out << "Number of solvers: " << numSupportedSolvers ()
725  << endl;
726  out << "Canonical solver names: ";
727  printStringArray (out, canonicalSolverNames ());
728  out << endl;
729 
730  out << "Aliases to canonical names: ";
731  printStringArray (out, solverNameAliases ());
732  out << endl;
733  }
734 }
735 
736 template<class Scalar, class MV, class OP>
737 int
739 {
740  return static_cast<int> (canonicalNameToEnum_.size());
741 }
742 
743 template<class Scalar, class MV, class OP>
744 Teuchos::Array<std::string>
746 {
747  Teuchos::Array<std::string> canonicalNames;
748  typedef std::map<std::string, details::EBelosSolverType>::const_iterator iter_type;
749  for (iter_type iter = canonicalNameToEnum_.begin();
750  iter != canonicalNameToEnum_.end(); ++iter) {
751  canonicalNames.push_back (iter->first);
752  }
753  return canonicalNames;
754 }
755 
756 template<class Scalar, class MV, class OP>
757 Teuchos::Array<std::string>
759 {
760  Teuchos::Array<std::string> names;
761  {
762  typedef std::map<std::string, std::string>::const_iterator iter_type;
763  for (iter_type iter = aliasToCanonicalName_.begin();
764  iter != aliasToCanonicalName_.end(); ++iter) {
765  names.push_back (iter->first);
766  }
767  }
768  return names;
769 }
770 
771 template<class Scalar, class MV, class OP>
772 Teuchos::Array<std::string>
774 {
775  Teuchos::Array<std::string> names;
776  {
777  typedef std::map<std::string, std::string>::const_iterator iter_type;
778  for (iter_type iter = aliasToCanonicalName_.begin();
779  iter != aliasToCanonicalName_.end(); ++iter) {
780  names.push_back (iter->first);
781  }
782  }
783  {
784  typedef std::map<std::string, details::EBelosSolverType>::const_iterator iter_type;
785  for (iter_type iter = canonicalNameToEnum_.begin();
786  iter != canonicalNameToEnum_.end(); ++iter) {
787  names.push_back (iter->first);
788  }
789  }
790  return names;
791 }
792 
793 } // namespace Belos
794 
795 #endif // __Belos_SolverFactory_hpp
796 
std::map< std::string, std::string > aliasToCanonicalName_
Map from solver name alias to canonical solver name.
Solver manager for the MINRES linear solver.
std::string description() const
A string description of this object.
void reviseParameterListForAlias(const std::string &aliasName, Teuchos::ParameterList &solverParams)
Modify the input ParameterList appropriately for the given alias.
The Belos::FixedPointSolMgr provides a powerful and fully-featured solver manager over the FixedPoint...
Teuchos::Array< std::string > solverNameAliases() const
List of supported aliases (to canonical solver names).
Class which manages the output and verbosity of the Belos solvers.
static void printStringArray(std::ostream &out, const Teuchos::ArrayView< const std::string > &array)
Print the given array of strings, in YAML format, to out.
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::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-...
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. ...
std::map< std::string, details::EBelosSolverType > canonicalNameToEnum_
Map from canonical solver name to solver enum value.
The Belos::BlockGmresSolMgr provides a solver manager for the BlockGmres linear solver.
Namespace containing implementation details of Belos solvers.
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.
int numSupportedSolvers() const
Number of supported solvers.
Teuchos::Array< std::string > supportedSolverNames() const
List of supported solver names.
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.
bool isSupported(const std::string &solverName) const
Whether the given solver name names a supported 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...
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...
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Describe this object.
The Belos::PseudoBlockGmresSolMgr provides a solver manager for the BlockGmres linear solver...
SolverFactory()
Default constructor.
Factory for all solvers which Belos supports.
Teuchos::Array< std::string > canonicalSolverNames() const
List of canonical solver names.
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.