44 #ifndef IFPACK2_ADDITIVE_SCHWARZ_FILTER_DECL_HPP
45 #define IFPACK2_ADDITIVE_SCHWARZ_FILTER_DECL_HPP
54 #include "Ifpack2_ConfigDefs.hpp"
55 #include "Ifpack2_Details_RowMatrix.hpp"
56 #include "Ifpack2_OverlappingRowMatrix.hpp"
62 template<
typename MatrixType>
66 typedef typename MatrixType::scalar_type scalar_type;
67 typedef typename Kokkos::ArithTraits<scalar_type>::val_type impl_scalar_type;
68 typedef typename MatrixType::local_ordinal_type local_ordinal_type;
69 typedef typename MatrixType::global_ordinal_type global_ordinal_type;
70 typedef typename MatrixType::node_type node_type;
71 typedef typename MatrixType::global_inds_host_view_type global_inds_host_view_type;
72 typedef typename MatrixType::local_inds_host_view_type local_inds_host_view_type;
73 typedef typename MatrixType::values_host_view_type values_host_view_type;
75 typedef typename MatrixType::nonconst_global_inds_host_view_type nonconst_global_inds_host_view_type;
76 typedef typename MatrixType::nonconst_local_inds_host_view_type nonconst_local_inds_host_view_type;
77 typedef typename MatrixType::nonconst_values_host_view_type nonconst_values_host_view_type;
80 typedef Tpetra::RowMatrix<scalar_type,
83 node_type> row_matrix_type;
84 typedef Tpetra::CrsMatrix<scalar_type,
87 node_type> crs_matrix_type;
88 typedef Tpetra::MultiVector<scalar_type,
92 typedef typename crs_matrix_type::device_type device_type;
93 typedef typename crs_matrix_type::execution_space execution_space;
94 typedef Kokkos::RangePolicy<execution_space> policy_type;
95 typedef Kokkos::MDRangePolicy<execution_space, Kokkos::Rank<2>> policy_2d_type;
97 typedef typename crs_matrix_type::local_matrix_device_type local_matrix_type;
98 typedef typename local_matrix_type::size_type size_type;
99 typedef typename local_matrix_type::row_map_type::non_const_type row_map_type;
100 typedef typename local_matrix_type::index_type entries_type;
101 typedef typename local_matrix_type::values_type values_type;
102 typedef typename row_map_type::HostMirror host_row_map_type;
103 typedef typename entries_type::HostMirror host_entries_type;
104 typedef typename values_type::HostMirror host_values_type;
105 typedef typename local_matrix_type::HostMirror host_local_matrix_type;
107 static_assert(std::is_same<MatrixType, row_matrix_type>::value,
"Ifpack2::AdditiveSchwarzFilter: The template parameter MatrixType must be a Tpetra::RowMatrix specialization. Please don't use Tpetra::CrsMatrix (a subclass of Tpetra::RowMatrix) here anymore. The constructor can take either a RowMatrix or a CrsMatrix just fine.");
109 typedef Tpetra::Map<local_ordinal_type,
113 typedef typename row_matrix_type::mag_type mag_type;
138 bool filterSingletons);
141 void updateMatrixValues();
171 virtual local_ordinal_type getBlockSize()
const;
174 virtual global_size_t getGlobalNumRows()
const;
177 virtual global_size_t getGlobalNumCols()
const;
180 virtual size_t getLocalNumRows()
const;
183 virtual size_t getLocalNumCols()
const;
186 virtual global_ordinal_type getIndexBase()
const;
189 virtual global_size_t getGlobalNumEntries()
const;
192 virtual size_t getLocalNumEntries()
const;
200 virtual size_t getNumEntriesInGlobalRow (global_ordinal_type globalRow)
const;
208 virtual size_t getNumEntriesInLocalRow (local_ordinal_type localRow)
const;
211 virtual size_t getGlobalMaxNumRowEntries()
const;
214 virtual size_t getLocalMaxNumRowEntries()
const;
217 virtual bool hasColMap()
const;
220 virtual bool isLocallyIndexed()
const;
223 virtual bool isGloballyIndexed()
const;
226 virtual bool isFillComplete()
const;
229 virtual bool supportsRowViews()
const;
248 getGlobalRowCopy (global_ordinal_type GlobalRow,
249 nonconst_global_inds_host_view_type &Indices,
250 nonconst_values_host_view_type &Values,
251 size_t& NumEntries)
const;
264 getLocalRowCopy (local_ordinal_type LocalRow,
265 nonconst_local_inds_host_view_type &Indices,
266 nonconst_values_host_view_type &Values,
267 size_t& NumEntries)
const;
279 getGlobalRowView (global_ordinal_type GlobalRow,
280 global_inds_host_view_type &indices,
281 values_host_view_type &values)
const;
293 getLocalRowView (local_ordinal_type LocalRow,
294 local_inds_host_view_type & indices,
295 values_host_view_type & values)
const;
299 virtual void getLocalDiagCopy(Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &diag)
const;
315 virtual void leftScale(
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& x);
326 virtual void rightScale(
const Tpetra::Vector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& x);
332 virtual mag_type getFrobeniusNorm()
const;
356 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &X,
357 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> &Y,
363 virtual bool hasTransposeApply()
const;
366 void CreateReducedProblem(
367 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& OverlappingB,
368 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& OverlappingY,
369 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& ReducedReorderedB)
const;
373 const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& ReducedReorderedY,
374 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& OverlappingY)
const;
379 bool filterSingletons);
385 void fillLocalMatrix(local_matrix_type localMatrix);
404 mapPairIsFitted (
const map_type& map1,
const map_type& map2);
412 mapPairsAreFitted (
const row_matrix_type& A);
419 Kokkos::DualView<local_ordinal_type*, device_type> perm_;
421 Kokkos::DualView<local_ordinal_type*, device_type> reverseperm_;
422 local_ordinal_type numSingletons_;
424 Kokkos::DualView<local_ordinal_type*, device_type> singletons_;
426 Kokkos::DualView<impl_scalar_type*, device_type> singletonDiagonals_;
430 bool FilterSingletons_;
All Ifpack2 implementations of Tpetra::RowMatrix must inherit from this class.
Definition: Ifpack2_Details_RowMatrix.hpp:63
Sparse matrix (Tpetra::RowMatrix subclass) with ghost rows.
Definition: Ifpack2_OverlappingRowMatrix_decl.hpp:58
Wraps a Tpetra::CrsMatrix or Ifpack2::OverlappingRowMatrix in a filter that removes off-process edges...