43#ifndef IFPACK2_DETAILS_ONELEVELFACTORY_DEF_HPP
44#define IFPACK2_DETAILS_ONELEVELFACTORY_DEF_HPP
46#include "Ifpack2_Factory.hpp"
48#include "Ifpack2_Chebyshev.hpp"
49#include "Ifpack2_Details_DenseSolver.hpp"
50#include "Ifpack2_Diagonal.hpp"
51#include "Ifpack2_IdentitySolver.hpp"
52#include "Ifpack2_ILUT.hpp"
53#include "Ifpack2_MDF.hpp"
54#include "Ifpack2_Relaxation.hpp"
55#include "Ifpack2_RILUK.hpp"
56#include "Ifpack2_Experimental_RBILUK.hpp"
57#include "Ifpack2_BlockRelaxation.hpp"
58#include "Ifpack2_BandedContainer.hpp"
59#include "Ifpack2_DenseContainer.hpp"
60#include "Ifpack2_DatabaseSchwarz.hpp"
61#include "Ifpack2_SparseContainer.hpp"
62#include "Ifpack2_TriDiContainer.hpp"
63#include "Ifpack2_LocalSparseTriangularSolver.hpp"
64#include "Ifpack2_Hiptmair.hpp"
66#ifdef HAVE_IFPACK2_SHYLU_NODEFASTILU
67#include "Ifpack2_Details_Fic.hpp"
68#include "Ifpack2_Details_Fildl.hpp"
69#include "Ifpack2_Details_Filu.hpp"
72#ifdef HAVE_IFPACK2_AMESOS2
73# include "Ifpack2_Details_Amesos2Wrapper.hpp"
76#ifdef HAVE_IFPACK2_HYPRE
77# include "Ifpack2_Hypre.hpp"
84template<
class MatrixType>
85Teuchos::RCP<typename OneLevelFactory<MatrixType>::prec_type>
87 const Teuchos::RCP<const row_matrix_type>&
matrix)
const
100 prec =
rcp (new ::Ifpack2::Chebyshev<row_matrix_type> (
matrix));
106#ifdef HAVE_IFPACK2_AMESOS2
110 true, std::invalid_argument,
"Ifpack2::Details::OneLevelFactory: "
111 "You may not ask for the preconditioner \"AMESOS2\" unless "
112 "you have built Trilinos with the Amesos2 package enabled.");
134 #ifdef HAVE_IFPACK2_SHYLU_NODEFASTILU
145 throw std::invalid_argument(
"The Ifpack2 FastIC, FastILU and FastILDL preconditioners require the FastILU subpackage of ShyLU to be enabled\n"
146 "To enable FastILU, set the CMake option Trilinos_ENABLE_ShyLU_NodeFastILU=ON");
152 (
true, std::invalid_argument,
"The \"KRYLOV\" preconditioner option has "
153 "been deprecated and removed. If you want a Krylov solver, use the "
166 Teuchos::ParameterList
params;
167 params.set (
"relaxation: container",
"Dense");
182#ifdef HAVE_IFPACK2_AMESOS2
184 Teuchos::ParameterList
params;
185 params.set (
"relaxation: container",
"SparseAmesos2");
189 (
true, std::invalid_argument,
"Ifpack2::Details::OneLevelFactory: "
190 "\"SPARSE BLOCK RELAXATION\" requires building Trilinos with Amesos2 enabled.");
200 Teuchos::ParameterList
params;
201 params.set (
"relaxation: container",
"TriDi");
208 Teuchos::ParameterList
params;
209 params.set (
"relaxation: container",
"Banded");
216 else if (
precTypeUpper ==
"LOCAL SPARSE TRIANGULAR SOLVER" ||
227#ifdef HAVE_IFPACK2_HYPRE
234 true, std::invalid_argument,
"Ifpack2::Details::OneLevelFactory::create: "
235 "Invalid preconditioner type \"" <<
precType <<
"\".");
239 prec.is_null (), std::logic_error,
"Ifpack2::Details::OneLevelFactory::"
240 "create: Return value is null right before return. This should never "
241 "happen. Please report this bug to the Ifpack2 developers.");
245template<
class MatrixType>
252 "CHEBYSHEV",
"DENSE",
"LAPACK",
253#ifdef HAVE_IFPACK2_AMESOS2
256 "DIAGONAL",
"ILUT",
"RELAXATION",
"RILUK",
"RBILUK",
"MDF",
257#ifdef HAVE_IFPACK2_SHYLU_NODEFASTILU
258 "FAST_IC",
"FAST_ILU",
"FAST_ILDL",
260 "BLOCK_RELAXATION",
"BLOCK RELAXATION",
"BLOCKRELAXATION",
"DENSE_BLOCK_RELAXATION",
"DENSE BLOCK RELAXATION",
"DENSEBLOCKRELAXATION",
262#ifdef HAVE_IFPACK2_AMESOS2
263 "SPARSE_BLOCK_RELAXATION",
"SPARSE BLOCK RELAXATION",
"SPARSEBLOCKRELAXATION",
265 #ifdef HAVE_IFPACK2_HYPRE
268 "TRIDI_RELAXATION",
"TRIDI RELAXATION",
"TRIDIRELAXATION",
"TRIDIAGONAL_RELAXATION",
"TRIDIAGONAL RELAXATION",
"TRIDIAGONALRELAXATION",
269 "BANDED_RELAXATION",
"BANDED RELAXATION",
"BANDEDRELAXATION",
270 "IDENTITY",
"IDENTITY_SOLVER",
271 "LOCAL SPARSE TRIANGULAR SOLVER",
"LOCAL_SPARSE_TRIANGULAR_SOLVER",
"LOCALSPARSETRIANGULARSOLVER",
"SPARSE TRIANGULAR SOLVER",
"SPARSE_TRIANGULAR_SOLVER",
"SPARSETRIANGULARSOLVER",
276 auto it = std::find(std::begin(supportedNames), std::end(supportedNames), precTypeUpper);
277 return it != std::end(supportedNames);
283#define IFPACK2_DETAILS_ONELEVELFACTORY_INSTANT(S,LO,GO,N) \
284 template class Ifpack2::Details::OneLevelFactory< Tpetra::RowMatrix<S, LO, GO, N> >;
File for utility functions.
Ifpack2's implementation of Trilinos::Details::LinearSolver interface.
Definition Ifpack2_Details_LinearSolver_decl.hpp:110
void setParameters(const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Set the solver's parameters.
Definition Ifpack2_Details_LinearSolver_def.hpp:152
"Factory" for creating single-level preconditioners.
Definition Ifpack2_Details_OneLevelFactory_decl.hpp:125
Teuchos::RCP< prec_type > create(const std::string &precType, const Teuchos::RCP< const row_matrix_type > &matrix) const
Create an instance of Preconditioner given the string name of the preconditioner type.
Definition Ifpack2_Details_OneLevelFactory_def.hpp:86
ILU(k) factorization of a given Tpetra::BlockCrsMatrix.
Definition Ifpack2_Experimental_RBILUK_decl.hpp:130
Ifpack2 implementation details.
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:74