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#include "KokkosKernels_ArithTraits.hpp"
17#include "Tpetra_Access.hpp"
18#include "Xpetra_Matrix.hpp"
19#include "Xpetra_VectorFactory.hpp"
20#include "MueLu_Utilities.hpp"
21
22namespace MueLu {
23
28enum 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 SYMDROP = 3, // drop if doesn't create Dirichlet
33 BOUNDARY_ENTRY = 4 // entry is a boundary
34};
35
36namespace Misc {
37
38template <class local_ordinal_type>
40 public:
42
43 KOKKOS_FORCEINLINE_FUNCTION
44 void operator()(local_ordinal_type rlid) const {
45 }
46};
47
52template <class local_matrix_type>
54 private:
55 using scalar_type = typename local_matrix_type::value_type;
56 using local_ordinal_type = typename local_matrix_type::ordinal_type;
57 using memory_space = typename local_matrix_type::memory_space;
58 using results_view = Kokkos::View<DecisionType*, memory_space>;
59 using boundary_nodes_view = Kokkos::View<const bool*, memory_space>;
60
61 local_matrix_type A;
64
65 public:
66 PointwiseDropBoundaryFunctor(local_matrix_type& A_, boundary_nodes_view boundaryNodes_, results_view& results_)
67 : A(A_)
68 , boundaryNodes(boundaryNodes_)
69 , results(results_) {}
70
71 KOKKOS_FORCEINLINE_FUNCTION
72 void operator()(local_ordinal_type rlid) const {
73 auto row = A.rowConst(rlid);
74 const size_t offset = A.graph.row_map(rlid);
75 const bool isBoundaryRow = boundaryNodes(rlid);
76 if (isBoundaryRow) {
77 for (local_ordinal_type k = 0; k < row.length; ++k) {
78 auto clid = row.colidx(k);
79 results(offset + k) = Kokkos::max(rlid == clid ? KEEP : DROP,
80 results(offset + k));
81 }
82 }
83 }
84};
85
90template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
92 private:
93 using local_matrix_type = typename Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::local_matrix_device_type;
94 using scalar_type = typename local_matrix_type::value_type;
95 using local_ordinal_type = typename local_matrix_type::ordinal_type;
96 using memory_space = typename local_matrix_type::memory_space;
97 using results_view = Kokkos::View<DecisionType*, memory_space>;
98 using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
99
104
105 public:
106 PointwiseSymmetricDropBoundaryFunctor(Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A_, boundary_nodes_view boundaryNodes_, results_view& results_)
107 : boundaryNodes(boundaryNodes_)
108 , results(results_) {
109 A = A_.getLocalMatrixDevice();
110 auto boundaryNodesColumn = typename boundary_nodes_view::non_const_type("boundaryNodesColumn", A_.getColMap()->getLocalNumElements());
111 auto boundaryNodesDomain = typename boundary_nodes_view::non_const_type("boundaryNodesDomain", A_.getDomainMap()->getLocalNumElements());
113 boundaryNodesCol = boundaryNodesColumn;
114 }
115
116 KOKKOS_FORCEINLINE_FUNCTION
118 auto row = A.rowConst(rlid);
119 const size_t offset = A.graph.row_map(rlid);
120 const bool isBoundaryRow = boundaryNodes(rlid);
121 for (local_ordinal_type k = 0; k < row.length; ++k) {
122 auto clid = row.colidx(k);
123 if (isBoundaryRow || boundaryNodesCol(clid))
124 results(offset + k) = Kokkos::max(rlid == clid ? KEEP : DROP,
125 results(offset + k));
126 }
127 }
128};
129
134template <class local_matrix_type>
136 private:
137 using scalar_type = typename local_matrix_type::value_type;
138 using local_ordinal_type = typename local_matrix_type::ordinal_type;
139 using memory_space = typename local_matrix_type::memory_space;
140 using results_view = Kokkos::View<DecisionType*, memory_space>;
141 using boundary_nodes_view = Kokkos::View<const bool*, memory_space>;
142 using block_indices_view_type = Kokkos::View<local_ordinal_type*, memory_space>;
143
144 local_matrix_type A;
148
149 public:
150 VectorDropBoundaryFunctor(local_matrix_type& A_, block_indices_view_type point_to_block_, boundary_nodes_view boundaryNodes_, results_view& results_)
151 : A(A_)
152 , point_to_block(point_to_block_)
153 , boundaryNodes(boundaryNodes_)
154 , results(results_) {}
155
156 KOKKOS_FORCEINLINE_FUNCTION
158 auto row = A.rowConst(rlid);
159 const size_t offset = A.graph.row_map(rlid);
160 const bool isBoundaryRow = boundaryNodes(point_to_block(rlid));
161 if (isBoundaryRow) {
162 for (local_ordinal_type k = 0; k < row.length; ++k) {
163 auto clid = row.colidx(k);
164 results(offset + k) = Kokkos::max(rlid == clid ? KEEP : DROP,
165 results(offset + k));
166 }
167 }
168 }
169};
170
175template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
177 private:
178 using local_matrix_type = typename Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::local_matrix_device_type;
179 using scalar_type = typename local_matrix_type::value_type;
180 using local_ordinal_type = typename local_matrix_type::ordinal_type;
181 using memory_space = typename local_matrix_type::memory_space;
182 using results_view = Kokkos::View<DecisionType*, memory_space>;
183 using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
184 using block_indices_view_type = Kokkos::View<local_ordinal_type*, memory_space>;
185
192
193 public:
194 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_)
195 : point_to_block(point_to_block_)
196 , ghosted_point_to_block(ghosted_point_to_block_)
197 , boundaryNodes(boundaryNodes_)
198 , results(results_) {
199 A = A_.getLocalMatrixDevice();
200 auto boundaryNodesColumn = typename boundary_nodes_view::non_const_type("boundaryNodesColumn", A_.getColMap()->getLocalNumElements());
201 auto boundaryNodesDomain = typename boundary_nodes_view::non_const_type("boundaryNodesDomain", A_.getDomainMap()->getLocalNumElements());
203 boundaryNodesCol = boundaryNodesColumn;
204 }
205
206 KOKKOS_FORCEINLINE_FUNCTION
208 auto row = A.rowConst(rlid);
209 const size_t offset = A.graph.row_map(rlid);
210 const bool isBoundaryRow = boundaryNodes(point_to_block(rlid));
211 for (local_ordinal_type k = 0; k < row.length; ++k) {
212 auto clid = row.colidx(k);
213 if (isBoundaryRow || boundaryNodesCol(ghosted_point_to_block(clid))) {
214 results(offset + k) = Kokkos::max(rlid == clid ? KEEP : DROP,
215 results(offset + k));
216 }
217 }
218 }
219};
220
225template <class local_matrix_type>
227 private:
228 using scalar_type = typename local_matrix_type::value_type;
229 using local_ordinal_type = typename local_matrix_type::ordinal_type;
230 using memory_space = typename local_matrix_type::memory_space;
231 using results_view = Kokkos::View<DecisionType*, memory_space>;
232
233 local_matrix_type A;
235
236 public:
237 KeepDiagonalFunctor(local_matrix_type& A_, results_view& results_)
238 : A(A_)
239 , results(results_) {}
240
241 KOKKOS_FORCEINLINE_FUNCTION
243 auto row = A.rowConst(rlid);
244 const size_t offset = A.graph.row_map(rlid);
245 for (local_ordinal_type k = 0; k < row.length; ++k) {
246 auto clid = row.colidx(k);
247 if ((rlid == clid) && (results(offset + k) != BOUNDARY_ENTRY)) {
248 results(offset + k) = KEEP;
249 break;
250 }
251 }
252 }
253};
254
259template <class local_matrix_type>
261 private:
262 using scalar_type = typename local_matrix_type::value_type;
263 using local_ordinal_type = typename local_matrix_type::ordinal_type;
264 using memory_space = typename local_matrix_type::memory_space;
265 using results_view = Kokkos::View<DecisionType*, memory_space>;
266
267 local_matrix_type A;
269
270 public:
271 DropOffRankFunctor(local_matrix_type& A_, results_view& results_)
272 : A(A_)
273 , results(results_) {}
274
275 KOKKOS_FORCEINLINE_FUNCTION
277 auto row = A.rowConst(rlid);
278 const size_t offset = A.graph.row_map(rlid);
279 for (local_ordinal_type k = 0; k < row.length; ++k) {
280 auto clid = row.colidx(k);
281 if (clid >= A.numRows()) {
282 results(offset + k) = Kokkos::max(DROP, results(offset + k));
283 }
284 }
285 }
286};
287
292template <class local_matrix_type>
294 private:
295 using scalar_type = typename local_matrix_type::value_type;
296 using local_ordinal_type = typename local_matrix_type::ordinal_type;
297 using memory_space = typename local_matrix_type::memory_space;
298 using results_view = Kokkos::View<DecisionType*, memory_space>;
299
300 using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
301
302 local_matrix_type A;
305
306 public:
307 MarkSingletonFunctor(local_matrix_type& A_, boundary_nodes_view boundaryNodes_, results_view& results_)
308 : A(A_)
309 , boundaryNodes(boundaryNodes_)
310 , results(results_) {}
311
312 KOKKOS_FORCEINLINE_FUNCTION
314 auto row = A.rowConst(rlid);
315 const size_t offset = A.graph.row_map(rlid);
316 for (local_ordinal_type k = 0; k < row.length; ++k) {
317 auto clid = row.colidx(k);
318 if ((results(offset + k) == KEEP) && (rlid != clid))
319 return;
320 }
321 boundaryNodes(rlid) = true;
322 for (local_ordinal_type k = 0; k < row.length; ++k) {
323 auto clid = row.colidx(k);
324 if (rlid == clid)
325 results(offset + k) = KEEP;
326 else
327 results(offset + k) = BOUNDARY_ENTRY;
328 }
329 }
330};
331
336template <class local_matrix_type>
338 private:
339 using scalar_type = typename local_matrix_type::value_type;
340 using local_ordinal_type = typename local_matrix_type::ordinal_type;
341 using memory_space = typename local_matrix_type::memory_space;
342 using results_view = Kokkos::View<DecisionType*, memory_space>;
343 using block_indices_view_type = Kokkos::View<local_ordinal_type*, memory_space>;
344
345 using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
346
347 local_matrix_type A;
351
352 public:
353 MarkSingletonVectorFunctor(local_matrix_type& A_, block_indices_view_type point_to_block_, boundary_nodes_view boundaryNodes_, results_view& results_)
354 : A(A_)
355 , point_to_block(point_to_block_)
356 , boundaryNodes(boundaryNodes_)
357 , results(results_) {}
358
359 KOKKOS_FORCEINLINE_FUNCTION
361 auto row = A.rowConst(rlid);
362 const size_t offset = A.graph.row_map(rlid);
363 for (local_ordinal_type k = 0; k < row.length; ++k) {
364 auto clid = row.colidx(k);
365 if ((results(offset + k) == KEEP) && (rlid != clid))
366 return;
367 }
368 auto brlid = point_to_block(rlid);
369 boundaryNodes(brlid) = true;
370 for (local_ordinal_type k = 0; k < row.length; ++k) {
371 auto clid = row.colidx(k);
372 if (rlid == clid)
373 results(offset + k) = KEEP;
374 else
375 results(offset + k) = BOUNDARY_ENTRY;
376 }
377 }
378};
379
384template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
386 private:
387 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
388 using local_matrix_type = typename matrix_type::local_matrix_device_type;
389
390 using scalar_type = typename local_matrix_type::value_type;
391 using local_ordinal_type = typename local_matrix_type::ordinal_type;
392 using memory_space = typename local_matrix_type::memory_space;
393 using results_view = Kokkos::View<DecisionType*, memory_space>;
394
395 using block_indices_type = Xpetra::MultiVector<LocalOrdinal, LocalOrdinal, GlobalOrdinal, Node>;
396 using local_block_indices_view_type = typename block_indices_type::dual_view_type_const::t_dev;
397
400 Teuchos::RCP<block_indices_type> ghosted_point_to_blockMV;
403
404 public:
406 : A(A_.getLocalMatrixDevice())
407 , point_to_block(point_to_block_.getLocalViewDevice(Tpetra::Access::ReadOnly))
408 , results(results_) {
409 auto importer = A_.getCrsGraph()->getImporter();
410
411 if (!importer.is_null()) {
412 ghosted_point_to_blockMV = Xpetra::VectorFactory<LocalOrdinal, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap(), false);
413 ghosted_point_to_blockMV->doImport(point_to_block_, *importer, Xpetra::INSERT);
414 ghosted_point_to_block = ghosted_point_to_blockMV->getLocalViewDevice(Tpetra::Access::ReadOnly);
415 } else
417 }
418
419 KOKKOS_FORCEINLINE_FUNCTION
421 auto row = A.rowConst(rlid);
422 const size_t offset = A.graph.row_map(rlid);
423 for (local_ordinal_type k = 0; k < row.length; ++k) {
424 auto clid = row.colidx(k);
425 if (point_to_block(rlid, 0) == ghosted_point_to_block(clid, 0)) {
426 results(offset + k) = Kokkos::max(KEEP, results(offset + k));
427 } else {
428 results(offset + k) = Kokkos::max(DROP, results(offset + k));
429 }
430 }
431 }
432};
433
438template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
440 private:
441 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
442 using local_matrix_type = typename matrix_type::local_matrix_device_type;
443
444 using scalar_type = typename local_matrix_type::value_type;
445 using local_ordinal_type = typename local_matrix_type::ordinal_type;
446 using memory_space = typename local_matrix_type::memory_space;
447 using results_view = Kokkos::View<DecisionType*, memory_space>;
448
449 using block_indices_type = Xpetra::Vector<LocalOrdinal, LocalOrdinal, GlobalOrdinal, Node>;
450 using local_block_indices_view_type = typename block_indices_type::dual_view_type_const::t_dev;
451 using id_translation_type = Kokkos::View<local_ordinal_type*, memory_space>;
452 using importer_type = Xpetra::Import<LocalOrdinal, GlobalOrdinal, Node>;
453
460 Teuchos::RCP<block_indices_type> ghosted_point_to_blockMV;
461
462 public:
463 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_)
464 : A(A_.getLocalMatrixDevice())
465 , point_to_block(point_to_block_.getLocalViewDevice(Tpetra::Access::ReadOnly))
466 , results(results_)
467 , row_translation(row_translation_)
468 , col_translation(col_translation_) {
469 if (!importer.is_null()) {
470 ghosted_point_to_blockMV = Xpetra::VectorFactory<LocalOrdinal, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap(), false);
471 ghosted_point_to_blockMV->doImport(point_to_block_, *importer, Xpetra::INSERT);
472 ghosted_point_to_block = ghosted_point_to_blockMV->getLocalViewDevice(Tpetra::Access::ReadOnly);
473 } else
475 }
476
477 KOKKOS_FORCEINLINE_FUNCTION
479 auto row = A.rowConst(rlid);
480 const size_t offset = A.graph.row_map(rlid);
481 auto brlid = row_translation(rlid);
482 for (local_ordinal_type k = 0; k < row.length; ++k) {
483 auto clid = row.colidx(k);
484 auto bclid = col_translation(clid);
485 if (point_to_block(brlid, 0) == ghosted_point_to_block(bclid, 0)) {
486 results(offset + k) = Kokkos::max(KEEP, results(offset + k));
487 } else {
488 results(offset + k) = Kokkos::max(DROP, results(offset + k));
489 }
490 }
491 }
492};
493
498template <class local_matrix_type>
500 private:
501 using scalar_type = typename local_matrix_type::value_type;
502 using local_ordinal_type = typename local_matrix_type::ordinal_type;
503 using memory_space = typename local_matrix_type::memory_space;
504 using results_view = Kokkos::View<DecisionType*, memory_space>;
505
506 using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
507
508 local_matrix_type A;
510
511 public:
512 DebugFunctor(local_matrix_type& A_, results_view& results_)
513 : A(A_)
514 , results(results_) {}
515
516 KOKKOS_FORCEINLINE_FUNCTION
518 auto row = A.rowConst(rlid);
519 const size_t offset = A.graph.row_map(rlid);
520 for (local_ordinal_type k = 0; k < row.length; ++k) {
521 if (results(offset + k) == UNDECIDED) {
522 Kokkos::printf("No dropping decision was taken for entry (%d, %d)\n", rlid, row.colidx(k));
523 assert(false);
524 }
525 }
526 }
527};
528
533template <class local_matrix_type, bool weakWins = false, bool offdiagNnzsCanBeReducedToZero = false>
535 private:
536 using scalar_type = typename local_matrix_type::value_type;
537 using local_ordinal_type = typename local_matrix_type::ordinal_type;
538 using memory_space = typename local_matrix_type::memory_space;
539 using results_view = Kokkos::View<DecisionType*, memory_space>;
540 using ATS = KokkosKernels::ArithTraits<scalar_type>;
541 using impl_SC = typename ATS::val_type;
542 using impl_ATS = KokkosKernels::ArithTraits<impl_SC>;
543 using magATS = KokkosKernels::ArithTraits<typename impl_ATS::magnitudeType>;
544
545 local_matrix_type A;
547
548 public:
549 SymmetrizeFunctor(local_matrix_type& A_, results_view& results_)
550 : A(A_)
551 , results(results_) {}
552
553 KOKKOS_FORCEINLINE_FUNCTION
555 auto row = A.rowConst(rlid);
556 const size_t offset = A.graph.row_map(rlid);
557
558 bool hadOffdiagKeep = false;
559 for (local_ordinal_type k = 0; k < row.length; ++k) {
560 if (results(offset + k) == KEEP) {
561 auto clid = row.colidx(k);
562 // record whether or not original row had a nonzero off-diagonal
563 if constexpr (weakWins && !offdiagNnzsCanBeReducedToZero) {
564 if (!hadOffdiagKeep && clid != rlid && results(offset + k) == KEEP) {
565 hadOffdiagKeep = true;
566 }
567 }
568 if (clid >= A.numRows())
569 continue;
570 auto row2 = A.rowConst(clid);
571 const size_t offset2 = A.graph.row_map(clid);
572 for (local_ordinal_type k2 = 0; k2 < row2.length; ++k2) {
573 auto clid2 = row2.colidx(k2);
574 if (clid2 == rlid) {
575 if (results(offset2 + k2) == DROP) {
576 if constexpr (weakWins) {
577 if constexpr (!offdiagNnzsCanBeReducedToZero) {
578 results(offset + k) = SYMDROP;
579 } else {
580 results(offset + k) = DROP;
581 }
582 } else {
583 results(offset2 + k2) = KEEP;
584 }
585 }
586 break;
587 }
588 }
589 }
590 }
591 // for weak wins, check that symmetrization did not create a Dirichlet row
592 if constexpr (weakWins && !offdiagNnzsCanBeReducedToZero) {
593 if (hadOffdiagKeep) {
594 bool hasOffdiagKeepNow = false;
595 local_ordinal_type rescueK = -1; // index within row
596 typename impl_ATS::magnitudeType rescueVal = magATS::zero();
597
598 for (local_ordinal_type k = 0; k < row.length; ++k) {
599 const auto clid = row.colidx(k);
600 if (clid == rlid) continue;
601
602 const auto d = results(offset + k);
603 if (d == KEEP) {
604 hasOffdiagKeepNow = true;
605 break;
606 }
607
608 if (d == SYMDROP) {
609 auto temp = impl_ATS::magnitude(row.value(k));
610 if (temp >= rescueVal) {
611 rescueK = k;
612 rescueVal = temp;
613 }
614 }
615 }
616
617 // If none left, flip one SYMDROP back to KEEP
618 if (!hasOffdiagKeepNow && rescueK >= 0) {
619 results(offset + rescueK) = KEEP;
620 }
621 }
622 for (local_ordinal_type k = 0; k < row.length; ++k) {
623 if (results(offset + k) == SYMDROP) results(offset + k) = DROP;
624 }
625 }
626 }
627};
628
629template <class view_type, class comparator_type>
630KOKKOS_INLINE_FUNCTION void serialHeapSort(view_type& v, comparator_type comparator) {
631 auto N = v.extent(0);
632 size_t start = N / 2;
633 size_t end = N;
634 while (end > 1) {
635 if (start > 0)
636 start = start - 1;
637 else {
638 end = end - 1;
639 auto temp = v(0);
640 v(0) = v(end);
641 v(end) = temp;
642 }
643 size_t root = start;
644 while (2 * root + 1 < end) {
645 size_t child = 2 * root + 1;
646 if ((child + 1 < end) and (comparator(v(child), v(child + 1))))
647 ++child;
648
649 if (comparator(v(root), v(child))) {
650 auto temp = v(root);
651 v(root) = v(child);
652 v(child) = temp;
653 root = child;
654 } else
655 break;
656 }
657 }
658}
659
662enum StrengthMeasure : int {
663 /*
664 \f[
665 \frac{|A_{ij}|^2}{|A_{ii}| |A_{jj}|} \le \theta^2
666 \f]
667 */
669 /*
670 \f[
671 \frac{-\operatorname{Re}A_{ij}}{| max_j -A_{ij}|} \le \theta
672 \f]
673 */
675
676 /*
677 \f[
678 \frac{-\operatorname{sign}(A_{ij}) |A_{ij}|^2}{|A_{ii}| |A_{jj}|} \le \theta^2
679 \f]
680 */
682
683 /*
684 \f[
685 |A_{ij}| \le \theta
686 \f]
687 */
689};
690
691} // namespace Misc
692
693} // namespace MueLu
694
695#define MUELU_ETI_SLGN_SoC(CLASSNAME, SC, LO, GO, NO) \
696 template class CLASSNAME<SC, LO, GO, NO, MueLu::Misc::SmoothedAggregationMeasure>; \
697 template class CLASSNAME<SC, LO, GO, NO, MueLu::Misc::SignedRugeStuebenMeasure>; \
698 template class CLASSNAME<SC, LO, GO, NO, MueLu::Misc::SignedSmoothedAggregationMeasure>; \
699 template class CLASSNAME<SC, LO, GO, NO, MueLu::Misc::UnscaledMeasure>;
700
701#endif
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_)
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
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
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_)
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
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
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
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
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_)
KokkosKernels::ArithTraits< typename impl_ATS::magnitudeType > magATS
KokkosKernels::ArithTraits< scalar_type > ATS
SymmetrizeFunctor(local_matrix_type &A_, results_view &results_)
typename local_matrix_type::memory_space memory_space
KokkosKernels::ArithTraits< impl_SC > impl_ATS
typename local_matrix_type::value_type scalar_type
typename local_matrix_type::ordinal_type local_ordinal_type
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
Kokkos::View< DecisionType *, memory_space > results_view
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
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, DefaultLocalOrdinal, DefaultGlobalOrdinal, DefaultNode > &A, const Teuchos::ArrayRCP< bool > &dirichletRows, Teuchos::ArrayRCP< bool > dirichletCols, Teuchos::ArrayRCP< bool > dirichletDomain)
KOKKOS_INLINE_FUNCTION void serialHeapSort(view_type &v, comparator_type comparator)
Namespace for MueLu classes and methods.