Ifpack2 Templated Preconditioning Package Version 1.0
Loading...
Searching...
No Matches
Ifpack2_Details_InverseDiagonalKernel_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
15
16#ifndef IFPACK2_DETAILS_INVERSEDIAGONALKERNEL_DECL_HPP
17#define IFPACK2_DETAILS_INVERSEDIAGONALKERNEL_DECL_HPP
18
19#include "Ifpack2_config.h"
20#include "Tpetra_CrsMatrix_fwd.hpp"
21#include "Tpetra_MultiVector_fwd.hpp"
22#include "Tpetra_Operator_fwd.hpp"
23#include "Tpetra_Vector_fwd.hpp"
24#include "Tpetra_Export_fwd.hpp"
25#include "Tpetra_Import_fwd.hpp"
26#include "Teuchos_RCP.hpp"
27#include <memory>
28
29namespace Ifpack2 {
30namespace Details {
31
44template <class TpetraOperatorType>
46 private:
47 using SC = typename TpetraOperatorType::scalar_type;
48 using LO = typename TpetraOperatorType::local_ordinal_type;
49 using GO = typename TpetraOperatorType::global_ordinal_type;
50 using NT = typename TpetraOperatorType::node_type;
51
52 using crs_matrix_type = Tpetra::CrsMatrix<SC, LO, GO, NT>;
53 using multivector_type = Tpetra::MultiVector<SC, LO, GO, NT>;
54 using operator_type = Tpetra::Operator<SC, LO, GO, NT>;
55 using vector_type = Tpetra::Vector<SC, LO, GO, NT>;
56 using magnitude_type = typename Teuchos::ScalarTraits<SC>::magnitudeType;
57 using device_type = typename NT::device_type;
58 using offset_type = Kokkos::View<size_t*, device_type>;
59
60 public:
61 InverseDiagonalKernel(const Teuchos::RCP<const operator_type>& A);
62
63 void
64 setMatrix(const Teuchos::RCP<const operator_type>& A);
65
66 void
67 compute(vector_type& D_inv,
68 bool do_l1, magnitude_type L1Eta,
69 bool fixTinyDiagEntries, magnitude_type MinDiagonalValue);
70
71 private:
72 Teuchos::RCP<const operator_type> A_op_;
73 Teuchos::RCP<const crs_matrix_type> A_crs_;
74 offset_type offsets_;
75};
76
77} // namespace Details
78} // namespace Ifpack2
79
80#endif // IFPACK2_DETAILS_INVERSEINVERSEDIAGONALKERNEL_DECL_HPP
Compute scaled damped residual for Chebyshev.
Definition Ifpack2_Details_InverseDiagonalKernel_decl.hpp:45
Ifpack2's implementation of Trilinos::Details::LinearSolver interface.
Definition Ifpack2_Details_LinearSolver_decl.hpp:75
Ifpack2 implementation details.
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:40