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"
94 template <
class MatrixType>
95 static Teuchos::RCP<
Preconditioner<
typename MatrixType::scalar_type,
96 typename MatrixType::local_ordinal_type,
97 typename MatrixType::global_ordinal_type,
98 typename MatrixType::node_type> >
100 const Teuchos::RCP<const MatrixType>& matrix) {
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;
110 if (!matrix.is_null()) {
111 A = rcp_implicit_cast<const row_matrix_type>(matrix);
114 return factory.create(precType, A);
132 template <
class MatrixType>
133 static Teuchos::RCP<
Preconditioner<
typename MatrixType::scalar_type,
134 typename MatrixType::local_ordinal_type,
135 typename MatrixType::global_ordinal_type,
136 typename MatrixType::node_type> >
138 const Teuchos::RCP<const MatrixType>& matrix,
139 const Teuchos::RCP<
const Tpetra::MultiVector<
typename Teuchos::ScalarTraits<typename MatrixType::scalar_type>::magnitudeType,
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;
152 if (!matrix.is_null()) {
153 A = rcp_implicit_cast<const row_matrix_type>(matrix);
156 return factory.create(precType, A, coordinates);
174 template <
class MatrixType>
175 static Teuchos::RCP<
Preconditioner<
typename MatrixType::scalar_type,
176 typename MatrixType::local_ordinal_type,
177 typename MatrixType::global_ordinal_type,
178 typename MatrixType::node_type> >
180 const Teuchos::RCP<const MatrixType>& matrix,
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;
191 if (!matrix.is_null()) {
192 A = rcp_implicit_cast<const row_matrix_type>(matrix);
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;
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;
219 return factory.isSupported(precType);
Ifpack2's implementation of Trilinos::Details::LinearSolver interface.
Definition Ifpack2_Details_LinearSolver_decl.hpp:75
"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)
Create an instance of Ifpack2_Preconditioner given the string name of the preconditioner type.
Definition Ifpack2_Factory_decl.hpp:99
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
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
Interface for all Ifpack2 preconditioners.
Definition Ifpack2_Preconditioner.hpp:74
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:40
bool supportsUnsymmetric(const std::string &prec_type)
\C true if the specified preconditioner type supports nonsymmetric matrices, else false.
Definition Ifpack2_Factory.cpp:21