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 #include "Kokkos_Core.hpp"
14 #include "Kokkos_ArithTraits.hpp"
15 #include "Xpetra_Access.hpp"
16 #include "Xpetra_Matrix.hpp"
17 #include "Xpetra_VectorFactory.hpp"
18 #include "MueLu_Utilities.hpp"
19 
20 namespace MueLu {
21 
26 enum DecisionType : char {
27  UNDECIDED = 0, // no decision has been taken yet, used for initialization
28  KEEP = 1, // keeep the entry
29  DROP = 2, // drop it
30  BOUNDARY = 3 // entry is a boundary
31 };
32 
33 namespace Misc {
34 
35 template <class local_ordinal_type>
36 class NoOpFunctor {
37  public:
39 
40  KOKKOS_FORCEINLINE_FUNCTION
41  void operator()(local_ordinal_type rlid) const {
42  }
43 };
44 
49 template <class local_matrix_type>
51  private:
52  using scalar_type = typename local_matrix_type::value_type;
53  using local_ordinal_type = typename local_matrix_type::ordinal_type;
54  using memory_space = typename local_matrix_type::memory_space;
55  using results_view = Kokkos::View<DecisionType*, memory_space>;
56  using boundary_nodes_view = Kokkos::View<const bool*, memory_space>;
57 
58  local_matrix_type A;
61 
62  public:
63  PointwiseDropBoundaryFunctor(local_matrix_type& A_, boundary_nodes_view boundaryNodes_, results_view& results_)
64  : A(A_)
65  , boundaryNodes(boundaryNodes_)
66  , results(results_) {}
67 
68  KOKKOS_FORCEINLINE_FUNCTION
69  void operator()(local_ordinal_type rlid) const {
70  auto row = A.rowConst(rlid);
71  const size_t offset = A.graph.row_map(rlid);
72  const bool isBoundaryRow = boundaryNodes(rlid);
73  if (isBoundaryRow) {
74  for (local_ordinal_type k = 0; k < row.length; ++k) {
75  auto clid = row.colidx(k);
76  results(offset + k) = Kokkos::max(rlid == clid ? KEEP : DROP,
77  results(offset + k));
78  }
79  }
80  }
81 };
82 
87 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
89  private:
91  using scalar_type = typename local_matrix_type::value_type;
92  using local_ordinal_type = typename local_matrix_type::ordinal_type;
93  using memory_space = typename local_matrix_type::memory_space;
94  using results_view = Kokkos::View<DecisionType*, memory_space>;
95  using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
96 
101 
102  public:
104  : boundaryNodes(boundaryNodes_)
105  , results(results_) {
106  A = A_.getLocalMatrixDevice();
107  auto boundaryNodesColumn = typename boundary_nodes_view::non_const_type("boundaryNodesColumn", A_.getColMap()->getLocalNumElements());
108  auto boundaryNodesDomain = typename boundary_nodes_view::non_const_type("boundaryNodesDomain", A_.getDomainMap()->getLocalNumElements());
110  boundaryNodesCol = boundaryNodesColumn;
111  }
112 
113  KOKKOS_FORCEINLINE_FUNCTION
114  void operator()(local_ordinal_type rlid) const {
115  auto row = A.rowConst(rlid);
116  const size_t offset = A.graph.row_map(rlid);
117  const bool isBoundaryRow = boundaryNodes(rlid);
118  for (local_ordinal_type k = 0; k < row.length; ++k) {
119  auto clid = row.colidx(k);
120  if (isBoundaryRow || boundaryNodesCol(clid))
121  results(offset + k) = Kokkos::max(rlid == clid ? KEEP : DROP,
122  results(offset + k));
123  }
124  }
125 };
126 
131 template <class local_matrix_type>
133  private:
134  using scalar_type = typename local_matrix_type::value_type;
135  using local_ordinal_type = typename local_matrix_type::ordinal_type;
136  using memory_space = typename local_matrix_type::memory_space;
137  using results_view = Kokkos::View<DecisionType*, memory_space>;
138  using boundary_nodes_view = Kokkos::View<const bool*, memory_space>;
139  using block_indices_view_type = Kokkos::View<local_ordinal_type*, memory_space>;
140 
141  local_matrix_type A;
145 
146  public:
147  VectorDropBoundaryFunctor(local_matrix_type& A_, block_indices_view_type point_to_block_, boundary_nodes_view boundaryNodes_, results_view& results_)
148  : A(A_)
149  , point_to_block(point_to_block_)
150  , boundaryNodes(boundaryNodes_)
151  , results(results_) {}
152 
153  KOKKOS_FORCEINLINE_FUNCTION
154  void operator()(local_ordinal_type rlid) const {
155  auto row = A.rowConst(rlid);
156  const size_t offset = A.graph.row_map(rlid);
157  const bool isBoundaryRow = boundaryNodes(point_to_block(rlid));
158  if (isBoundaryRow) {
159  for (local_ordinal_type k = 0; k < row.length; ++k) {
160  auto clid = row.colidx(k);
161  results(offset + k) = Kokkos::max(rlid == clid ? KEEP : DROP,
162  results(offset + k));
163  }
164  }
165  }
166 };
167 
172 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
174  private:
176  using scalar_type = typename local_matrix_type::value_type;
177  using local_ordinal_type = typename local_matrix_type::ordinal_type;
178  using memory_space = typename local_matrix_type::memory_space;
179  using results_view = Kokkos::View<DecisionType*, memory_space>;
180  using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
181  using block_indices_view_type = Kokkos::View<local_ordinal_type*, memory_space>;
182 
189 
190  public:
192  : point_to_block(point_to_block_)
193  , ghosted_point_to_block(ghosted_point_to_block_)
194  , boundaryNodes(boundaryNodes_)
195  , results(results_) {
196  A = A_.getLocalMatrixDevice();
197  auto boundaryNodesColumn = typename boundary_nodes_view::non_const_type("boundaryNodesColumn", A_.getColMap()->getLocalNumElements());
198  auto boundaryNodesDomain = typename boundary_nodes_view::non_const_type("boundaryNodesDomain", A_.getDomainMap()->getLocalNumElements());
200  boundaryNodesCol = boundaryNodesColumn;
201  }
202 
203  KOKKOS_FORCEINLINE_FUNCTION
204  void operator()(local_ordinal_type rlid) const {
205  auto row = A.rowConst(rlid);
206  const size_t offset = A.graph.row_map(rlid);
207  const bool isBoundaryRow = boundaryNodes(point_to_block(rlid));
208  for (local_ordinal_type k = 0; k < row.length; ++k) {
209  auto clid = row.colidx(k);
210  if (isBoundaryRow || boundaryNodesCol(ghosted_point_to_block(clid))) {
211  results(offset + k) = Kokkos::max(rlid == clid ? KEEP : DROP,
212  results(offset + k));
213  }
214  }
215  }
216 };
217 
222 template <class local_matrix_type>
224  private:
225  using scalar_type = typename local_matrix_type::value_type;
226  using local_ordinal_type = typename local_matrix_type::ordinal_type;
227  using memory_space = typename local_matrix_type::memory_space;
228  using results_view = Kokkos::View<DecisionType*, memory_space>;
229 
230  local_matrix_type A;
232 
233  public:
234  KeepDiagonalFunctor(local_matrix_type& A_, results_view& results_)
235  : A(A_)
236  , results(results_) {}
237 
238  KOKKOS_FORCEINLINE_FUNCTION
239  void operator()(local_ordinal_type rlid) const {
240  auto row = A.rowConst(rlid);
241  const size_t offset = A.graph.row_map(rlid);
242  for (local_ordinal_type k = 0; k < row.length; ++k) {
243  auto clid = row.colidx(k);
244  if ((rlid == clid) && (results(offset + k) != BOUNDARY)) {
245  results(offset + k) = KEEP;
246  break;
247  }
248  }
249  }
250 };
251 
256 template <class local_matrix_type>
258  private:
259  using scalar_type = typename local_matrix_type::value_type;
260  using local_ordinal_type = typename local_matrix_type::ordinal_type;
261  using memory_space = typename local_matrix_type::memory_space;
262  using results_view = Kokkos::View<DecisionType*, memory_space>;
263 
264  local_matrix_type A;
266 
267  public:
268  DropOffRankFunctor(local_matrix_type& A_, results_view& results_)
269  : A(A_)
270  , results(results_) {}
271 
272  KOKKOS_FORCEINLINE_FUNCTION
273  void operator()(local_ordinal_type rlid) const {
274  auto row = A.rowConst(rlid);
275  const size_t offset = A.graph.row_map(rlid);
276  for (local_ordinal_type k = 0; k < row.length; ++k) {
277  auto clid = row.colidx(k);
278  if (clid >= A.numRows()) {
279  results(offset + k) = Kokkos::max(DROP, results(offset + k));
280  }
281  }
282  }
283 };
284 
289 template <class local_matrix_type>
291  private:
292  using scalar_type = typename local_matrix_type::value_type;
293  using local_ordinal_type = typename local_matrix_type::ordinal_type;
294  using memory_space = typename local_matrix_type::memory_space;
295  using results_view = Kokkos::View<DecisionType*, memory_space>;
296 
297  using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
298 
299  local_matrix_type A;
302 
303  public:
304  MarkSingletonFunctor(local_matrix_type& A_, boundary_nodes_view boundaryNodes_, results_view& results_)
305  : A(A_)
306  , boundaryNodes(boundaryNodes_)
307  , results(results_) {}
308 
309  KOKKOS_FORCEINLINE_FUNCTION
310  void operator()(local_ordinal_type rlid) const {
311  auto row = A.rowConst(rlid);
312  const size_t offset = A.graph.row_map(rlid);
313  for (local_ordinal_type k = 0; k < row.length; ++k) {
314  auto clid = row.colidx(k);
315  if ((results(offset + k) == KEEP) && (rlid != clid))
316  return;
317  }
318  boundaryNodes(rlid) = true;
319  for (local_ordinal_type k = 0; k < row.length; ++k) {
320  auto clid = row.colidx(k);
321  if (rlid == clid)
322  results(offset + k) = KEEP;
323  else
324  results(offset + k) = BOUNDARY;
325  }
326  }
327 };
328 
333 template <class local_matrix_type>
335  private:
336  using scalar_type = typename local_matrix_type::value_type;
337  using local_ordinal_type = typename local_matrix_type::ordinal_type;
338  using memory_space = typename local_matrix_type::memory_space;
339  using results_view = Kokkos::View<DecisionType*, memory_space>;
340  using block_indices_view_type = Kokkos::View<local_ordinal_type*, memory_space>;
341 
342  using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
343 
344  local_matrix_type A;
348 
349  public:
350  MarkSingletonVectorFunctor(local_matrix_type& A_, block_indices_view_type point_to_block_, boundary_nodes_view boundaryNodes_, results_view& results_)
351  : A(A_)
352  , point_to_block(point_to_block_)
353  , boundaryNodes(boundaryNodes_)
354  , results(results_) {}
355 
356  KOKKOS_FORCEINLINE_FUNCTION
357  void operator()(local_ordinal_type rlid) const {
358  auto row = A.rowConst(rlid);
359  const size_t offset = A.graph.row_map(rlid);
360  for (local_ordinal_type k = 0; k < row.length; ++k) {
361  auto clid = row.colidx(k);
362  if ((results(offset + k) == KEEP) && (rlid != clid))
363  return;
364  }
365  auto brlid = point_to_block(rlid);
366  boundaryNodes(brlid) = true;
367  for (local_ordinal_type k = 0; k < row.length; ++k) {
368  auto clid = row.colidx(k);
369  if (rlid == clid)
370  results(offset + k) = KEEP;
371  else
372  results(offset + k) = BOUNDARY;
373  }
374  }
375 };
376 
381 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
383  private:
385  using local_matrix_type = typename matrix_type::local_matrix_type;
386 
387  using scalar_type = typename local_matrix_type::value_type;
388  using local_ordinal_type = typename local_matrix_type::ordinal_type;
389  using memory_space = typename local_matrix_type::memory_space;
390  using results_view = Kokkos::View<DecisionType*, memory_space>;
391 
393  using local_block_indices_view_type = typename block_indices_type::dual_view_type_const::t_dev;
394 
399 
400  public:
402  : A(A_.getLocalMatrixDevice())
403  , point_to_block(point_to_block_.getLocalViewDevice(Xpetra::Access::ReadOnly))
404  , results(results_) {
405  auto importer = A_.getCrsGraph()->getImporter();
406 
407  if (!importer.is_null()) {
408  auto ghosted_point_to_blockMV = Xpetra::VectorFactory<LocalOrdinal, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap());
409  ghosted_point_to_blockMV->doImport(point_to_block_, *importer, Xpetra::INSERT);
410  ghosted_point_to_block = ghosted_point_to_blockMV->getLocalViewDevice(Xpetra::Access::ReadOnly);
411  } else
413  }
414 
415  KOKKOS_FORCEINLINE_FUNCTION
416  void operator()(local_ordinal_type rlid) const {
417  auto row = A.rowConst(rlid);
418  const size_t offset = A.graph.row_map(rlid);
419  for (local_ordinal_type k = 0; k < row.length; ++k) {
420  auto clid = row.colidx(k);
421  if (point_to_block(rlid, 0) == ghosted_point_to_block(clid, 0)) {
422  results(offset + k) = Kokkos::max(KEEP, results(offset + k));
423  } else {
424  results(offset + k) = Kokkos::max(DROP, results(offset + k));
425  }
426  }
427  }
428 };
429 
434 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
436  private:
438  using local_matrix_type = typename matrix_type::local_matrix_type;
439 
440  using scalar_type = typename local_matrix_type::value_type;
441  using local_ordinal_type = typename local_matrix_type::ordinal_type;
442  using memory_space = typename local_matrix_type::memory_space;
443  using results_view = Kokkos::View<DecisionType*, memory_space>;
444 
446  using local_block_indices_view_type = typename block_indices_type::dual_view_type_const::t_dev;
447  using id_translation_type = Kokkos::View<local_ordinal_type*, memory_space>;
449 
457 
458  public:
459  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_)
460  : A(A_.getLocalMatrixDevice())
461  , point_to_block(point_to_block_.getLocalViewDevice(Xpetra::Access::ReadOnly))
462  , results(results_)
463  , row_translation(row_translation_)
464  , col_translation(col_translation_) {
465  if (!importer.is_null()) {
467  ghosted_point_to_blockMV->doImport(point_to_block_, *importer, Xpetra::INSERT);
468  ghosted_point_to_block = ghosted_point_to_blockMV->getLocalViewDevice(Xpetra::Access::ReadOnly);
469  } else
471  }
472 
473  KOKKOS_FORCEINLINE_FUNCTION
474  void operator()(local_ordinal_type rlid) const {
475  auto row = A.rowConst(rlid);
476  const size_t offset = A.graph.row_map(rlid);
477  auto brlid = row_translation(rlid);
478  for (local_ordinal_type k = 0; k < row.length; ++k) {
479  auto clid = row.colidx(k);
480  auto bclid = col_translation(clid);
481  if (point_to_block(brlid, 0) == ghosted_point_to_block(bclid, 0)) {
482  results(offset + k) = Kokkos::max(KEEP, results(offset + k));
483  } else {
484  results(offset + k) = Kokkos::max(DROP, results(offset + k));
485  }
486  }
487  }
488 };
489 
494 template <class local_matrix_type>
496  private:
497  using scalar_type = typename local_matrix_type::value_type;
498  using local_ordinal_type = typename local_matrix_type::ordinal_type;
499  using memory_space = typename local_matrix_type::memory_space;
500  using results_view = Kokkos::View<DecisionType*, memory_space>;
501 
502  using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
503 
504  local_matrix_type A;
506 
507  public:
508  DebugFunctor(local_matrix_type& A_, results_view& results_)
509  : A(A_)
510  , results(results_) {}
511 
512  KOKKOS_FORCEINLINE_FUNCTION
513  void operator()(local_ordinal_type rlid) const {
514  auto row = A.rowConst(rlid);
515  const size_t offset = A.graph.row_map(rlid);
516  for (local_ordinal_type k = 0; k < row.length; ++k) {
517  if (results(offset + k) == UNDECIDED) {
518  Kokkos::printf("No dropping decision was taken for entry (%d, %d)\n", rlid, row.colidx(k));
519  assert(false);
520  }
521  }
522  }
523 };
524 
529 template <class local_matrix_type>
531  private:
532  using scalar_type = typename local_matrix_type::value_type;
533  using local_ordinal_type = typename local_matrix_type::ordinal_type;
534  using memory_space = typename local_matrix_type::memory_space;
535  using results_view = Kokkos::View<DecisionType*, memory_space>;
536 
537  local_matrix_type A;
539 
540  public:
541  SymmetrizeFunctor(local_matrix_type& A_, results_view& results_)
542  : A(A_)
543  , results(results_) {}
544 
545  KOKKOS_FORCEINLINE_FUNCTION
546  void operator()(local_ordinal_type rlid) const {
547  auto row = A.rowConst(rlid);
548  const size_t offset = A.graph.row_map(rlid);
549  for (local_ordinal_type k = 0; k < row.length; ++k) {
550  if (results(offset + k) == KEEP) {
551  auto clid = row.colidx(k);
552  if (clid >= A.numRows())
553  continue;
554  auto row2 = A.rowConst(clid);
555  const size_t offset2 = A.graph.row_map(clid);
556  for (local_ordinal_type k2 = 0; k2 < row2.length; ++k2) {
557  auto clid2 = row2.colidx(k2);
558  if (clid2 == rlid) {
559  if (results(offset2 + k2) == DROP)
560  results(offset2 + k2) = KEEP;
561  break;
562  }
563  }
564  }
565  }
566  }
567 };
568 
569 template <class view_type, class comparator_type>
570 KOKKOS_INLINE_FUNCTION void serialHeapSort(view_type& v, comparator_type comparator) {
571  auto N = v.extent(0);
572  size_t start = N / 2;
573  size_t end = N;
574  while (end > 1) {
575  if (start > 0)
576  start = start - 1;
577  else {
578  end = end - 1;
579  auto temp = v(0);
580  v(0) = v(end);
581  v(end) = temp;
582  }
583  size_t root = start;
584  while (2 * root + 1 < end) {
585  size_t child = 2 * root + 1;
586  if ((child + 1 < end) and (comparator(v(child), v(child + 1))))
587  ++child;
588 
589  if (comparator(v(root), v(child))) {
590  auto temp = v(root);
591  v(root) = v(child);
592  v(child) = temp;
593  root = child;
594  } else
595  break;
596  }
597  }
598 }
599 
602 enum StrengthMeasure : int {
603  /*
604  \f[
605  \frac{|A_{ij}|^2}{|A_{ii}| |A_{jj}|} \le \theta^2
606  \f]
607  */
609  /*
610  \f[
611  \frac{-\operatorname{Re}A_{ij}}{| max_j -A_{ij}|} \le \theta
612  \f]
613  */
615 
616  /*
617  \f[
618  \frac{-\operatorname{sign}(A_{ij}) |A_{ij}|^2}{|A_{ii}| |A_{jj}|} \le \theta^2
619  \f]
620  */
622 
623  /*
624  \f[
625  |A_{ij}| \le \theta
626  \f]
627  */
629 };
630 
631 } // namespace Misc
632 
633 } // namespace MueLu
634 
635 #define MUELU_ETI_SLGN_SoC(CLASSNAME, SC, LO, GO, NO) \
636  template class CLASSNAME<SC, LO, GO, NO, MueLu::Misc::SmoothedAggregationMeasure>; \
637  template class CLASSNAME<SC, LO, GO, NO, MueLu::Misc::SignedRugeStuebenMeasure>; \
638  template class CLASSNAME<SC, LO, GO, NO, MueLu::Misc::SignedSmoothedAggregationMeasure>; \
639  template class CLASSNAME<SC, LO, GO, NO, MueLu::Misc::UnscaledMeasure>;
640 
641 #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