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> >
140 typename MatrixType::local_ordinal_type,
141 typename MatrixType::global_ordinal_type,
142 typename MatrixType::node_type> >& coordinates) {
144 using Teuchos::rcp_implicit_cast;
145 typedef typename MatrixType::scalar_type SC;
146 typedef typename MatrixType::local_ordinal_type LO;
147 typedef typename MatrixType::global_ordinal_type GO;
148 typedef typename MatrixType::node_type NT;
149 typedef Tpetra::RowMatrix<SC, LO, GO, NT> row_matrix_type;
151 RCP<const row_matrix_type> A;
153 A = rcp_implicit_cast<
const row_matrix_type>(matrix);
155 Ifpack2::Details::Factory<SC, LO, GO, NT> factory;
156 return factory.create(precType, A, coordinates);
174 template <
class MatrixType>
176 typename MatrixType::local_ordinal_type,
177 typename MatrixType::global_ordinal_type,
178 typename MatrixType::node_type> >
183 using Teuchos::rcp_implicit_cast;
184 typedef typename MatrixType::scalar_type SC;
185 typedef typename MatrixType::local_ordinal_type LO;
186 typedef typename MatrixType::global_ordinal_type GO;
187 typedef typename MatrixType::node_type NT;
188 typedef Tpetra::RowMatrix<SC, LO, GO, NT> row_matrix_type;
190 RCP<const row_matrix_type> A;
192 A = rcp_implicit_cast<
const row_matrix_type>(matrix);
194 Ifpack2::Details::Factory<SC, LO, GO, NT> factory;
195 return factory.create(precType, A, overlap);
198 template <
class MatrixType>
199 static std::vector<std::string>
200 getSupportedNames() {
201 using SC =
typename MatrixType::scalar_type;
202 using LO =
typename MatrixType::local_ordinal_type;
203 using GO =
typename MatrixType::global_ordinal_type;
204 using NT =
typename MatrixType::node_type;
206 Ifpack2::Details::Factory<SC, LO, GO, NT> factory;
207 return factory.getSupportedNames();
210 template <
class MatrixType>
212 isSupported(
const std::string& precType) {
213 typedef typename MatrixType::scalar_type SC;
214 typedef typename MatrixType::local_ordinal_type LO;
215 typedef typename MatrixType::global_ordinal_type GO;
216 typedef typename MatrixType::node_type NT;
218 Ifpack2::Details::Factory<SC, LO, GO, NT> factory;
219 return factory.isSupported(precType);
225 #endif // IFPACK2_FACTORY_DECL_HPP
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 Teuchos::RCP< const Tpetra::MultiVector< typename Teuchos::ScalarTraits< typename MatrixType::scalar_type >::magnitudeType, typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > &coordinates)
Create an instance of Ifpack2_Preconditioner given the string name of the preconditioner type...
Definition: Ifpack2_Factory_decl.hpp:137
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:179