// @HEADER // ***************************************************************************** // Belos: Block Linear Solvers Package // // Copyright 2004-2016 NTESS and the Belos contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER #ifndef BELOS_TPETRA_SOLVER_MANAGER_HPP #define BELOS_TPETRA_SOLVER_MANAGER_HPP #include "Belos_Tpetra_Krylov.hpp" #include "Belos_Tpetra_SolverManagerBase.hpp" namespace BelosTpetra { namespace Impl { /// \brief Concrete Belos::SolverManager subclass that users get when /// they ask for one of the methods that a subclass of Krylov /// implements. template class KrylovSubclassType> class SolverManager : public SolverManagerBase { private: using solver_impl_type = KrylovSubclassType; using solver_base_type = Krylov; static Teuchos::RCP makeSolverImplementation () { return Teuchos::RCP (static_cast (new solver_impl_type)); } public: SolverManager (const Teuchos::RCP& params = Teuchos::null) : SolverManagerBase::SolverManagerBase (makeSolverImplementation (), params) {} virtual ~SolverManager () = default; virtual Teuchos::RCP > clone () const override { using this_type = SolverManager; Teuchos::RCP solver (new this_type); return Teuchos::rcp_implicit_cast> (solver); } }; } // namespace Impl } // namespace BelosTpetra #endif // BELOS_TPETRA_SOLVER_MANAGER_HPP