Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Functions
Trilinos_Details_LinearSolverFactory.hpp File Reference

Declaration and definition of linear solver factory, and "factory of factories". More...

#include "Teuchos_RCP.hpp"
#include "TeuchosRemainder_config.h"
#include <map>
#include <stdexcept>
#include <sstream>
#include <string>

Go to the source code of this file.

Classes

class  Trilinos::Details::LinearSolver< MV, OP, NormType >
 Interface for a method for solving linear system(s) AX=B. More...
 
class  Trilinos::Details::LinearSolverFactory< MV, OP, NormType >
 Interface for a "factory" that creates solvers. More...
 
class  Trilinos::Details::Impl::LinearSolverFactoryRepository< MV, OP, NormType >
 Repository of solver factories. More...
 

Namespaces

 Trilinos
 Namespace of things generally useful to many Trilinos packages.
 
 Details
 Namespace of implementation details.
 
 Trilinos::Details::Impl
 Implementation details of implementation details.
 

Functions

template<class MV , class OP , class NormType >
Teuchos::RCP< LinearSolver< MV,
OP, NormType > > 
Trilinos::Details::getLinearSolver (const std::string &packageName, const std::string &solverName)
 Get a LinearSolver instance. More...
 
template<class MV , class OP , class NormType >
void Trilinos::Details::registerLinearSolverFactory (const std::string &packageName, const Teuchos::RCP< LinearSolverFactory< MV, OP, NormType > > &factory)
 Called by a package to register its LinearSolverFactory. More...
 
bool Trilinos::Details::Impl::rememberRegisteredSomeLinearSolverFactory (const std::string &packageName)
 Remember which packages registered at least one LinearSolverFactory, with any template parameters. More...
 
bool Trilinos::Details::Impl::registeredSomeLinearSolverFactory (const std::string &packageName)
 Did the package with the given name register at least one LinearSolverFactory, with any template parameters? More...
 
bool Trilinos::Details::Impl::haveLinearSolverFactoryRunTimeRegistration ()
 Whether the CMake run-time registration option is ON. More...
 

Detailed Description

Declaration and definition of linear solver factory, and "factory of factories".

Warning
This header file is NOT currently part of the public interface of Trilinos. It or its contents may change or disappear at any time.

Tpetra::Details::getLinearSolver, Tpetra::Details::registerLinearSolverFactory, and Tpetra::Details::LinearSolverFactory implement the Dependency Inversion and Injection (DII) pattern, as applied to "linear solvers." A linear solver solves or helps solve linear system(s) AX=B. Examples include sparse direct solvers, iterative solvers, and preconditioners for iterative solvers.

DII naturally admits hierarchical run-time options, as in e.g., Teuchos::ParameterList. This lets solvers create inner solvers in an arbitrarily nested way, following the arbitrary nesting of the Teuchos::ParameterList.

DII works well when a ParameterList can express all the data that a solver might need. However, some solvers need or may benefit from additional data. For example, algebraic multigrid can use mesh coordinates, and a sparse factorization can use an initial permutation. Such data do not fit naturally in a Teuchos::ParameterList.

Note
To developers: The LinearSolver and LinearSolverFactory interfaces, and the LinearSolverFactoryRepository interface and implementation must live in the bottom-most (most upstream) package from all solvers that depend on it. Solver defines an interface for a solver, and LinearSolverFactory defines an interface for a "factory" that knows how to create solvers. Each solver package defines its own solvers, and its own factory that knows how to create all the solvers in a given package.

Definition in file Trilinos_Details_LinearSolverFactory.hpp.