| 1 |
// @HEADER |
| 2 |
// ***************************************************************************** |
| 3 |
// Belos: Block Linear Solvers Package |
| 4 |
// |
| 5 |
// Copyright 2004-2016 NTESS and the Belos contributors. |
| 6 |
// SPDX-License-Identifier: BSD-3-Clause |
| 7 |
// ***************************************************************************** |
| 8 |
// @HEADER |
| 9 |
|
| 10 |
#include "BelosSolverFactory.hpp" |
| 11 |
#include "BelosMultiVecTraits_Tpetra.hpp" |
| 12 |
#include "BelosOperatorTraits_Tpetra.hpp" |
| 13 |
#include "Belos_Tpetra_GmresPipeline.hpp" |
| 14 |
#include "Belos_Tpetra_SolverManager.hpp" |
| 15 |
#include "TpetraCore_ETIHelperMacros.h" |
| 16 |
#include "Teuchos_TypeNameTraits.hpp" |
| 17 |
#include <iostream> |
| 18 |
|
| 19 |
namespace BelosTpetra { |
| 20 |
namespace Impl { |
| 21 |
|
| 22 |
template<class SC, class LO, class GO, class NT> |
| 23 |
void register_GmresPipeline_tmpl (const bool verbose) |
| 24 |
{ |
| 25 |
using ::Belos::Impl::registerSolverSubclassForTypes; |
| 26 |
using MV = ::Tpetra::MultiVector<SC, LO, GO, NT>; |
| 27 |
using OP = ::Tpetra::Operator<SC, LO, GO, NT>; |
| 28 |
using solver_type = GmresPipelineSolverManager<SC, MV, OP>; |
| 29 |
|
| 30 |
if (verbose) { |
| 31 |
using Teuchos::TypeNameTraits; |
| 32 |
std::cout << "Registering BelosTpetra GmresPipelineSolverManager<" |
| 33 |
<< TypeNameTraits<SC>::name () << ", " |
| 34 |
<< TypeNameTraits<LO>::name () << ", " |
| 35 |
<< TypeNameTraits<GO>::name () << ", " |
| 36 |
<< TypeNameTraits<NT>::name () << ">" << std::endl; |
| 37 |
} |
| 38 |
const char solverName[] = "TPETRA GMRES PIPELINE"; |
| 39 |
registerSolverSubclassForTypes<solver_type, SC, MV, OP> (solverName); |
| 40 |
} |
| 41 |
|
| 42 |
void register_GmresPipeline (const bool verbose) |
| 43 |
{ |
| 44 |
TPETRA_ETI_MANGLING_TYPEDEFS() |
| 45 |
|
| 46 |
#ifdef BELOS_TPETRA_REGISTER_GMRES_PIPELINE |
| 47 |
# undef BELOS_TPETRA_REGISTER_GMRES_PIPELINE |
| 48 |
#endif // BELOS_TPETRA_REGISTER_GMRES_PIPELINE |
| 49 |
#define BELOS_TPETRA_REGISTER_GMRES_PIPELINE( SC, LO, GO, NT ) register_GmresPipeline_tmpl<SC, LO, GO, NT> (verbose); |
| 50 |
|
| 51 |
TPETRA_INSTANTIATE_SLGN_NO_ORDINAL_SCALAR( BELOS_TPETRA_REGISTER_GMRES_PIPELINE ) |
| 52 |
|
| 53 |
#undef BELOS_TPETRA_REGISTER_GMRES_PIPELINE |
| 54 |
} |
| 55 |
|
| 56 |
} // namespace Impl |
| 57 |
} // namespace BelosTpetra |