MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_DroppingCommon.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // MueLu: A package for multigrid based preconditioning
4 //
5 // Copyright 2012 NTESS and the MueLu contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef MUELU_DROPPINGCOMMON_HPP
11 #define MUELU_DROPPINGCOMMON_HPP
12 
13 // #define MUELU_COALESCE_DROP_DEBUG 1
14 
15 #include "Kokkos_Core.hpp"
16 #include "Kokkos_ArithTraits.hpp"
17 #include "Xpetra_Access.hpp"
18 #include "Xpetra_Matrix.hpp"
19 #include "Xpetra_VectorFactory.hpp"
20 #include "MueLu_Utilities.hpp"
21 
22 namespace MueLu {
23 
28 enum DecisionType : char {
29  UNDECIDED = 0, // no decision has been taken yet, used for initialization
30  KEEP = 1, // keeep the entry
31  DROP = 2, // drop it
32  BOUNDARY = 3 // entry is a boundary
33 };
34 
35 namespace Misc {
36 
37 template <class local_ordinal_type>
38 class NoOpFunctor {
39  public:
41 
42  KOKKOS_FORCEINLINE_FUNCTION
43  void operator()(local_ordinal_type rlid) const {
44  }
45 };
46 
51 template <class local_matrix_type>
53  private:
54  using scalar_type = typename local_matrix_type::value_type;
55  using local_ordinal_type = typename local_matrix_type::ordinal_type;
56  using memory_space = typename local_matrix_type::memory_space;
57  using results_view = Kokkos::View<DecisionType*, memory_space>;
58  using boundary_nodes_view = Kokkos::View<const bool*, memory_space>;
59 
60  local_matrix_type A;
63 
64  public:
65  PointwiseDropBoundaryFunctor(local_matrix_type& A_, boundary_nodes_view boundaryNodes_, results_view& results_)
66  : A(A_)
67  , boundaryNodes(boundaryNodes_)
68  , results(results_) {}
69 
70  KOKKOS_FORCEINLINE_FUNCTION
71  void operator()(local_ordinal_type rlid) const {
72  auto row = A.rowConst(rlid);
73  const size_t offset = A.graph.row_map(rlid);
74  const bool isBoundaryRow = boundaryNodes(rlid);
75  if (isBoundaryRow) {
76  for (local_ordinal_type k = 0; k < row.length; ++k) {
77  auto clid = row.colidx(k);
78  results(offset + k) = Kokkos::max(rlid == clid ? KEEP : DROP,
79  results(offset + k));
80  }
81  }
82  }
83 };
84 
89 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
91  private:
93  using scalar_type = typename local_matrix_type::value_type;
94  using local_ordinal_type = typename local_matrix_type::ordinal_type;
95  using memory_space = typename local_matrix_type::memory_space;
96  using results_view = Kokkos::View<DecisionType*, memory_space>;
97  using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
98 
103 
104  public:
106  : boundaryNodes(boundaryNodes_)
107  , results(results_) {
108  A = A_.getLocalMatrixDevice();
109  auto boundaryNodesColumn = typename boundary_nodes_view::non_const_type("boundaryNodesColumn", A_.getColMap()->getLocalNumElements());
110  auto boundaryNodesDomain = typename boundary_nodes_view::non_const_type("boundaryNodesDomain", A_.getDomainMap()->getLocalNumElements());
112  boundaryNodesCol = boundaryNodesColumn;
113  }
114 
115  KOKKOS_FORCEINLINE_FUNCTION
116  void operator()(local_ordinal_type rlid) const {
117  auto row = A.rowConst(rlid);
118  const size_t offset = A.graph.row_map(rlid);
119  const bool isBoundaryRow = boundaryNodes(rlid);
120  for (local_ordinal_type k = 0; k < row.length; ++k) {
121  auto clid = row.colidx(k);
122  if (isBoundaryRow || boundaryNodesCol(clid))
123  results(offset + k) = Kokkos::max(rlid == clid ? KEEP : DROP,
124  results(offset + k));
125  }
126  }
127 };
128 
133 template <class local_matrix_type>
135  private:
136  using scalar_type = typename local_matrix_type::value_type;
137  using local_ordinal_type = typename local_matrix_type::ordinal_type;
138  using memory_space = typename local_matrix_type::memory_space;
139  using results_view = Kokkos::View<DecisionType*, memory_space>;
140  using boundary_nodes_view = Kokkos::View<const bool*, memory_space>;
141  using block_indices_view_type = Kokkos::View<local_ordinal_type*, memory_space>;
142 
143  local_matrix_type A;
147 
148  public:
149  VectorDropBoundaryFunctor(local_matrix_type& A_, block_indices_view_type point_to_block_, boundary_nodes_view boundaryNodes_, results_view& results_)
150  : A(A_)
151  , point_to_block(point_to_block_)
152  , boundaryNodes(boundaryNodes_)
153  , results(results_) {}
154 
155  KOKKOS_FORCEINLINE_FUNCTION
156  void operator()(local_ordinal_type rlid) const {
157  auto row = A.rowConst(rlid);
158  const size_t offset = A.graph.row_map(rlid);
159  const bool isBoundaryRow = boundaryNodes(point_to_block(rlid));
160  if (isBoundaryRow) {
161  for (local_ordinal_type k = 0; k < row.length; ++k) {
162  auto clid = row.colidx(k);
163  results(offset + k) = Kokkos::max(rlid == clid ? KEEP : DROP,
164  results(offset + k));
165  }
166  }
167  }
168 };
169 
174 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
176  private:
178  using scalar_type = typename local_matrix_type::value_type;
179  using local_ordinal_type = typename local_matrix_type::ordinal_type;
180  using memory_space = typename local_matrix_type::memory_space;
181  using results_view = Kokkos::View<DecisionType*, memory_space>;
182  using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
183  using block_indices_view_type = Kokkos::View<local_ordinal_type*, memory_space>;
184 
191 
192  public:
194  : point_to_block(point_to_block_)
195  , ghosted_point_to_block(ghosted_point_to_block_)
196  , boundaryNodes(boundaryNodes_)
197  , results(results_) {
198  A = A_.getLocalMatrixDevice();
199  auto boundaryNodesColumn = typename boundary_nodes_view::non_const_type("boundaryNodesColumn", A_.getColMap()->getLocalNumElements());
200  auto boundaryNodesDomain = typename boundary_nodes_view::non_const_type("boundaryNodesDomain", A_.getDomainMap()->getLocalNumElements());
202  boundaryNodesCol = boundaryNodesColumn;
203  }
204 
205  KOKKOS_FORCEINLINE_FUNCTION
206  void operator()(local_ordinal_type rlid) const {
207  auto row = A.rowConst(rlid);
208  const size_t offset = A.graph.row_map(rlid);
209  const bool isBoundaryRow = boundaryNodes(point_to_block(rlid));
210  for (local_ordinal_type k = 0; k < row.length; ++k) {
211  auto clid = row.colidx(k);
212  if (isBoundaryRow || boundaryNodesCol(ghosted_point_to_block(clid))) {
213  results(offset + k) = Kokkos::max(rlid == clid ? KEEP : DROP,
214  results(offset + k));
215  }
216  }
217  }
218 };
219 
224 template <class local_matrix_type>
226  private:
227  using scalar_type = typename local_matrix_type::value_type;
228  using local_ordinal_type = typename local_matrix_type::ordinal_type;
229  using memory_space = typename local_matrix_type::memory_space;
230  using results_view = Kokkos::View<DecisionType*, memory_space>;
231 
232  local_matrix_type A;
234 
235  public:
236  KeepDiagonalFunctor(local_matrix_type& A_, results_view& results_)
237  : A(A_)
238  , results(results_) {}
239 
240  KOKKOS_FORCEINLINE_FUNCTION
241  void operator()(local_ordinal_type rlid) const {
242  auto row = A.rowConst(rlid);
243  const size_t offset = A.graph.row_map(rlid);
244  for (local_ordinal_type k = 0; k < row.length; ++k) {
245  auto clid = row.colidx(k);
246  if ((rlid == clid) && (results(offset + k) != BOUNDARY)) {
247  results(offset + k) = KEEP;
248  break;
249  }
250  }
251  }
252 };
253 
258 template <class local_matrix_type>
260  private:
261  using scalar_type = typename local_matrix_type::value_type;
262  using local_ordinal_type = typename local_matrix_type::ordinal_type;
263  using memory_space = typename local_matrix_type::memory_space;
264  using results_view = Kokkos::View<DecisionType*, memory_space>;
265 
266  local_matrix_type A;
268 
269  public:
270  DropOffRankFunctor(local_matrix_type& A_, results_view& results_)
271  : A(A_)
272  , results(results_) {}
273 
274  KOKKOS_FORCEINLINE_FUNCTION
275  void operator()(local_ordinal_type rlid) const {
276  auto row = A.rowConst(rlid);
277  const size_t offset = A.graph.row_map(rlid);
278  for (local_ordinal_type k = 0; k < row.length; ++k) {
279  auto clid = row.colidx(k);
280  if (clid >= A.numRows()) {
281  results(offset + k) = Kokkos::max(DROP, results(offset + k));
282  }
283  }
284  }
285 };
286 
291 template <class local_matrix_type>
293  private:
294  using scalar_type = typename local_matrix_type::value_type;
295  using local_ordinal_type = typename local_matrix_type::ordinal_type;
296  using memory_space = typename local_matrix_type::memory_space;
297  using results_view = Kokkos::View<DecisionType*, memory_space>;
298 
299  using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
300 
301  local_matrix_type A;
304 
305  public:
306  MarkSingletonFunctor(local_matrix_type& A_, boundary_nodes_view boundaryNodes_, results_view& results_)
307  : A(A_)
308  , boundaryNodes(boundaryNodes_)
309  , results(results_) {}
310 
311  KOKKOS_FORCEINLINE_FUNCTION
312  void operator()(local_ordinal_type rlid) const {
313  auto row = A.rowConst(rlid);
314  const size_t offset = A.graph.row_map(rlid);
315  for (local_ordinal_type k = 0; k < row.length; ++k) {
316  auto clid = row.colidx(k);
317  if ((results(offset + k) == KEEP) && (rlid != clid))
318  return;
319  }
320  boundaryNodes(rlid) = true;
321  for (local_ordinal_type k = 0; k < row.length; ++k) {
322  auto clid = row.colidx(k);
323  if (rlid == clid)
324  results(offset + k) = KEEP;
325  else
326  results(offset + k) = BOUNDARY;
327  }
328  }
329 };
330 
335 template <class local_matrix_type>
337  private:
338  using scalar_type = typename local_matrix_type::value_type;
339  using local_ordinal_type = typename local_matrix_type::ordinal_type;
340  using memory_space = typename local_matrix_type::memory_space;
341  using results_view = Kokkos::View<DecisionType*, memory_space>;
342  using block_indices_view_type = Kokkos::View<local_ordinal_type*, memory_space>;
343 
344  using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
345 
346  local_matrix_type A;
350 
351  public:
352  MarkSingletonVectorFunctor(local_matrix_type& A_, block_indices_view_type point_to_block_, boundary_nodes_view boundaryNodes_, results_view& results_)
353  : A(A_)
354  , point_to_block(point_to_block_)
355  , boundaryNodes(boundaryNodes_)
356  , results(results_) {}
357 
358  KOKKOS_FORCEINLINE_FUNCTION
359  void operator()(local_ordinal_type rlid) const {
360  auto row = A.rowConst(rlid);
361  const size_t offset = A.graph.row_map(rlid);
362  for (local_ordinal_type k = 0; k < row.length; ++k) {
363  auto clid = row.colidx(k);
364  if ((results(offset + k) == KEEP) && (rlid != clid))
365  return;
366  }
367  auto brlid = point_to_block(rlid);
368  boundaryNodes(brlid) = true;
369  for (local_ordinal_type k = 0; k < row.length; ++k) {
370  auto clid = row.colidx(k);
371  if (rlid == clid)
372  results(offset + k) = KEEP;
373  else
374  results(offset + k) = BOUNDARY;
375  }
376  }
377 };
378 
383 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
385  private:
387  using local_matrix_type = typename matrix_type::local_matrix_type;
388 
389  using scalar_type = typename local_matrix_type::value_type;
390  using local_ordinal_type = typename local_matrix_type::ordinal_type;
391  using memory_space = typename local_matrix_type::memory_space;
392  using results_view = Kokkos::View<DecisionType*, memory_space>;
393 
395  using local_block_indices_view_type = typename block_indices_type::dual_view_type_const::t_dev;
396 
401 
402  public:
404  : A(A_.getLocalMatrixDevice())
405  , point_to_block(point_to_block_.getLocalViewDevice(Xpetra::Access::ReadOnly))
406  , results(results_) {
407  auto importer = A_.getCrsGraph()->getImporter();
408 
409  if (!importer.is_null()) {
410  auto ghosted_point_to_blockMV = Xpetra::VectorFactory<LocalOrdinal, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap());
411  ghosted_point_to_blockMV->doImport(point_to_block_, *importer, Xpetra::INSERT);
412  ghosted_point_to_block = ghosted_point_to_blockMV->getLocalViewDevice(Xpetra::Access::ReadOnly);
413  } else
415  }
416 
417  KOKKOS_FORCEINLINE_FUNCTION
418  void operator()(local_ordinal_type rlid) const {
419  auto row = A.rowConst(rlid);
420  const size_t offset = A.graph.row_map(rlid);
421  for (local_ordinal_type k = 0; k < row.length; ++k) {
422  auto clid = row.colidx(k);
423  if (point_to_block(rlid, 0) == ghosted_point_to_block(clid, 0)) {
424  results(offset + k) = Kokkos::max(KEEP, results(offset + k));
425  } else {
426  results(offset + k) = Kokkos::max(DROP, results(offset + k));
427  }
428  }
429  }
430 };
431 
436 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
438  private:
440  using local_matrix_type = typename matrix_type::local_matrix_type;
441 
442  using scalar_type = typename local_matrix_type::value_type;
443  using local_ordinal_type = typename local_matrix_type::ordinal_type;
444  using memory_space = typename local_matrix_type::memory_space;
445  using results_view = Kokkos::View<DecisionType*, memory_space>;
446 
448  using local_block_indices_view_type = typename block_indices_type::dual_view_type_const::t_dev;
449  using id_translation_type = Kokkos::View<local_ordinal_type*, memory_space>;
451 
459 
460  public:
461  BlockDiagonalizeVectorFunctor(matrix_type& A_, block_indices_type& point_to_block_, const RCP<const importer_type>& importer, results_view& results_, id_translation_type row_translation_, id_translation_type col_translation_)
462  : A(A_.getLocalMatrixDevice())
463  , point_to_block(point_to_block_.getLocalViewDevice(Xpetra::Access::ReadOnly))
464  , results(results_)
465  , row_translation(row_translation_)
466  , col_translation(col_translation_) {
467  if (!importer.is_null()) {
469  ghosted_point_to_blockMV->doImport(point_to_block_, *importer, Xpetra::INSERT);
470  ghosted_point_to_block = ghosted_point_to_blockMV->getLocalViewDevice(Xpetra::Access::ReadOnly);
471  } else
473  }
474 
475  KOKKOS_FORCEINLINE_FUNCTION
476  void operator()(local_ordinal_type rlid) const {
477  auto row = A.rowConst(rlid);
478  const size_t offset = A.graph.row_map(rlid);
479  auto brlid = row_translation(rlid);
480  for (local_ordinal_type k = 0; k < row.length; ++k) {
481  auto clid = row.colidx(k);
482  auto bclid = col_translation(clid);
483  if (point_to_block(brlid, 0) == ghosted_point_to_block(bclid, 0)) {
484  results(offset + k) = Kokkos::max(KEEP, results(offset + k));
485  } else {
486  results(offset + k) = Kokkos::max(DROP, results(offset + k));
487  }
488  }
489  }
490 };
491 
496 template <class local_matrix_type>
498  private:
499  using scalar_type = typename local_matrix_type::value_type;
500  using local_ordinal_type = typename local_matrix_type::ordinal_type;
501  using memory_space = typename local_matrix_type::memory_space;
502  using results_view = Kokkos::View<DecisionType*, memory_space>;
503 
504  using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
505 
506  local_matrix_type A;
508 
509  public:
510  DebugFunctor(local_matrix_type& A_, results_view& results_)
511  : A(A_)
512  , results(results_) {}
513 
514  KOKKOS_FORCEINLINE_FUNCTION
515  void operator()(local_ordinal_type rlid) const {
516  auto row = A.rowConst(rlid);
517  const size_t offset = A.graph.row_map(rlid);
518  for (local_ordinal_type k = 0; k < row.length; ++k) {
519  if (results(offset + k) == UNDECIDED) {
520  Kokkos::printf("No dropping decision was taken for entry (%d, %d)\n", rlid, row.colidx(k));
521  assert(false);
522  }
523  }
524  }
525 };
526 
531 template <class local_matrix_type>
533  private:
534  using scalar_type = typename local_matrix_type::value_type;
535  using local_ordinal_type = typename local_matrix_type::ordinal_type;
536  using memory_space = typename local_matrix_type::memory_space;
537  using results_view = Kokkos::View<DecisionType*, memory_space>;
538 
539  local_matrix_type A;
541 
542  public:
543  SymmetrizeFunctor(local_matrix_type& A_, results_view& results_)
544  : A(A_)
545  , results(results_) {}
546 
547  KOKKOS_FORCEINLINE_FUNCTION
548  void operator()(local_ordinal_type rlid) const {
549  auto row = A.rowConst(rlid);
550  const size_t offset = A.graph.row_map(rlid);
551  for (local_ordinal_type k = 0; k < row.length; ++k) {
552  if (results(offset + k) == KEEP) {
553  auto clid = row.colidx(k);
554  if (clid >= A.numRows())
555  continue;
556  auto row2 = A.rowConst(clid);
557  const size_t offset2 = A.graph.row_map(clid);
558  for (local_ordinal_type k2 = 0; k2 < row2.length; ++k2) {
559  auto clid2 = row2.colidx(k2);
560  if (clid2 == rlid) {
561  if (results(offset2 + k2) == DROP)
562  results(offset2 + k2) = KEEP;
563  break;
564  }
565  }
566  }
567  }
568  }
569 };
570 
571 template <class view_type, class comparator_type>
572 KOKKOS_INLINE_FUNCTION void serialHeapSort(view_type& v, comparator_type comparator) {
573  auto N = v.extent(0);
574  size_t start = N / 2;
575  size_t end = N;
576  while (end > 1) {
577  if (start > 0)
578  start = start - 1;
579  else {
580  end = end - 1;
581  auto temp = v(0);
582  v(0) = v(end);
583  v(end) = temp;
584  }
585  size_t root = start;
586  while (2 * root + 1 < end) {
587  size_t child = 2 * root + 1;
588  if ((child + 1 < end) and (comparator(v(child), v(child + 1))))
589  ++child;
590 
591  if (comparator(v(root), v(child))) {
592  auto temp = v(root);
593  v(root) = v(child);
594  v(child) = temp;
595  root = child;
596  } else
597  break;
598  }
599  }
600 }
601 
604 enum StrengthMeasure : int {
605  /*
606  \f[
607  \frac{|A_{ij}|^2}{|A_{ii}| |A_{jj}|} \le \theta^2
608  \f]
609  */
611  /*
612  \f[
613  \frac{-\operatorname{Re}A_{ij}}{| max_j -A_{ij}|} \le \theta
614  \f]
615  */
617 
618  /*
619  \f[
620  \frac{-\operatorname{sign}(A_{ij}) |A_{ij}|^2}{|A_{ii}| |A_{jj}|} \le \theta^2
621  \f]
622  */
624 
625  /*
626  \f[
627  |A_{ij}| \le \theta
628  \f]
629  */
631 };
632 
633 } // namespace Misc
634 
635 } // namespace MueLu
636 
637 #define MUELU_ETI_SLGN_SoC(CLASSNAME, SC, LO, GO, NO) \
638  template class CLASSNAME<SC, LO, GO, NO, MueLu::Misc::SmoothedAggregationMeasure>; \
639  template class CLASSNAME<SC, LO, GO, NO, MueLu::Misc::SignedRugeStuebenMeasure>; \
640  template class CLASSNAME<SC, LO, GO, NO, MueLu::Misc::SignedSmoothedAggregationMeasure>; \
641  template class CLASSNAME<SC, LO, GO, NO, MueLu::Misc::UnscaledMeasure>;
642 
643 #endif
typename matrix_type::local_matrix_type local_matrix_type
PointwiseSymmetricDropBoundaryFunctor(Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A_, boundary_nodes_view boundaryNodes_, results_view &results_)
typename Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >::local_matrix_type local_matrix_type
Kokkos::View< local_ordinal_type *, memory_space > block_indices_view_type
static void DetectDirichletColsAndDomains(const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Teuchos::ArrayRCP< bool > &dirichletRows, Teuchos::ArrayRCP< bool > dirichletCols, Teuchos::ArrayRCP< bool > dirichletDomain)
Detects Dirichlet columns &amp; domains from a list of Dirichlet rows.
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
typename block_indices_type::dual_view_type_const::t_dev local_block_indices_view_type
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
typename local_matrix_type::value_type scalar_type
DebugFunctor(local_matrix_type &A_, results_view &results_)
typename local_matrix_type::ordinal_type local_ordinal_type
typename local_matrix_type::memory_space memory_space
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
typename local_matrix_type::memory_space memory_space
typename local_matrix_type::memory_space memory_space
typename local_matrix_type::ordinal_type local_ordinal_type
Kokkos::View< DecisionType *, memory_space > results_view
typename local_matrix_type::value_type scalar_type
typename local_matrix_type::value_type scalar_type
Functor that drops boundary nodes for a blockSize &gt; 1 problem.
Kokkos::View< DecisionType *, memory_space > results_view
typename local_matrix_type::value_type scalar_type
Functor that marks singletons (all off-diagonal entries in a row are dropped) as boundary.
typename local_matrix_type::ordinal_type local_ordinal_type
typename local_matrix_type::memory_space memory_space
BlockDiagonalizeFunctor(matrix_type &A_, block_indices_type &point_to_block_, results_view &results_)
typename local_matrix_type::value_type scalar_type
typename local_matrix_type::memory_space memory_space
typename local_matrix_type::ordinal_type local_ordinal_type
local_block_indices_view_type ghosted_point_to_block
typename local_matrix_type::ordinal_type local_ordinal_type
Kokkos::View< DecisionType *, memory_space > results_view
local_block_indices_view_type point_to_block
Functor that checks that all entries have been marked.
typename local_matrix_type::memory_space memory_space
Kokkos::View< bool *, memory_space > boundary_nodes_view
Functor that drops boundary nodes for a blockSize == 1 problem.
typename local_matrix_type::ordinal_type local_ordinal_type
Kokkos::View< bool *, memory_space > boundary_nodes_view
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
Kokkos::View< DecisionType *, memory_space > results_view
typename local_matrix_type::memory_space memory_space
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const =0
Functor that marks singletons (all off-diagonal entries in a row are dropped) as boundary.
typename local_matrix_type::value_type scalar_type
typename Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >::local_matrix_type local_matrix_type
Kokkos::View< DecisionType *, memory_space > results_view
typename local_matrix_type::ordinal_type local_ordinal_type
Kokkos::View< DecisionType *, memory_space > results_view
typename local_matrix_type::ordinal_type local_ordinal_type
VectorDropBoundaryFunctor(local_matrix_type &A_, block_indices_view_type point_to_block_, boundary_nodes_view boundaryNodes_, results_view &results_)
DropOffRankFunctor(local_matrix_type &A_, results_view &results_)
typename block_indices_type::dual_view_type_const::t_dev local_block_indices_view_type
KOKKOS_INLINE_FUNCTION void serialHeapSort(view_type &v, comparator_type comparator)
BlockDiagonalizeVectorFunctor(matrix_type &A_, block_indices_type &point_to_block_, const RCP< const importer_type > &importer, results_view &results_, id_translation_type row_translation_, id_translation_type col_translation_)
typename local_matrix_type::value_type scalar_type
Teuchos::RCP< block_indices_type > ghosted_point_to_blockMV
Functor that symmetrizes the dropping decisions.
Functor that drops boundary nodes for a blockSize == 1 problem.
Functor that drops off-rank entries.
typename local_matrix_type::memory_space memory_space
Kokkos::View< DecisionType *, memory_space > results_view
typename local_matrix_type::memory_space memory_space
Kokkos::View< const bool *, memory_space > boundary_nodes_view
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
typename local_matrix_type::memory_space memory_space
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
typename local_matrix_type::ordinal_type local_ordinal_type
local_block_indices_view_type ghosted_point_to_block
Kokkos::View< bool *, memory_space > boundary_nodes_view
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
typename matrix_type::local_matrix_type local_matrix_type
typename local_matrix_type::memory_space memory_space
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
Functor that drops all entries that are not on the block diagonal.
Functor that marks diagonal as kept, unless the are already marked as boundary.
Kokkos::View< DecisionType *, memory_space > results_view
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
static RCP< Vector > Build(const Teuchos::RCP< const Map > &map, bool zeroOut=true)
void start()
VectorSymmetricDropBoundaryFunctor(Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A_, block_indices_view_type point_to_block_, block_indices_view_type ghosted_point_to_block_, boundary_nodes_view boundaryNodes_, results_view &results_)
MarkSingletonFunctor(local_matrix_type &A_, boundary_nodes_view boundaryNodes_, results_view &results_)
typename local_matrix_type::value_type scalar_type
typename local_matrix_type::ordinal_type local_ordinal_type
typename local_matrix_type::value_type scalar_type
virtual RCP< const CrsGraph > getCrsGraph() const =0
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
typename local_matrix_type::memory_space memory_space
Kokkos::View< local_ordinal_type *, memory_space > id_translation_type
Functor that drops boundary nodes for a blockSize &gt; 1 problem.
typename local_matrix_type::ordinal_type local_ordinal_type
typename local_matrix_type::value_type scalar_type
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
Kokkos::View< bool *, memory_space > boundary_nodes_view
SymmetrizeFunctor(local_matrix_type &A_, results_view &results_)
Kokkos::View< DecisionType *, memory_space > results_view
MarkSingletonVectorFunctor(local_matrix_type &A_, block_indices_view_type point_to_block_, boundary_nodes_view boundaryNodes_, results_view &results_)
Kokkos::View< const bool *, memory_space > boundary_nodes_view
PointwiseDropBoundaryFunctor(local_matrix_type &A_, boundary_nodes_view boundaryNodes_, results_view &results_)
Kokkos::View< DecisionType *, memory_space > results_view
Functor that drops all entries that are not on the block diagonal.
Kokkos::View< bool *, memory_space > boundary_nodes_view
Kokkos::View< DecisionType *, memory_space > results_view
typename local_matrix_type::ordinal_type local_ordinal_type
Kokkos::View< local_ordinal_type *, memory_space > block_indices_view_type
TransListIter end
Kokkos::View< local_ordinal_type *, memory_space > block_indices_view_type
typename local_matrix_type::value_type scalar_type
KeepDiagonalFunctor(local_matrix_type &A_, results_view &results_)
Kokkos::View< DecisionType *, memory_space > results_view
virtual Teuchos::RCP< const Map > getDomainMap() const =0
typename local_matrix_type::value_type scalar_type
bool is_null() const