10 #ifndef IFPACK2_FACTORY_DECL_HPP
11 #define IFPACK2_FACTORY_DECL_HPP
13 #include "Ifpack2_ConfigDefs.hpp"
15 #include "Ifpack2_Details_Factory.hpp"
17 #include "Ifpack2_Chebyshev.hpp"
18 #include "Ifpack2_RILUK.hpp"
19 #include "Ifpack2_Experimental_RBILUK.hpp"
21 #include <type_traits>
94 template <
class MatrixType>
96 typename MatrixType::local_ordinal_type,
97 typename MatrixType::global_ordinal_type,
98 typename MatrixType::node_type> >
102 using Teuchos::rcp_implicit_cast;
103 typedef typename MatrixType::scalar_type SC;
104 typedef typename MatrixType::local_ordinal_type LO;
105 typedef typename MatrixType::global_ordinal_type GO;
106 typedef typename MatrixType::node_type NT;
107 typedef Tpetra::RowMatrix<SC, LO, GO, NT> row_matrix_type;
109 RCP<const row_matrix_type> A;
111 A = rcp_implicit_cast<
const row_matrix_type>(matrix);
113 Ifpack2::Details::Factory<SC, LO, GO, NT> factory;
114 return factory.create(precType, A);
132 template <
class MatrixType>
134 typename MatrixType::local_ordinal_type,
135 typename MatrixType::global_ordinal_type,
136 typename MatrixType::node_type> >
141 using Teuchos::rcp_implicit_cast;
142 typedef typename MatrixType::scalar_type SC;
143 typedef typename MatrixType::local_ordinal_type LO;
144 typedef typename MatrixType::global_ordinal_type GO;
145 typedef typename MatrixType::node_type NT;
146 typedef Tpetra::RowMatrix<SC, LO, GO, NT> row_matrix_type;
148 RCP<const row_matrix_type> A;
150 A = rcp_implicit_cast<
const row_matrix_type>(matrix);
152 Ifpack2::Details::Factory<SC, LO, GO, NT> factory;
153 return factory.create(precType, A, overlap);
156 template <
class MatrixType>
157 static std::vector<std::string>
158 getSupportedNames() {
159 using SC =
typename MatrixType::scalar_type;
160 using LO =
typename MatrixType::local_ordinal_type;
161 using GO =
typename MatrixType::global_ordinal_type;
162 using NT =
typename MatrixType::node_type;
164 Ifpack2::Details::Factory<SC, LO, GO, NT> factory;
165 return factory.getSupportedNames();
168 template <
class MatrixType>
170 isSupported(
const std::string& precType) {
171 typedef typename MatrixType::scalar_type SC;
172 typedef typename MatrixType::local_ordinal_type LO;
173 typedef typename MatrixType::global_ordinal_type GO;
174 typedef typename MatrixType::node_type NT;
176 Ifpack2::Details::Factory<SC, LO, GO, NT> factory;
177 return factory.isSupported(precType);
183 #endif // IFPACK2_FACTORY_DECL_HPP
bool supportsUnsymmetric(const std::string &prec_type)
true if the specified preconditioner type supports nonsymmetric matrices, else false.
Definition: Ifpack2_Factory.cpp:21
Interface for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:74
static Teuchos::RCP< Preconditioner< typename MatrixType::scalar_type, typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > create(const std::string &precType, const Teuchos::RCP< const MatrixType > &matrix)
Create an instance of Ifpack2_Preconditioner given the string name of the preconditioner type...
Definition: Ifpack2_Factory_decl.hpp:99
"Factory" for creating Ifpack2 preconditioners.
Definition: Ifpack2_Factory_decl.hpp:82
static Teuchos::RCP< Preconditioner< typename MatrixType::scalar_type, typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > create(const std::string &precType, const Teuchos::RCP< const MatrixType > &matrix, const int overlap)
Create an instance of Ifpack2_Preconditioner given the string name of the preconditioner type...
Definition: Ifpack2_Factory_decl.hpp:137