Belos
Version of the Day
|
Interface for custom Belos solver factories. More...
#include <BelosCustomSolverFactory.hpp>
Public Member Functions | |
virtual Teuchos::RCP < SolverManager< Scalar, MV, OP > > | getSolver (const std::string &solverName, const Teuchos::RCP< Teuchos::ParameterList > &solverParams)=0 |
Return an instance of the specified solver, or Teuchos::null if this factory does not provide the requested solver. More... | |
virtual int | numSupportedSolvers () const =0 |
Number of supported solvers. More... | |
virtual std::vector< std::string > | supportedSolverNames () const =0 |
List of supported solver names. More... | |
virtual bool | isSupported (const std::string &solverName) const =0 |
Whether the given solver name names a supported solver. More... | |
virtual | ~CustomSolverFactory () |
Destructor (virtual, for safety of derived classes). More... | |
Interface for custom Belos solver factories.
If you want to extend Belos::SolverFactory (which see) to support new solvers, you may do the following:
For a test and example of how to do this (with a trivial solver), see Trilinos/packages/belos/tpetra/test/CustomSolverFactory.cpp
.
Definition at line 49 of file BelosCustomSolverFactory.hpp.
|
inlinevirtual |
Destructor (virtual, for safety of derived classes).
Definition at line 103 of file BelosCustomSolverFactory.hpp.
|
pure virtual |
Return an instance of the specified solver, or Teuchos::null if this factory does not provide the requested solver.
solverName | [in] Name of the requested solver. |
solverParams | [in/out] List of parameters with which to configure the solver. If Teuchos::null, subclasses must still return a valid solver. They may configure the solver with default parameters in that case. If nonnull, the factory or solver may modify the list by filling in missing parameters, or overriding existing parameters. You may then inspect the resulting list to learn what parameters the solver accepts. |
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.
|
pure 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.
|
pure 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.
|
pure virtual |
Whether the given solver name names a supported solver.