Ifpack2 Templated Preconditioning Package Version 1.0
Loading...
Searching...
No Matches
Ifpack2_Details_LinearSolver_decl.hpp
1// @HEADER
2// *****************************************************************************
3// Ifpack2: Templated Object-Oriented Algebraic Preconditioner Package
4//
5// Copyright 2009 NTESS and the Ifpack2 contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
13
14#ifndef IFPACK2_DETAILS_LINEARSOLVER_DECL_HPP
15#define IFPACK2_DETAILS_LINEARSOLVER_DECL_HPP
16
17#include "Ifpack2_ConfigDefs.hpp"
18#include "Trilinos_Details_LinearSolver.hpp"
20#include "Teuchos_Describable.hpp"
21
22namespace Ifpack2 {
23namespace Details {
24
71template<class SC, class LO, class GO, class NT>
73 public Trilinos::Details::LinearSolver<Tpetra::MultiVector<SC, LO, GO, NT>,
74 Tpetra::Operator<SC, LO, GO, NT>,
75 typename Tpetra::MultiVector<SC, LO, GO, NT>::mag_type>,
76 virtual public Teuchos::Describable
77{
78public:
80 typedef Tpetra::Operator<SC, LO, GO, NT> OP;
81 typedef Tpetra::MultiVector<SC, LO, GO, NT> MV;
82
94 LinearSolver (const Teuchos::RCP<prec_type>& solver, const std::string& solverName);
95
97 virtual ~LinearSolver () {}
98
103 void setMatrix (const Teuchos::RCP<const OP>& A);
104
106 Teuchos::RCP<const OP> getMatrix () const;
107
109 void solve (MV& X, const MV& B);
110
112 void setParameters (const Teuchos::RCP<Teuchos::ParameterList>& params);
113
115 void symbolic ();
116
118 void numeric ();
119
121 std::string description () const;
122
124 void
125 describe (Teuchos::FancyOStream& out,
126 const Teuchos::EVerbosityLevel verbLevel =
127 Teuchos::Describable::verbLevel_default) const;
128
129private:
131 Teuchos::RCP<prec_type> solver_;
133 std::string solverName_;
135 Teuchos::RCP<const OP> A_;
136};
137
138} // namespace Details
139} // namespace Ifpack2
140
141#endif // IFPACK2_DETAILS_LINEARSOLVER_DECL_HPP
void numeric()
Precompute for matrix values' changes.
Definition Ifpack2_Details_LinearSolver_def.hpp:143
void symbolic()
Precompute for matrix structure changes.
Definition Ifpack2_Details_LinearSolver_def.hpp:126
void solve(MV &X, const MV &B)
Solve the linear system AX=B for X.
Definition Ifpack2_Details_LinearSolver_def.hpp:101
void setMatrix(const Teuchos::RCP< const OP > &A)
Set the solver's matrix.
Definition Ifpack2_Details_LinearSolver_def.hpp:55
void setParameters(const Teuchos::RCP< Teuchos::ParameterList > &params)
Set the solver's parameters.
Definition Ifpack2_Details_LinearSolver_def.hpp:118
std::string description() const
Implementation of Teuchos::Describable::description.
Definition Ifpack2_Details_LinearSolver_def.hpp:160
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Implementation of Teuchos::Describable::describe.
Definition Ifpack2_Details_LinearSolver_def.hpp:173
Teuchos::RCP< const OP > getMatrix() const
Get the solver's matrix.
Definition Ifpack2_Details_LinearSolver_def.hpp:94
LinearSolver(const Teuchos::RCP< prec_type > &solver, const std::string &solverName)
Constructor.
Definition Ifpack2_Details_LinearSolver_def.hpp:33
virtual ~LinearSolver()
Destructor (virtual for memory safety).
Definition Ifpack2_Details_LinearSolver_decl.hpp:97
Interface for all Ifpack2 preconditioners.
Definition Ifpack2_Preconditioner.hpp:75
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:41