10#ifndef MUELU_DISTANCELAPLACIANDROPPING_HPP
11#define MUELU_DISTANCELAPLACIANDROPPING_HPP
13#include "Kokkos_Macros.hpp"
14#include "KokkosBatched_LU_Decl.hpp"
15#include "KokkosBatched_LU_Serial_Impl.hpp"
16#include "KokkosBatched_Trsv_Decl.hpp"
17#include "KokkosBatched_Trsv_Serial_Impl.hpp"
19#include "Kokkos_Core.hpp"
20#if KOKKOS_VERSION >= 40799
21#include "KokkosKernels_ArithTraits.hpp"
23#include "Kokkos_ArithTraits.hpp"
25#include "Teuchos_RCP.hpp"
26#include "Xpetra_Matrix.hpp"
27#include "Xpetra_MultiVector.hpp"
28#include "Xpetra_MultiVectorFactory.hpp"
36template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
39 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
43#if KOKKOS_VERSION >= 40799
44 using ATS = KokkosKernels::ArithTraits<scalar_type>;
46 using ATS = Kokkos::ArithTraits<scalar_type>;
49#if KOKKOS_VERSION >= 40799
50 using implATS = KokkosKernels::ArithTraits<impl_scalar_type>;
52 using implATS = Kokkos::ArithTraits<impl_scalar_type>;
55#if KOKKOS_VERSION >= 40799
56 using magATS = KokkosKernels::ArithTraits<magnitudeType>;
58 using magATS = Kokkos::ArithTraits<magnitudeType>;
60 using coords_type = Xpetra::MultiVector<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>;
72 auto importer = A.getCrsGraph()->getImporter();
73 if (!importer.is_null()) {
74 ghostedCoordsMV = Xpetra::MultiVectorFactory<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap(),
coordsMV->getNumVectors());
84 KOKKOS_FORCEINLINE_FUNCTION
88 for (
size_t j = 0; j <
coords.extent(1); ++j) {
100template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node,
class weight_type>
103 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
107#if KOKKOS_VERSION >= 40799
108 using ATS = KokkosKernels::ArithTraits<scalar_type>;
110 using ATS = Kokkos::ArithTraits<scalar_type>;
113#if KOKKOS_VERSION >= 40799
114 using implATS = KokkosKernels::ArithTraits<impl_scalar_type>;
116 using implATS = Kokkos::ArithTraits<impl_scalar_type>;
119#if KOKKOS_VERSION >= 40799
120 using magATS = KokkosKernels::ArithTraits<magnitudeType>;
122 using magATS = Kokkos::ArithTraits<magnitudeType>;
124 using coords_type = Xpetra::MultiVector<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>;
138 auto importer = A.getCrsGraph()->getImporter();
139 if (!importer.is_null()) {
140 ghostedCoordsMV = Xpetra::MultiVectorFactory<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap(),
coordsMV->getNumVectors());
152 KOKKOS_FORCEINLINE_FUNCTION
157 for (
size_t j = 0; j <
coords.extent(1); ++j) {
170template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node,
class weight_type>
173 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
177#if KOKKOS_VERSION >= 40799
178 using ATS = KokkosKernels::ArithTraits<scalar_type>;
180 using ATS = Kokkos::ArithTraits<scalar_type>;
183#if KOKKOS_VERSION >= 40799
184 using implATS = KokkosKernels::ArithTraits<impl_scalar_type>;
186 using implATS = Kokkos::ArithTraits<impl_scalar_type>;
189#if KOKKOS_VERSION >= 40799
190 using magATS = KokkosKernels::ArithTraits<magnitudeType>;
192 using magATS = Kokkos::ArithTraits<magnitudeType>;
194 using coords_type = Xpetra::MultiVector<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>;
209 auto importer = A.getCrsGraph()->getImporter();
210 if (!importer.is_null()) {
211 ghostedCoordsMV = Xpetra::MultiVectorFactory<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap(),
coordsMV->getNumVectors());
224 KOKKOS_FORCEINLINE_FUNCTION
231 for (
size_t j = 0; j <
coords.extent(1); ++j) {
233 w =
weight(block_start + j);
240template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
243 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
247#if KOKKOS_VERSION >= 40799
248 using ATS = KokkosKernels::ArithTraits<scalar_type>;
250 using ATS = Kokkos::ArithTraits<scalar_type>;
253#if KOKKOS_VERSION >= 40799
254 using implATS = KokkosKernels::ArithTraits<impl_scalar_type>;
256 using implATS = Kokkos::ArithTraits<impl_scalar_type>;
259#if KOKKOS_VERSION >= 40799
260 using magATS = KokkosKernels::ArithTraits<magnitudeType>;
262 using magATS = Kokkos::ArithTraits<magnitudeType>;
264 using coords_type = Xpetra::MultiVector<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>;
266 using material_type = Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
285 auto importer = A.getCrsGraph()->getImporter();
286 if (!importer.is_null()) {
287 ghostedCoordsMV = Xpetra::MultiVectorFactory<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap(),
coordsMV->getNumVectors());
292 ghostedMaterialMV = Xpetra::MultiVectorFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap(),
materialMV->getNumVectors());
305 KOKKOS_INLINE_FUNCTION
315 for (
size_t j = 0; j <
coords.extent(1); ++j) {
323 return Kokkos::max(d_row, d_col);
327template <
class local_ordinal_type,
class material_vector_type,
class material_matrix_type>
334 TensorInversion(material_vector_type& material_vector_, material_matrix_type& material_matrix_)
338 KOKKOS_FORCEINLINE_FUNCTION
345 auto matrix_material = Kokkos::subview(
material_matrix, i, Kokkos::ALL(), Kokkos::ALL());
346 KokkosBatched::SerialLU<KokkosBatched::Algo::LU::Unblocked>::invoke(matrix_material);
350template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
353 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
357#if KOKKOS_VERSION >= 40799
358 using ATS = KokkosKernels::ArithTraits<scalar_type>;
360 using ATS = Kokkos::ArithTraits<scalar_type>;
363#if KOKKOS_VERSION >= 40799
364 using implATS = KokkosKernels::ArithTraits<impl_scalar_type>;
366 using implATS = Kokkos::ArithTraits<impl_scalar_type>;
369#if KOKKOS_VERSION >= 40799
370 using magATS = KokkosKernels::ArithTraits<magnitudeType>;
372 using magATS = Kokkos::ArithTraits<magnitudeType>;
374 using coords_type = Xpetra::MultiVector<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>;
376 using material_type = Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
398 auto importer = A.getCrsGraph()->getImporter();
399 if (!importer.is_null()) {
400 ghostedCoordsMV = Xpetra::MultiVectorFactory<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap(),
coordsMV->getNumVectors());
410 Teuchos::RCP<material_type> ghostedMaterial;
411 if (!importer.is_null()) {
412 ghostedMaterial = Xpetra::MultiVectorFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap(), material_->getNumVectors());
413 ghostedMaterial->doImport(*material_, *importer, Xpetra::INSERT);
415 ghostedMaterial = material_;
418 using execution_space =
typename Node::execution_space;
419 using range_type = Kokkos::RangePolicy<LocalOrdinal, execution_space>;
422 auto lclMaterial = ghostedMaterial->getLocalViewDevice(Tpetra::Access::ReadOnly);
426 Kokkos::parallel_for(
"MueLu:TensorMaterialDistanceFunctor::inversion", range_type(0, lclMaterial.extent(0)), functor);
430 KOKKOS_INLINE_FUNCTION
439 auto matrix_row_material = Kokkos::subview(
material, row, Kokkos::ALL(), Kokkos::ALL());
440 auto dist = Kokkos::subview(
lcl_dist, row, Kokkos::ALL());
442 for (
size_t j = 0; j <
coords.extent(1); ++j) {
446 KokkosBatched::SerialTrsv<KokkosBatched::Uplo::Lower, KokkosBatched::Trans::NoTranspose, KokkosBatched::Diag::Unit, KokkosBatched::Algo::Trsv::Unblocked>::invoke(
one, matrix_row_material, dist);
447 KokkosBatched::SerialTrsv<KokkosBatched::Uplo::Upper, KokkosBatched::Trans::NoTranspose, KokkosBatched::Diag::NonUnit, KokkosBatched::Algo::Trsv::Unblocked>::invoke(
one, matrix_row_material, dist);
449 for (
size_t j = 0; j <
coords.extent(1); ++j) {
457 auto matrix_col_material = Kokkos::subview(
material, col, Kokkos::ALL(), Kokkos::ALL());
458 auto dist = Kokkos::subview(
lcl_dist, row, Kokkos::ALL());
460 for (
size_t j = 0; j <
coords.extent(1); ++j) {
464 KokkosBatched::SerialTrsv<KokkosBatched::Uplo::Lower, KokkosBatched::Trans::NoTranspose, KokkosBatched::Diag::Unit, KokkosBatched::Algo::Trsv::Unblocked>::invoke(
one, matrix_col_material, dist);
465 KokkosBatched::SerialTrsv<KokkosBatched::Uplo::Upper, KokkosBatched::Trans::NoTranspose, KokkosBatched::Diag::NonUnit, KokkosBatched::Algo::Trsv::Unblocked>::invoke(
one, matrix_col_material, dist);
467 for (
size_t j = 0; j <
coords.extent(1); ++j) {
472 return Kokkos::max(implATS::magnitude(d_row), implATS::magnitude(d_col));
479template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node,
class DistanceFunctorType>
480Teuchos::RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
481getDiagonal(Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
482 DistanceFunctorType& distFunctor) {
483 using scalar_type =
Scalar;
485#if KOKKOS_VERSION >= 40799
486 using ATS = KokkosKernels::ArithTraits<scalar_type>;
488 using ATS = Kokkos::ArithTraits<scalar_type>;
490 using impl_scalar_type =
typename ATS::val_type;
491#if KOKKOS_VERSION >= 40799
492 using implATS = KokkosKernels::ArithTraits<impl_scalar_type>;
494 using implATS = Kokkos::ArithTraits<impl_scalar_type>;
496 using magnitudeType =
typename implATS::magnitudeType;
497 using execution_space =
typename Node::execution_space;
498 using range_type = Kokkos::RangePolicy<LocalOrdinal, execution_space>;
500 auto diag = Xpetra::MultiVectorFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(A.getRowMap(), 1);
502 auto lclA = A.getLocalMatrixDevice();
503 auto lclDiag = diag->getLocalViewDevice(Tpetra::Access::OverwriteAll);
505 Kokkos::parallel_for(
506 "MueLu:CoalesceDropF:Build:scalar_filter:laplacian_diag",
507 range_type(0, lclA.numRows()),
508 KOKKOS_LAMBDA(
const local_ordinal_type& row) {
509 auto rowView = lclA.rowConst(row);
510 auto length = rowView.length;
513 impl_scalar_type d2 = implATS::zero();
514 bool haveAddedToDiag =
false;
515 for (local_ordinal_type colID = 0; colID < length; colID++) {
516 auto col = rowView.colidx(colID);
518 d = distFunctor.distance2(row, col);
519 d2 += implATS::one() / d;
520 haveAddedToDiag =
true;
526 lclDiag(row, 0) = !haveAddedToDiag ? implATS::squareroot(implATS::rmax()) : d2;
529 auto importer = A.getCrsGraph()->getImporter();
530 if (!importer.is_null()) {
531 auto ghostedDiag = Xpetra::MultiVectorFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(A.getColMap(), 1);
532 ghostedDiag->doImport(*diag, *importer, Xpetra::INSERT);
539template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node,
class DistanceFunctorType>
540Teuchos::RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
542 DistanceFunctorType& distFunctor) {
543 using scalar_type =
Scalar;
545#if KOKKOS_VERSION >= 40799
546 using ATS = KokkosKernels::ArithTraits<scalar_type>;
548 using ATS = Kokkos::ArithTraits<scalar_type>;
550 using impl_scalar_type =
typename ATS::val_type;
551#if KOKKOS_VERSION >= 40799
552 using implATS = KokkosKernels::ArithTraits<impl_scalar_type>;
554 using implATS = Kokkos::ArithTraits<impl_scalar_type>;
556 using magnitudeType =
typename implATS::magnitudeType;
557 using execution_space =
typename Node::execution_space;
558 using range_type = Kokkos::RangePolicy<LocalOrdinal, execution_space>;
560 auto diag = Xpetra::MultiVectorFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(A.getRowMap(), 1);
562 auto lclA = A.getLocalMatrixDevice();
563 auto lclDiag = diag->getLocalViewDevice(Tpetra::Access::OverwriteAll);
565 Kokkos::parallel_for(
566 "MueLu:CoalesceDropF:Build:scalar_filter:laplacian_diag",
567 range_type(0, lclA.numRows()),
568 KOKKOS_LAMBDA(
const local_ordinal_type& row) {
569 auto rowView = lclA.rowConst(row);
570 auto length = rowView.length;
572 impl_scalar_type mymax = implATS::zero();
575 for (local_ordinal_type colID = 0; colID < length; colID++) {
576 auto col = rowView.colidx(colID);
578 d = distFunctor.distance2(row, col);
579 d2 = implATS::one() / d;
580 if (implATS::magnitude(mymax) < implATS::magnitude(d2))
581 mymax = implATS::magnitude(d2);
584 lclDiag(row, 0) = mymax;
587 auto importer = A.getCrsGraph()->getImporter();
588 if (!importer.is_null()) {
589 auto ghostedDiag = Xpetra::MultiVectorFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(A.getColMap(), 1);
590 ghostedDiag->doImport(*diag, *importer, Xpetra::INSERT);
607template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node,
class DistanceFunctorType, Misc::StrengthMeasure measure>
610 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
615 using diag_vec_type = Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
616 using diag_view_type =
typename Kokkos::DualView<const scalar_type*, Kokkos::LayoutStride, typename Node::device_type, Kokkos::MemoryUnmanaged>::t_dev;
620#if KOKKOS_VERSION >= 40799
621 using ATS = KokkosKernels::ArithTraits<scalar_type>;
623 using ATS = Kokkos::ArithTraits<scalar_type>;
627#if KOKKOS_VERSION >= 40799
628 using mATS = KokkosKernels::ArithTraits<magnitudeType>;
630 using mATS = Kokkos::ArithTraits<magnitudeType>;
644 :
A(A_.getLocalMatrixDevice())
650 auto lclDiag2d =
diagVec->getLocalViewDevice(Tpetra::Access::ReadOnly);
651 diag = Kokkos::subview(lclDiag2d, Kokkos::ALL(), 0);
654 auto lclDiag2d =
diagVec->getLocalViewDevice(Tpetra::Access::ReadOnly);
655 diag = Kokkos::subview(lclDiag2d, Kokkos::ALL(), 0);
659 KOKKOS_FORCEINLINE_FUNCTION
661 auto row =
A.rowConst(rlid);
662 const size_t offset =
A.graph.row_map(rlid);
664#ifdef MUELU_COALESCE_DROP_DEBUG
666 Kokkos::printf(
"SoC: ");
668 auto clid = row.colidx(k);
672 val = -
one /
dist2.distance2(rlid, clid);
678 auto aiiajj = ATS::magnitude(
diag(rlid)) * ATS::magnitude(
diag(clid));
679 auto aij2 = ATS::magnitude(val) * ATS::magnitude(val);
681 Kokkos::printf(
"%5f ", ATS::sqrt(aij2 / aiiajj));
683 auto neg_aij = -ATS::real(val);
684 auto max_neg_aik = ATS::real(
diag(rlid));
685 Kokkos::printf(
"%5f ", neg_aij / max_neg_aik);
687 auto aiiajj = ATS::magnitude(
diag(rlid)) * ATS::magnitude(
diag(clid));
688 const bool is_nonpositive = ATS::real(val) <= mATS::zero();
689 magnitudeType aij2 = ATS::magnitude(val) * ATS::magnitude(val);
693 Kokkos::printf(
"%5f ", ATS::sqrt(aij2 / aiiajj));
696 Kokkos::printf(
"\n");
701 auto clid = row.colidx(k);
705 val = -
one /
dist2.distance2(rlid, clid);
711 auto aiiajj = ATS::magnitude(
diag(rlid)) * ATS::magnitude(
diag(clid));
712 auto aij2 = ATS::magnitude(val) * ATS::magnitude(val);
717 auto neg_aij = -ATS::real(val);
718 auto max_neg_aik =
eps * ATS::real(
diag(rlid));
719 results(offset + k) = Kokkos::max((neg_aij < max_neg_aik) ?
DROP :
KEEP,
722 auto aiiajj = ATS::magnitude(
diag(rlid)) * ATS::magnitude(
diag(clid));
723 const bool is_nonpositive = ATS::real(val) <= mATS::zero();
724 magnitudeType aij2 = ATS::magnitude(val) * ATS::magnitude(val);
735template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node,
class DistanceFunctorType, Misc::StrengthMeasure measure>
738 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
744 using diag_vec_type = Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
745 using diag_view_type =
typename Kokkos::DualView<const scalar_type*, Kokkos::LayoutStride, typename Node::device_type, Kokkos::MemoryUnmanaged>::t_dev;
749#if KOKKOS_VERSION >= 40799
750 using ATS = KokkosKernels::ArithTraits<scalar_type>;
752 using ATS = Kokkos::ArithTraits<scalar_type>;
756#if KOKKOS_VERSION >= 40799
757 using mATS = KokkosKernels::ArithTraits<magnitudeType>;
759 using mATS = Kokkos::ArithTraits<magnitudeType>;
775 :
A(A_.getLocalMatrixDevice())
783 auto lclDiag2d =
diagVec->getLocalViewDevice(Tpetra::Access::ReadOnly);
784 diag = Kokkos::subview(lclDiag2d, Kokkos::ALL(), 0);
787 auto lclDiag2d =
diagVec->getLocalViewDevice(Tpetra::Access::ReadOnly);
788 diag = Kokkos::subview(lclDiag2d, Kokkos::ALL(), 0);
792 KOKKOS_FORCEINLINE_FUNCTION
795 auto row =
A.rowConst(rlid);
796 const size_t offset =
A.graph.row_map(rlid);
798#ifdef MUELU_COALESCE_DROP_DEBUG
800 Kokkos::printf(
"SoC: ");
802 auto clid = row.colidx(k);
806 if (brlid != bclid) {
807 val = -
one /
dist2.distance2(brlid, bclid);
813 auto aiiajj = ATS::magnitude(
diag(brlid)) * ATS::magnitude(
diag(bclid));
814 auto aij2 = ATS::magnitude(val) * ATS::magnitude(val);
816 Kokkos::printf(
"%5f ", ATS::sqrt(aij2 / aiiajj));
818 auto neg_aij = -ATS::real(val);
819 auto max_neg_aik =
eps * ATS::real(
diag(brlid));
820 Kokkos::printf(
"%5f ", neg_aij / max_neg_aik);
822 auto aiiajj = ATS::magnitude(
diag(brlid)) * ATS::magnitude(
diag(bclid));
823 const bool is_nonpositive = ATS::real(val) <= mATS::zero();
824 magnitudeType aij2 = ATS::magnitude(val) * ATS::magnitude(val);
828 Kokkos::printf(
"%5f ", ATS::sqrt(aij2 / aiiajj));
831 Kokkos::printf(
"\n");
836 auto clid = row.colidx(k);
840 if (brlid != bclid) {
841 val = -
one /
dist2.distance2(brlid, bclid);
847 auto aiiajj = ATS::magnitude(
diag(brlid)) * ATS::magnitude(
diag(bclid));
848 auto aij2 = ATS::magnitude(val) * ATS::magnitude(val);
853 auto neg_aij = -ATS::real(val);
854 auto max_neg_aik =
eps * ATS::real(
diag(brlid));
855 results(offset + k) = Kokkos::max((neg_aij < max_neg_aik) ?
DROP :
KEEP,
858 auto aiiajj = ATS::magnitude(
diag(brlid)) * ATS::magnitude(
diag(bclid));
859 const bool is_nonpositive = ATS::real(val) <= mATS::zero();
860 magnitudeType aij2 = ATS::magnitude(val) * ATS::magnitude(val);
872template <Misc::StrengthMeasure measure,
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node,
class DistanceFunctorType>
875 DistanceFunctorType& dist2_,
881template <Misc::StrengthMeasure measure,
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node,
class DistanceFunctorType>
883 Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& mergedA_,
885 DistanceFunctorType& dist2_,
889 auto functor =
VectorDropFunctor<Scalar, LocalOrdinal, GlobalOrdinal, Node, DistanceFunctorType, measure>(A_, mergedA_, threshold, dist2_, results_, point_to_block_, ghosted_point_to_block_);
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultScalar Scalar
Computes the weighted distance Laplacian.
BlockWeightedDistanceFunctor(matrix_type &A, Teuchos::RCP< coords_type > &coords_, weight_type weight_, local_ordinal_type interleaved_blocksize_)
typename matrix_type::local_matrix_device_type local_matrix_type
LocalOrdinal local_ordinal_type
typename implATS::magnitudeType magnitudeType
Xpetra::MultiVector< magnitudeType, LocalOrdinal, GlobalOrdinal, Node > coords_type
Kokkos::ArithTraits< magnitudeType > magATS
typename coords_type::dual_view_type_const::t_dev local_coords_type
KOKKOS_FORCEINLINE_FUNCTION magnitudeType distance2(const local_ordinal_type row, const local_ordinal_type col) const
local_coords_type ghostedCoords
Kokkos::ArithTraits< impl_scalar_type > implATS
Teuchos::RCP< coords_type > ghostedCoordsMV
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > matrix_type
typename ATS::val_type impl_scalar_type
typename local_matrix_type::value_type scalar_type
Teuchos::RCP< coords_type > coordsMV
local_ordinal_type interleaved_blocksize
Kokkos::ArithTraits< scalar_type > ATS
Drops entries the unscaled distance Laplacian.
Teuchos::RCP< diag_vec_type > diagVec
Kokkos::ArithTraits< magnitudeType > mATS
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > matrix_type
typename local_matrix_type::memory_space memory_space
typename ATS::magnitudeType magnitudeType
Kokkos::View< DecisionType *, memory_space > results_view
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
typename Kokkos::DualView< const scalar_type *, Kokkos::LayoutStride, typename Node::device_type, Kokkos::MemoryUnmanaged >::t_dev diag_view_type
typename matrix_type::local_matrix_device_type local_matrix_type
Kokkos::View< const bool *, memory_space > boundary_nodes_view
DistanceFunctorType dist2
typename local_matrix_type::ordinal_type local_ordinal_type
Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > diag_vec_type
Kokkos::ArithTraits< scalar_type > ATS
DropFunctor(matrix_type &A_, magnitudeType threshold, DistanceFunctorType &dist2_, results_view &results_)
typename local_matrix_type::value_type scalar_type
Teuchos::RCP< material_type > ghostedMaterialMV
Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > material_type
Teuchos::RCP< material_type > materialMV
Xpetra::MultiVector< magnitudeType, LocalOrdinal, GlobalOrdinal, Node > coords_type
KOKKOS_INLINE_FUNCTION magnitudeType distance2(const local_ordinal_type row, const local_ordinal_type col) const
Teuchos::RCP< coords_type > coordsMV
typename implATS::magnitudeType magnitudeType
typename coords_type::dual_view_type_const::t_dev local_coords_type
ScalarMaterialDistanceFunctor(matrix_type &A, Teuchos::RCP< coords_type > &coords_, Teuchos::RCP< material_type > &material_)
local_material_type ghostedMaterial
LocalOrdinal local_ordinal_type
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > matrix_type
local_coords_type ghostedCoords
typename local_matrix_type::value_type scalar_type
typename material_type::dual_view_type_const::t_dev local_material_type
Kokkos::ArithTraits< magnitudeType > magATS
Kokkos::ArithTraits< scalar_type > ATS
local_material_type material
Teuchos::RCP< coords_type > ghostedCoordsMV
typename ATS::val_type impl_scalar_type
typename matrix_type::local_matrix_device_type local_matrix_type
Kokkos::ArithTraits< impl_scalar_type > implATS
TensorInversion(material_vector_type &material_vector_, material_matrix_type &material_matrix_)
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type i) const
material_matrix_type material_matrix
material_vector_type material_vector
Teuchos::RCP< coords_type > coordsMV
Kokkos::View< impl_scalar_type **, memory_space > local_dist_type
Kokkos::ArithTraits< scalar_type > ATS
typename local_matrix_type::value_type scalar_type
typename coords_type::dual_view_type_const::t_dev local_coords_type
typename ATS::val_type impl_scalar_type
Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > material_type
local_coords_type ghostedCoords
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > matrix_type
local_material_type material
typename matrix_type::local_matrix_device_type local_matrix_type
Kokkos::View< impl_scalar_type ***, memory_space > local_material_type
Kokkos::ArithTraits< impl_scalar_type > implATS
typename local_matrix_type::memory_space memory_space
Xpetra::MultiVector< magnitudeType, LocalOrdinal, GlobalOrdinal, Node > coords_type
KOKKOS_INLINE_FUNCTION magnitudeType distance2(const local_ordinal_type row, const local_ordinal_type col) const
TensorMaterialDistanceFunctor(matrix_type &A, Teuchos::RCP< coords_type > &coords_, Teuchos::RCP< material_type > &material_)
Kokkos::ArithTraits< magnitudeType > magATS
Teuchos::RCP< coords_type > ghostedCoordsMV
LocalOrdinal local_ordinal_type
typename implATS::magnitudeType magnitudeType
Computes the unscaled distance Laplacian.
KOKKOS_FORCEINLINE_FUNCTION magnitudeType distance2(const local_ordinal_type row, const local_ordinal_type col) const
typename matrix_type::local_matrix_device_type local_matrix_type
local_coords_type ghostedCoords
Xpetra::MultiVector< magnitudeType, LocalOrdinal, GlobalOrdinal, Node > coords_type
Kokkos::ArithTraits< impl_scalar_type > implATS
Kokkos::ArithTraits< scalar_type > ATS
Teuchos::RCP< coords_type > ghostedCoordsMV
typename local_matrix_type::value_type scalar_type
typename coords_type::dual_view_type_const::t_dev local_coords_type
Teuchos::RCP< coords_type > coordsMV
Kokkos::ArithTraits< magnitudeType > magATS
LocalOrdinal local_ordinal_type
typename implATS::magnitudeType magnitudeType
UnweightedDistanceFunctor(matrix_type &A, Teuchos::RCP< coords_type > &coords_)
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > matrix_type
typename ATS::val_type impl_scalar_type
typename local_matrix_type::ordinal_type local_ordinal_type
Kokkos::ArithTraits< magnitudeType > mATS
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > matrix_type
typename local_matrix_type::memory_space memory_space
block_indices_view_type point_to_block
Kokkos::View< local_ordinal_type *, memory_space > block_indices_view_type
Kokkos::View< DecisionType *, memory_space > results_view
typename Kokkos::DualView< const scalar_type *, Kokkos::LayoutStride, typename Node::device_type, Kokkos::MemoryUnmanaged >::t_dev diag_view_type
DistanceFunctorType dist2
KOKKOS_FORCEINLINE_FUNCTION void operator()(local_ordinal_type rlid) const
Kokkos::View< const bool *, memory_space > boundary_nodes_view
typename local_matrix_type::value_type scalar_type
block_indices_view_type ghosted_point_to_block
Teuchos::RCP< diag_vec_type > diagVec
typename matrix_type::local_matrix_device_type local_matrix_type
Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > diag_vec_type
VectorDropFunctor(matrix_type &A_, matrix_type &mergedA_, magnitudeType threshold, DistanceFunctorType &dist2_, results_view &results_, block_indices_view_type point_to_block_, block_indices_view_type ghosted_point_to_block_)
Kokkos::ArithTraits< scalar_type > ATS
typename ATS::magnitudeType magnitudeType
Computes the weighted distance Laplacian.
typename local_matrix_type::value_type scalar_type
typename implATS::magnitudeType magnitudeType
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > matrix_type
typename ATS::val_type impl_scalar_type
KOKKOS_FORCEINLINE_FUNCTION magnitudeType distance2(const local_ordinal_type row, const local_ordinal_type col) const
LocalOrdinal local_ordinal_type
local_coords_type ghostedCoords
Kokkos::ArithTraits< impl_scalar_type > implATS
Teuchos::RCP< coords_type > coordsMV
WeightedDistanceFunctor(matrix_type &A, Teuchos::RCP< coords_type > &coords_, weight_type weight_)
Kokkos::ArithTraits< magnitudeType > magATS
Kokkos::ArithTraits< scalar_type > ATS
Teuchos::RCP< coords_type > ghostedCoordsMV
typename matrix_type::local_matrix_device_type local_matrix_type
Xpetra::MultiVector< magnitudeType, LocalOrdinal, GlobalOrdinal, Node > coords_type
typename coords_type::dual_view_type_const::t_dev local_coords_type
Teuchos::RCP< Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getDiagonal(Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, DistanceFunctorType &distFunctor)
Teuchos::RCP< Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getMaxMinusOffDiagonal(Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, DistanceFunctorType &distFunctor)
auto make_vector_drop_functor(Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A_, Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &mergedA_, typename VectorDropFunctor< Scalar, LocalOrdinal, GlobalOrdinal, Node, DistanceFunctorType, measure >::magnitudeType threshold, DistanceFunctorType &dist2_, typename VectorDropFunctor< Scalar, LocalOrdinal, GlobalOrdinal, Node, DistanceFunctorType, measure >::results_view &results_, typename VectorDropFunctor< Scalar, LocalOrdinal, GlobalOrdinal, Node, DistanceFunctorType, measure >::block_indices_view_type point_to_block_, typename VectorDropFunctor< Scalar, LocalOrdinal, GlobalOrdinal, Node, DistanceFunctorType, measure >::block_indices_view_type ghosted_point_to_block_)
auto make_drop_functor(Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A_, typename DropFunctor< Scalar, LocalOrdinal, GlobalOrdinal, Node, DistanceFunctorType, measure >::magnitudeType threshold, DistanceFunctorType &dist2_, typename DropFunctor< Scalar, LocalOrdinal, GlobalOrdinal, Node, DistanceFunctorType, measure >::results_view &results_)
@ SignedSmoothedAggregationMeasure
@ SignedRugeStuebenMeasure
@ SmoothedAggregationMeasure