Belos Package Browser (Single Doxygen Collection)
Development
|
Specializations of Belos::SolverFactory may inherit from this class to get basic SolverFactory functionality. More...
#include <BelosSolverFactory.hpp>
Public Types | |
typedef ::Belos::SolverManager < Scalar, MV, OP > | solver_base_type |
The type of the solver returned by create(). More... | |
typedef CustomSolverFactory < Scalar, MV, OP > | custom_solver_factory_type |
The type of a solver factory that users may give to addFactory() (which see below) More... | |
Public Member Functions | |
virtual Teuchos::RCP < solver_base_type > | create (const std::string &solverName, const Teuchos::RCP< Teuchos::ParameterList > &solverParams) |
Create, configure, and return the specified solver. More... | |
virtual int | numSupportedSolvers () const |
Number of supported solvers. More... | |
virtual Teuchos::Array < std::string > | supportedSolverNames () const |
List of supported solver names. More... | |
virtual bool | isSupported (const std::string &solverName) const |
Whether the given solver name names a supported solver. More... | |
void | addFactory (const Teuchos::RCP< custom_solver_factory_type > &factory) |
Add a custom solver factory. More... | |
Public Member Functions inherited from Teuchos::Describable | |
DescribableStreamManipulatorState | describe (const Describable &describable, const EVerbosityLevel verbLevel=Describable::verbLevel_default) |
std::ostream & | operator<< (std::ostream &os, const DescribableStreamManipulatorState &d) |
void | describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const |
virtual | ~Describable () |
LabeledObject () | |
virtual | ~LabeledObject () |
virtual void | setObjectLabel (const std::string &objectLabel) |
virtual std::string | getObjectLabel () const |
Static Public Member Functions | |
static void | registerSolver (const std::string &solverName, Teuchos::RCP< SolverFactoryParent< Scalar, MV, OP >::solver_base_type > instance) |
register a solver for Inverted Injection (DII). More... | |
static bool | isSolverRegistered (const std::string &solverName) |
is solver registered for Inverted Injection (DII). More... | |
Protected Member Functions | |
SolverFactoryParent () | |
virtual Teuchos::RCP < solver_base_type > | getSolver (const std::string &solverName, const Teuchos::RCP< Teuchos::ParameterList > &solverParams) |
Return an instance of the specified solver, or Teuchos::null if this factory does not provide the requested solver. More... | |
Static Private Member Functions | |
static std::map< const std::string, Teuchos::RCP < typename SolverFactoryParent < Scalar, MV, OP > ::solver_base_type > > & | get_solverManagers () |
Static Private Attributes | |
static std::vector < Teuchos::RCP < custom_solver_factory_type > > | factories_ |
The list of solver factories given to addFactory. More... | |
Implementation of Teuchos::Describable interface | |
virtual std::string | description () const |
A string description of this object. More... | |
virtual void | describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const |
Describe this object. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from Teuchos::Describable | |
static const EVerbosityLevel | verbLevel_default |
Specializations of Belos::SolverFactory may inherit from this class to get basic SolverFactory functionality.
This class is not for Belos users. It's really just for Belos developers who want to write a specialization of Belos::SolverFactory. Those developers may make their specialization inherit from this class, in order to get basic Belos::SolverFactory functionality without reimplementing everything.
Scalar | Same as template parameter 1 of Belos::SolverFactory (which see below). |
MV | Same as template parameter 2 of Belos::SolverFactory (which see below). |
OP | Same as template parameter 2 of Belos::SolverFactory (which see below). |
Definition at line 95 of file BelosSolverFactory.hpp.
typedef ::Belos::SolverManager<Scalar, MV, OP> Belos::Impl::SolverFactoryParent< Scalar, MV, OP >::solver_base_type |
The type of the solver returned by create().
This is a specialization of SolverManager for the same scalar, multivector, and operator types as the template parameters of this factory.
Definition at line 117 of file BelosSolverFactory.hpp.
typedef CustomSolverFactory<Scalar, MV, OP> Belos::Impl::SolverFactoryParent< Scalar, MV, OP >::custom_solver_factory_type |
The type of a solver factory that users may give to addFactory() (which see below)
Definition at line 121 of file BelosSolverFactory.hpp.
|
inlineprotected |
Definition at line 109 of file BelosSolverFactory.hpp.
|
protectedvirtual |
Return an instance of the specified solver, or Teuchos::null if this factory does not provide the requested solver.
The preferred way to customize this method is not to inherit from it, but rather to add a custom SolverFactory via addFactory() (which see below). Nevertheless, we leave open the possibility of overriding this method, for example in order to change the order in which users' solver factories are queried.
solverName | [in] Name of the solver. |
solverParams | [in/out] List of parameters with which to configure the solver. If null, we configure the solver with default parameters. If nonnull, the solver may modify the list by filling in missing parameters with default values. You can then inspect the resulting list to learn what parameters the solver accepts. |
Some solvers may be accessed by multiple names ("aliases"). Each solver has a canonical name, and zero or more aliases. Using some aliases (such as those that access Flexible GMRES capability in GMRES-type solvers) may make this method set certain parameters in your parameter list.
The input parameter list is passed in as a Teuchos::RCP because the factory passes it to the solver, and Belos solvers want their input parameter list as a Teuchos::RCP<Teuchos::ParameterList>. We allow a null parameter list only for convenience, and will use default parameter values in that case.
Definition at line 324 of file BelosSolverFactory.hpp.
|
virtual |
Create, configure, and return the specified solver.
solverName | [in] Name of the solver. |
solverParams | [in/out] List of parameters with which to configure the solver. |
This method differs from getSolver() (see above) only in that it throws an exception if solverName is invalid.
Definition at line 310 of file BelosSolverFactory.hpp.
|
virtual |
Number of supported solvers.
This may differ from the number of supported solver names, since we may accept multiple names ("aliases") for some solvers.
Definition at line 492 of file BelosSolverFactory.hpp.
|
virtual |
List of supported solver names.
The length of this list may differ from the number of supported solvers, since we may accept multiple names ("aliases") for some solvers.
Definition at line 512 of file BelosSolverFactory.hpp.
|
virtual |
Whether the given solver name names a supported solver.
Definition at line 550 of file BelosSolverFactory.hpp.
void Belos::Impl::SolverFactoryParent< Scalar, MV, OP >::addFactory | ( | const Teuchos::RCP< custom_solver_factory_type > & | factory | ) |
Add a custom solver factory.
Any custom solver factories that you may define will override this factory. "Override" means that if the solverName
argument to create() or getSolver() matches any solvers that the custom factories support, then one of the custom factories will create it.
Definition at line 414 of file BelosSolverFactory.hpp.
|
inlinestatic |
register a solver for Inverted Injection (DII).
Definition at line 215 of file BelosSolverFactory.hpp.
|
inlinestatic |
is solver registered for Inverted Injection (DII).
Definition at line 228 of file BelosSolverFactory.hpp.
|
virtual |
A string description of this object.
Reimplemented from Teuchos::Describable.
Definition at line 423 of file BelosSolverFactory.hpp.
|
virtual |
Describe this object.
At higher verbosity levels, this method will print out the list of names of supported solvers. You can also get this list directly by using the supportedSolverNames() method.
Reimplemented from Teuchos::Describable.
Definition at line 443 of file BelosSolverFactory.hpp.
|
inlinestaticprivate |
Definition at line 256 of file BelosSolverFactory.hpp.
|
staticprivate |
The list of solver factories given to addFactory.
Definition at line 252 of file BelosSolverFactory.hpp.