MueLu Version of the Day
Loading...
Searching...
No Matches
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#if KOKKOS_VERSION >= 40799
17#include "KokkosKernels_ArithTraits.hpp"
18#else
19#include "Kokkos_ArithTraits.hpp"
20#endif
21#include "Tpetra_Access.hpp"
22#include "Xpetra_Matrix.hpp"
23#include "Xpetra_VectorFactory.hpp"
24#include "MueLu_Utilities.hpp"
25
26namespace MueLu {
27
32enum DecisionType : char {
33 UNDECIDED = 0, // no decision has been taken yet, used for initialization
34 KEEP = 1, // keeep the entry
35 DROP = 2, // drop it
36 BOUNDARY = 3 // entry is a boundary
37};
38
39namespace Misc {
40
41template <class local_ordinal_type>
43 public:
45
46 KOKKOS_FORCEINLINE_FUNCTION
47 void operator()(local_ordinal_type rlid) const {
48 }
49};
50
55template <class local_matrix_type>
57 private:
58 using scalar_type = typename local_matrix_type::value_type;
59 using local_ordinal_type = typename local_matrix_type::ordinal_type;
60 using memory_space = typename local_matrix_type::memory_space;
61 using results_view = Kokkos::View<DecisionType*, memory_space>;
62 using boundary_nodes_view = Kokkos::View<const bool*, memory_space>;
63
64 local_matrix_type A;
67
68 public:
69 PointwiseDropBoundaryFunctor(local_matrix_type& A_, boundary_nodes_view boundaryNodes_, results_view& results_)
70 : A(A_)
71 , boundaryNodes(boundaryNodes_)
72 , results(results_) {}
73
74 KOKKOS_FORCEINLINE_FUNCTION
75 void operator()(local_ordinal_type rlid) const {
76 auto row = A.rowConst(rlid);
77 const size_t offset = A.graph.row_map(rlid);
78 const bool isBoundaryRow = boundaryNodes(rlid);
79 if (isBoundaryRow) {
80 for (local_ordinal_type k = 0; k < row.length; ++k) {
81 auto clid = row.colidx(k);
82 results(offset + k) = Kokkos::max(rlid == clid ? KEEP : DROP,
83 results(offset + k));
84 }
85 }
86 }
87};
88
93template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
95 private:
96 using local_matrix_type = typename Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::local_matrix_device_type;
97 using scalar_type = typename local_matrix_type::value_type;
98 using local_ordinal_type = typename local_matrix_type::ordinal_type;
99 using memory_space = typename local_matrix_type::memory_space;
100 using results_view = Kokkos::View<DecisionType*, memory_space>;
101 using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
102
107
108 public:
109 PointwiseSymmetricDropBoundaryFunctor(Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A_, boundary_nodes_view boundaryNodes_, results_view& results_)
110 : boundaryNodes(boundaryNodes_)
111 , results(results_) {
112 A = A_.getLocalMatrixDevice();
113 auto boundaryNodesColumn = typename boundary_nodes_view::non_const_type("boundaryNodesColumn", A_.getColMap()->getLocalNumElements());
114 auto boundaryNodesDomain = typename boundary_nodes_view::non_const_type("boundaryNodesDomain", A_.getDomainMap()->getLocalNumElements());
116 boundaryNodesCol = boundaryNodesColumn;
117 }
118
119 KOKKOS_FORCEINLINE_FUNCTION
121 auto row = A.rowConst(rlid);
122 const size_t offset = A.graph.row_map(rlid);
123 const bool isBoundaryRow = boundaryNodes(rlid);
124 for (local_ordinal_type k = 0; k < row.length; ++k) {
125 auto clid = row.colidx(k);
126 if (isBoundaryRow || boundaryNodesCol(clid))
127 results(offset + k) = Kokkos::max(rlid == clid ? KEEP : DROP,
128 results(offset + k));
129 }
130 }
131};
132
137template <class local_matrix_type>
139 private:
140 using scalar_type = typename local_matrix_type::value_type;
141 using local_ordinal_type = typename local_matrix_type::ordinal_type;
142 using memory_space = typename local_matrix_type::memory_space;
143 using results_view = Kokkos::View<DecisionType*, memory_space>;
144 using boundary_nodes_view = Kokkos::View<const bool*, memory_space>;
145 using block_indices_view_type = Kokkos::View<local_ordinal_type*, memory_space>;
146
147 local_matrix_type A;
151
152 public:
153 VectorDropBoundaryFunctor(local_matrix_type& A_, block_indices_view_type point_to_block_, boundary_nodes_view boundaryNodes_, results_view& results_)
154 : A(A_)
155 , point_to_block(point_to_block_)
156 , boundaryNodes(boundaryNodes_)
157 , results(results_) {}
158
159 KOKKOS_FORCEINLINE_FUNCTION
161 auto row = A.rowConst(rlid);
162 const size_t offset = A.graph.row_map(rlid);
163 const bool isBoundaryRow = boundaryNodes(point_to_block(rlid));
164 if (isBoundaryRow) {
165 for (local_ordinal_type k = 0; k < row.length; ++k) {
166 auto clid = row.colidx(k);
167 results(offset + k) = Kokkos::max(rlid == clid ? KEEP : DROP,
168 results(offset + k));
169 }
170 }
171 }
172};
173
178template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
180 private:
181 using local_matrix_type = typename Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::local_matrix_device_type;
182 using scalar_type = typename local_matrix_type::value_type;
183 using local_ordinal_type = typename local_matrix_type::ordinal_type;
184 using memory_space = typename local_matrix_type::memory_space;
185 using results_view = Kokkos::View<DecisionType*, memory_space>;
186 using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
187 using block_indices_view_type = Kokkos::View<local_ordinal_type*, memory_space>;
188
195
196 public:
197 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_)
198 : point_to_block(point_to_block_)
199 , ghosted_point_to_block(ghosted_point_to_block_)
200 , boundaryNodes(boundaryNodes_)
201 , results(results_) {
202 A = A_.getLocalMatrixDevice();
203 auto boundaryNodesColumn = typename boundary_nodes_view::non_const_type("boundaryNodesColumn", A_.getColMap()->getLocalNumElements());
204 auto boundaryNodesDomain = typename boundary_nodes_view::non_const_type("boundaryNodesDomain", A_.getDomainMap()->getLocalNumElements());
206 boundaryNodesCol = boundaryNodesColumn;
207 }
208
209 KOKKOS_FORCEINLINE_FUNCTION
211 auto row = A.rowConst(rlid);
212 const size_t offset = A.graph.row_map(rlid);
213 const bool isBoundaryRow = boundaryNodes(point_to_block(rlid));
214 for (local_ordinal_type k = 0; k < row.length; ++k) {
215 auto clid = row.colidx(k);
216 if (isBoundaryRow || boundaryNodesCol(ghosted_point_to_block(clid))) {
217 results(offset + k) = Kokkos::max(rlid == clid ? KEEP : DROP,
218 results(offset + k));
219 }
220 }
221 }
222};
223
228template <class local_matrix_type>
230 private:
231 using scalar_type = typename local_matrix_type::value_type;
232 using local_ordinal_type = typename local_matrix_type::ordinal_type;
233 using memory_space = typename local_matrix_type::memory_space;
234 using results_view = Kokkos::View<DecisionType*, memory_space>;
235
236 local_matrix_type A;
238
239 public:
240 KeepDiagonalFunctor(local_matrix_type& A_, results_view& results_)
241 : A(A_)
242 , results(results_) {}
243
244 KOKKOS_FORCEINLINE_FUNCTION
246 auto row = A.rowConst(rlid);
247 const size_t offset = A.graph.row_map(rlid);
248 for (local_ordinal_type k = 0; k < row.length; ++k) {
249 auto clid = row.colidx(k);
250 if ((rlid == clid) && (results(offset + k) != BOUNDARY)) {
251 results(offset + k) = KEEP;
252 break;
253 }
254 }
255 }
256};
257
262template <class local_matrix_type>
264 private:
265 using scalar_type = typename local_matrix_type::value_type;
266 using local_ordinal_type = typename local_matrix_type::ordinal_type;
267 using memory_space = typename local_matrix_type::memory_space;
268 using results_view = Kokkos::View<DecisionType*, memory_space>;
269
270 local_matrix_type A;
272
273 public:
274 DropOffRankFunctor(local_matrix_type& A_, results_view& results_)
275 : A(A_)
276 , results(results_) {}
277
278 KOKKOS_FORCEINLINE_FUNCTION
280 auto row = A.rowConst(rlid);
281 const size_t offset = A.graph.row_map(rlid);
282 for (local_ordinal_type k = 0; k < row.length; ++k) {
283 auto clid = row.colidx(k);
284 if (clid >= A.numRows()) {
285 results(offset + k) = Kokkos::max(DROP, results(offset + k));
286 }
287 }
288 }
289};
290
295template <class local_matrix_type>
297 private:
298 using scalar_type = typename local_matrix_type::value_type;
299 using local_ordinal_type = typename local_matrix_type::ordinal_type;
300 using memory_space = typename local_matrix_type::memory_space;
301 using results_view = Kokkos::View<DecisionType*, memory_space>;
302
303 using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
304
305 local_matrix_type A;
308
309 public:
310 MarkSingletonFunctor(local_matrix_type& A_, boundary_nodes_view boundaryNodes_, results_view& results_)
311 : A(A_)
312 , boundaryNodes(boundaryNodes_)
313 , results(results_) {}
314
315 KOKKOS_FORCEINLINE_FUNCTION
317 auto row = A.rowConst(rlid);
318 const size_t offset = A.graph.row_map(rlid);
319 for (local_ordinal_type k = 0; k < row.length; ++k) {
320 auto clid = row.colidx(k);
321 if ((results(offset + k) == KEEP) && (rlid != clid))
322 return;
323 }
324 boundaryNodes(rlid) = true;
325 for (local_ordinal_type k = 0; k < row.length; ++k) {
326 auto clid = row.colidx(k);
327 if (rlid == clid)
328 results(offset + k) = KEEP;
329 else
330 results(offset + k) = BOUNDARY;
331 }
332 }
333};
334
339template <class local_matrix_type>
341 private:
342 using scalar_type = typename local_matrix_type::value_type;
343 using local_ordinal_type = typename local_matrix_type::ordinal_type;
344 using memory_space = typename local_matrix_type::memory_space;
345 using results_view = Kokkos::View<DecisionType*, memory_space>;
346 using block_indices_view_type = Kokkos::View<local_ordinal_type*, memory_space>;
347
348 using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
349
350 local_matrix_type A;
354
355 public:
356 MarkSingletonVectorFunctor(local_matrix_type& A_, block_indices_view_type point_to_block_, boundary_nodes_view boundaryNodes_, results_view& results_)
357 : A(A_)
358 , point_to_block(point_to_block_)
359 , boundaryNodes(boundaryNodes_)
360 , results(results_) {}
361
362 KOKKOS_FORCEINLINE_FUNCTION
364 auto row = A.rowConst(rlid);
365 const size_t offset = A.graph.row_map(rlid);
366 for (local_ordinal_type k = 0; k < row.length; ++k) {
367 auto clid = row.colidx(k);
368 if ((results(offset + k) == KEEP) && (rlid != clid))
369 return;
370 }
371 auto brlid = point_to_block(rlid);
372 boundaryNodes(brlid) = true;
373 for (local_ordinal_type k = 0; k < row.length; ++k) {
374 auto clid = row.colidx(k);
375 if (rlid == clid)
376 results(offset + k) = KEEP;
377 else
378 results(offset + k) = BOUNDARY;
379 }
380 }
381};
382
387template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
389 private:
390 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
391 using local_matrix_type = typename matrix_type::local_matrix_device_type;
392
393 using scalar_type = typename local_matrix_type::value_type;
394 using local_ordinal_type = typename local_matrix_type::ordinal_type;
395 using memory_space = typename local_matrix_type::memory_space;
396 using results_view = Kokkos::View<DecisionType*, memory_space>;
397
398 using block_indices_type = Xpetra::MultiVector<LocalOrdinal, LocalOrdinal, GlobalOrdinal, Node>;
399 using local_block_indices_view_type = typename block_indices_type::dual_view_type_const::t_dev;
400
403 Teuchos::RCP<block_indices_type> ghosted_point_to_blockMV;
406
407 public:
409 : A(A_.getLocalMatrixDevice())
410 , point_to_block(point_to_block_.getLocalViewDevice(Tpetra::Access::ReadOnly))
411 , results(results_) {
412 auto importer = A_.getCrsGraph()->getImporter();
413
414 if (!importer.is_null()) {
415 ghosted_point_to_blockMV = Xpetra::VectorFactory<LocalOrdinal, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap());
416 ghosted_point_to_blockMV->doImport(point_to_block_, *importer, Xpetra::INSERT);
417 ghosted_point_to_block = ghosted_point_to_blockMV->getLocalViewDevice(Tpetra::Access::ReadOnly);
418 } else
420 }
421
422 KOKKOS_FORCEINLINE_FUNCTION
424 auto row = A.rowConst(rlid);
425 const size_t offset = A.graph.row_map(rlid);
426 for (local_ordinal_type k = 0; k < row.length; ++k) {
427 auto clid = row.colidx(k);
428 if (point_to_block(rlid, 0) == ghosted_point_to_block(clid, 0)) {
429 results(offset + k) = Kokkos::max(KEEP, results(offset + k));
430 } else {
431 results(offset + k) = Kokkos::max(DROP, results(offset + k));
432 }
433 }
434 }
435};
436
441template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
443 private:
444 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
445 using local_matrix_type = typename matrix_type::local_matrix_device_type;
446
447 using scalar_type = typename local_matrix_type::value_type;
448 using local_ordinal_type = typename local_matrix_type::ordinal_type;
449 using memory_space = typename local_matrix_type::memory_space;
450 using results_view = Kokkos::View<DecisionType*, memory_space>;
451
452 using block_indices_type = Xpetra::Vector<LocalOrdinal, LocalOrdinal, GlobalOrdinal, Node>;
453 using local_block_indices_view_type = typename block_indices_type::dual_view_type_const::t_dev;
454 using id_translation_type = Kokkos::View<local_ordinal_type*, memory_space>;
455 using importer_type = Xpetra::Import<LocalOrdinal, GlobalOrdinal, Node>;
456
463 Teuchos::RCP<block_indices_type> ghosted_point_to_blockMV;
464
465 public:
466 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_)
467 : A(A_.getLocalMatrixDevice())
468 , point_to_block(point_to_block_.getLocalViewDevice(Tpetra::Access::ReadOnly))
469 , results(results_)
470 , row_translation(row_translation_)
471 , col_translation(col_translation_) {
472 if (!importer.is_null()) {
473 ghosted_point_to_blockMV = Xpetra::VectorFactory<LocalOrdinal, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap());
474 ghosted_point_to_blockMV->doImport(point_to_block_, *importer, Xpetra::INSERT);
475 ghosted_point_to_block = ghosted_point_to_blockMV->getLocalViewDevice(Tpetra::Access::ReadOnly);
476 } else
478 }
479
480 KOKKOS_FORCEINLINE_FUNCTION
482 auto row = A.rowConst(rlid);
483 const size_t offset = A.graph.row_map(rlid);
484 auto brlid = row_translation(rlid);
485 for (local_ordinal_type k = 0; k < row.length; ++k) {
486 auto clid = row.colidx(k);
487 auto bclid = col_translation(clid);
488 if (point_to_block(brlid, 0) == ghosted_point_to_block(bclid, 0)) {
489 results(offset + k) = Kokkos::max(KEEP, results(offset + k));
490 } else {
491 results(offset + k) = Kokkos::max(DROP, results(offset + k));
492 }
493 }
494 }
495};
496
501template <class local_matrix_type>
503 private:
504 using scalar_type = typename local_matrix_type::value_type;
505 using local_ordinal_type = typename local_matrix_type::ordinal_type;
506 using memory_space = typename local_matrix_type::memory_space;
507 using results_view = Kokkos::View<DecisionType*, memory_space>;
508
509 using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
510
511 local_matrix_type A;
513
514 public:
515 DebugFunctor(local_matrix_type& A_, results_view& results_)
516 : A(A_)
517 , results(results_) {}
518
519 KOKKOS_FORCEINLINE_FUNCTION
521 auto row = A.rowConst(rlid);
522 const size_t offset = A.graph.row_map(rlid);
523 for (local_ordinal_type k = 0; k < row.length; ++k) {
524 if (results(offset + k) == UNDECIDED) {
525 Kokkos::printf("No dropping decision was taken for entry (%d, %d)\n", rlid, row.colidx(k));
526 assert(false);
527 }
528 }
529 }
530};
531
536template <class local_matrix_type>
538 private:
539 using scalar_type = typename local_matrix_type::value_type;
540 using local_ordinal_type = typename local_matrix_type::ordinal_type;
541 using memory_space = typename local_matrix_type::memory_space;
542 using results_view = Kokkos::View<DecisionType*, memory_space>;
543
544 local_matrix_type A;
546
547 public:
548 SymmetrizeFunctor(local_matrix_type& A_, results_view& results_)
549 : A(A_)
550 , results(results_) {}
551
552 KOKKOS_FORCEINLINE_FUNCTION
554 auto row = A.rowConst(rlid);
555 const size_t offset = A.graph.row_map(rlid);
556 for (local_ordinal_type k = 0; k < row.length; ++k) {
557 if (results(offset + k) == KEEP) {
558 auto clid = row.colidx(k);
559 if (clid >= A.numRows())
560 continue;
561 auto row2 = A.rowConst(clid);
562 const size_t offset2 = A.graph.row_map(clid);
563 for (local_ordinal_type k2 = 0; k2 < row2.length; ++k2) {
564 auto clid2 = row2.colidx(k2);
565 if (clid2 == rlid) {
566 if (results(offset2 + k2) == DROP)
567 results(offset2 + k2) = KEEP;
568 break;
569 }
570 }
571 }
572 }
573 }
574};
575
576template <class view_type, class comparator_type>
577KOKKOS_INLINE_FUNCTION void serialHeapSort(view_type& v, comparator_type comparator) {
578 auto N = v.extent(0);
579 size_t start = N / 2;
580 size_t end = N;
581 while (end > 1) {
582 if (start > 0)
583 start = start - 1;
584 else {
585 end = end - 1;
586 auto temp = v(0);
587 v(0) = v(end);
588 v(end) = temp;
589 }
590 size_t root = start;
591 while (2 * root + 1 < end) {
592 size_t child = 2 * root + 1;
593 if ((child + 1 < end) and (comparator(v(child), v(child + 1))))
594 ++child;
595
596 if (comparator(v(root), v(child))) {
597 auto temp = v(root);
598 v(root) = v(child);
599 v(child) = temp;
600 root = child;
601 } else
602 break;
603 }
604 }
605}
606
609enum StrengthMeasure : int {
610 /*
611 \f[
612 \frac{|A_{ij}|^2}{|A_{ii}| |A_{jj}|} \le \theta^2
613 \f]
614 */
616 /*
617 \f[
618 \frac{-\operatorname{Re}A_{ij}}{| max_j -A_{ij}|} \le \theta
619 \f]
620 */
622
623 /*
624 \f[
625 \frac{-\operatorname{sign}(A_{ij}) |A_{ij}|^2}{|A_{ii}| |A_{jj}|} \le \theta^2
626 \f]
627 */
629
630 /*
631 \f[
632 |A_{ij}| \le \theta
633 \f]
634 */
637
638} // namespace Misc
639
640} // namespace MueLu
641
642#define MUELU_ETI_SLGN_SoC(CLASSNAME, SC, LO, GO, NO) \
643 template class CLASSNAME<SC, LO, GO, NO, MueLu::Misc::SmoothedAggregationMeasure>; \
644 template class CLASSNAME<SC, LO, GO, NO, MueLu::Misc::SignedRugeStuebenMeasure>; \
645 template class CLASSNAME<SC, LO, GO, NO, MueLu::Misc::SignedSmoothedAggregationMeasure>; \
646 template class CLASSNAME<SC, LO, GO, NO, MueLu::Misc::UnscaledMeasure>;
647
648#endif
Functor that drops all entries that are not on the block diagonal.
Teuchos::RCP< block_indices_type > ghosted_point_to_blockMV
typename matrix_type::local_matrix_device_type local_matrix_type
Xpetra::MultiVector< LocalOrdinal, LocalOrdinal, GlobalOrdinal, Node > block_indices_type
typename local_matrix_type::value_type scalar_type
local_block_indices_view_type point_to_block
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > matrix_type
local_block_indices_view_type ghosted_point_to_block
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::memory_space memory_space
typename local_matrix_type::ordinal_type local_ordinal_type
Kokkos::View< DecisionType *, memory_space > results_view
BlockDiagonalizeFunctor(matrix_type &A_, block_indices_type &point_to_block_, results_view &results_)
Functor that drops all entries that are not on the block diagonal.
Xpetra::Vector< LocalOrdinal, LocalOrdinal, GlobalOrdinal, Node > block_indices_type
typename local_matrix_type::memory_space memory_space
Xpetra::Import< LocalOrdinal, GlobalOrdinal, Node > importer_type
typename block_indices_type::dual_view_type_const::t_dev local_block_indices_view_type
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > matrix_type
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
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
Kokkos::View< DecisionType *, memory_space > results_view
typename local_matrix_type::ordinal_type local_ordinal_type
Teuchos::RCP< block_indices_type > ghosted_point_to_blockMV
Kokkos::View< local_ordinal_type *, memory_space > id_translation_type
typename matrix_type::local_matrix_device_type local_matrix_type
local_block_indices_view_type ghosted_point_to_block
Functor that checks that all entries have been marked.
Kokkos::View< DecisionType *, memory_space > results_view
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
DebugFunctor(local_matrix_type &A_, results_view &results_)
typename local_matrix_type::ordinal_type local_ordinal_type
Kokkos::View< bool *, memory_space > boundary_nodes_view
typename local_matrix_type::value_type scalar_type
typename local_matrix_type::memory_space memory_space
Functor that drops off-rank entries.
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
Kokkos::View< DecisionType *, memory_space > results_view
typename local_matrix_type::ordinal_type local_ordinal_type
typename local_matrix_type::memory_space memory_space
typename local_matrix_type::value_type scalar_type
DropOffRankFunctor(local_matrix_type &A_, results_view &results_)
Functor that marks diagonal as kept, unless the are already marked as boundary.
Kokkos::View< DecisionType *, memory_space > results_view
typename local_matrix_type::memory_space memory_space
KeepDiagonalFunctor(local_matrix_type &A_, results_view &results_)
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
Functor that marks singletons (all off-diagonal entries in a row are dropped) as boundary.
Kokkos::View< DecisionType *, memory_space > results_view
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
typename local_matrix_type::value_type scalar_type
MarkSingletonFunctor(local_matrix_type &A_, boundary_nodes_view boundaryNodes_, results_view &results_)
typename local_matrix_type::memory_space memory_space
typename local_matrix_type::ordinal_type local_ordinal_type
Kokkos::View< bool *, memory_space > boundary_nodes_view
Functor that marks singletons (all off-diagonal entries in a row are dropped) as boundary.
MarkSingletonVectorFunctor(local_matrix_type &A_, block_indices_view_type point_to_block_, boundary_nodes_view boundaryNodes_, results_view &results_)
Kokkos::View< DecisionType *, memory_space > results_view
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
typename local_matrix_type::value_type scalar_type
Kokkos::View< local_ordinal_type *, memory_space > block_indices_view_type
typename local_matrix_type::ordinal_type local_ordinal_type
Kokkos::View< bool *, memory_space > boundary_nodes_view
typename local_matrix_type::memory_space memory_space
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
Functor that drops boundary nodes for a blockSize == 1 problem.
typename local_matrix_type::ordinal_type local_ordinal_type
typename local_matrix_type::memory_space memory_space
Kokkos::View< const bool *, memory_space > boundary_nodes_view
typename local_matrix_type::value_type scalar_type
Kokkos::View< DecisionType *, memory_space > results_view
PointwiseDropBoundaryFunctor(local_matrix_type &A_, boundary_nodes_view boundaryNodes_, results_view &results_)
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
Functor that drops boundary nodes for a blockSize == 1 problem.
Kokkos::View< DecisionType *, memory_space > results_view
typename Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >::local_matrix_device_type local_matrix_type
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
typename local_matrix_type::value_type scalar_type
typename local_matrix_type::ordinal_type local_ordinal_type
Kokkos::View< bool *, memory_space > boundary_nodes_view
typename local_matrix_type::memory_space memory_space
PointwiseSymmetricDropBoundaryFunctor(Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A_, boundary_nodes_view boundaryNodes_, results_view &results_)
Functor that symmetrizes the dropping decisions.
typename local_matrix_type::value_type scalar_type
SymmetrizeFunctor(local_matrix_type &A_, results_view &results_)
Kokkos::View< DecisionType *, memory_space > results_view
typename local_matrix_type::memory_space memory_space
typename local_matrix_type::ordinal_type local_ordinal_type
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
Functor that drops boundary nodes for a blockSize > 1 problem.
VectorDropBoundaryFunctor(local_matrix_type &A_, block_indices_view_type point_to_block_, boundary_nodes_view boundaryNodes_, results_view &results_)
Kokkos::View< local_ordinal_type *, memory_space > block_indices_view_type
Kokkos::View< const bool *, memory_space > boundary_nodes_view
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
Kokkos::View< DecisionType *, memory_space > results_view
typename local_matrix_type::value_type scalar_type
Functor that drops boundary nodes for a blockSize > 1 problem.
typename local_matrix_type::value_type scalar_type
typename local_matrix_type::memory_space memory_space
typename Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >::local_matrix_device_type local_matrix_type
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
Kokkos::View< bool *, memory_space > boundary_nodes_view
Kokkos::View< DecisionType *, memory_space > results_view
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_)
Kokkos::View< local_ordinal_type *, memory_space > block_indices_view_type
typename local_matrix_type::ordinal_type local_ordinal_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 & domains from a list of Dirichlet rows.
KOKKOS_INLINE_FUNCTION void serialHeapSort(view_type &v, comparator_type comparator)
Namespace for MueLu classes and methods.