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#include "KokkosKernels_ArithTraits.hpp"
21#include "Teuchos_RCP.hpp"
22#include "Xpetra_Matrix.hpp"
23#include "Xpetra_MultiVector.hpp"
24#include "Xpetra_MultiVectorFactory.hpp"
32template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
35 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
39 using ATS = KokkosKernels::ArithTraits<scalar_type>;
41 using implATS = KokkosKernels::ArithTraits<impl_scalar_type>;
43 using magATS = KokkosKernels::ArithTraits<magnitudeType>;
44 using coords_type = Xpetra::MultiVector<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>;
56 auto importer = A.getCrsGraph()->getImporter();
57 if (!importer.is_null()) {
58 ghostedCoordsMV = Xpetra::MultiVectorFactory<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap(),
coordsMV->getNumVectors(),
false);
68 KOKKOS_FORCEINLINE_FUNCTION
72 for (
size_t j = 0; j <
coords.extent(1); ++j) {
84template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node,
class weight_type>
87 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
91 using ATS = KokkosKernels::ArithTraits<scalar_type>;
93 using implATS = KokkosKernels::ArithTraits<impl_scalar_type>;
95 using magATS = KokkosKernels::ArithTraits<magnitudeType>;
96 using coords_type = Xpetra::MultiVector<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>;
110 auto importer = A.getCrsGraph()->getImporter();
111 if (!importer.is_null()) {
112 ghostedCoordsMV = Xpetra::MultiVectorFactory<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap(),
coordsMV->getNumVectors(),
false);
124 KOKKOS_FORCEINLINE_FUNCTION
129 for (
size_t j = 0; j <
coords.extent(1); ++j) {
142template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node,
class weight_type>
145 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
149 using ATS = KokkosKernels::ArithTraits<scalar_type>;
151 using implATS = KokkosKernels::ArithTraits<impl_scalar_type>;
153 using magATS = KokkosKernels::ArithTraits<magnitudeType>;
154 using coords_type = Xpetra::MultiVector<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>;
169 auto importer = A.getCrsGraph()->getImporter();
170 if (!importer.is_null()) {
171 ghostedCoordsMV = Xpetra::MultiVectorFactory<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap(),
coordsMV->getNumVectors(),
false);
184 KOKKOS_FORCEINLINE_FUNCTION
191 for (
size_t j = 0; j <
coords.extent(1); ++j) {
193 w =
weight(block_start + j);
200template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
203 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
207 using ATS = KokkosKernels::ArithTraits<scalar_type>;
209 using implATS = KokkosKernels::ArithTraits<impl_scalar_type>;
211 using magATS = KokkosKernels::ArithTraits<magnitudeType>;
212 using coords_type = Xpetra::MultiVector<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>;
214 using material_type = Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
233 auto importer = A.getCrsGraph()->getImporter();
234 if (!importer.is_null()) {
235 ghostedCoordsMV = Xpetra::MultiVectorFactory<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap(),
coordsMV->getNumVectors(),
false);
240 ghostedMaterialMV = Xpetra::MultiVectorFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap(),
materialMV->getNumVectors(),
false);
253 KOKKOS_INLINE_FUNCTION
263 for (
size_t j = 0; j <
coords.extent(1); ++j) {
271 return Kokkos::max(d_row, d_col);
275template <
class local_ordinal_type,
class material_vector_type,
class material_matrix_type>
282 TensorInversion(material_vector_type& material_vector_, material_matrix_type& material_matrix_)
286 KOKKOS_FORCEINLINE_FUNCTION
293 auto matrix_material = Kokkos::subview(
material_matrix, i, Kokkos::ALL(), Kokkos::ALL());
294 KokkosBatched::SerialLU<KokkosBatched::Algo::LU::Unblocked>::invoke(matrix_material);
298template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
301 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
305 using ATS = KokkosKernels::ArithTraits<scalar_type>;
307 using implATS = KokkosKernels::ArithTraits<impl_scalar_type>;
309 using magATS = KokkosKernels::ArithTraits<magnitudeType>;
310 using coords_type = Xpetra::MultiVector<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>;
312 using material_type = Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
334 auto importer = A.getCrsGraph()->getImporter();
335 if (!importer.is_null()) {
336 ghostedCoordsMV = Xpetra::MultiVectorFactory<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap(),
coordsMV->getNumVectors(),
false);
346 Teuchos::RCP<material_type> ghostedMaterial;
347 if (!importer.is_null()) {
348 ghostedMaterial = Xpetra::MultiVectorFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(importer->getTargetMap(), material_->getNumVectors(),
false);
349 ghostedMaterial->doImport(*material_, *importer, Xpetra::INSERT);
351 ghostedMaterial = material_;
354 using execution_space =
typename Node::execution_space;
355 using range_type = Kokkos::RangePolicy<LocalOrdinal, execution_space>;
358 auto lclMaterial = ghostedMaterial->getLocalViewDevice(Tpetra::Access::ReadOnly);
362 Kokkos::parallel_for(
"MueLu:TensorMaterialDistanceFunctor::inversion", range_type(0, lclMaterial.extent(0)), functor);
366 KOKKOS_INLINE_FUNCTION
375 auto matrix_row_material = Kokkos::subview(
material, row, Kokkos::ALL(), Kokkos::ALL());
376 auto dist = Kokkos::subview(
lcl_dist, row, Kokkos::ALL());
378 for (
size_t j = 0; j <
coords.extent(1); ++j) {
382 KokkosBatched::SerialTrsv<KokkosBatched::Uplo::Lower, KokkosBatched::Trans::NoTranspose, KokkosBatched::Diag::Unit, KokkosBatched::Algo::Trsv::Unblocked>::invoke(
one, matrix_row_material, dist);
383 KokkosBatched::SerialTrsv<KokkosBatched::Uplo::Upper, KokkosBatched::Trans::NoTranspose, KokkosBatched::Diag::NonUnit, KokkosBatched::Algo::Trsv::Unblocked>::invoke(
one, matrix_row_material, dist);
385 for (
size_t j = 0; j <
coords.extent(1); ++j) {
393 auto matrix_col_material = Kokkos::subview(
material, col, Kokkos::ALL(), Kokkos::ALL());
394 auto dist = Kokkos::subview(
lcl_dist, row, Kokkos::ALL());
396 for (
size_t j = 0; j <
coords.extent(1); ++j) {
400 KokkosBatched::SerialTrsv<KokkosBatched::Uplo::Lower, KokkosBatched::Trans::NoTranspose, KokkosBatched::Diag::Unit, KokkosBatched::Algo::Trsv::Unblocked>::invoke(
one, matrix_col_material, dist);
401 KokkosBatched::SerialTrsv<KokkosBatched::Uplo::Upper, KokkosBatched::Trans::NoTranspose, KokkosBatched::Diag::NonUnit, KokkosBatched::Algo::Trsv::Unblocked>::invoke(
one, matrix_col_material, dist);
403 for (
size_t j = 0; j <
coords.extent(1); ++j) {
408 return Kokkos::max(implATS::magnitude(d_row), implATS::magnitude(d_col));
415template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node,
class DistanceFunctorType>
416Teuchos::RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
417getDiagonal(Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
418 DistanceFunctorType& distFunctor) {
419 using scalar_type =
Scalar;
421 using ATS = KokkosKernels::ArithTraits<scalar_type>;
422 using impl_scalar_type =
typename ATS::val_type;
423 using implATS = KokkosKernels::ArithTraits<impl_scalar_type>;
424 using magnitudeType =
typename implATS::magnitudeType;
425 using execution_space =
typename Node::execution_space;
426 using range_type = Kokkos::RangePolicy<LocalOrdinal, execution_space>;
428 auto diag = Xpetra::MultiVectorFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(A.getRowMap(), 1,
false);
430 auto lclA = A.getLocalMatrixDevice();
431 auto lclDiag = diag->getLocalViewDevice(Tpetra::Access::OverwriteAll);
433 Kokkos::parallel_for(
434 "MueLu:CoalesceDropF:Build:scalar_filter:laplacian_diag",
435 range_type(0, lclA.numRows()),
436 KOKKOS_LAMBDA(
const local_ordinal_type& row) {
437 auto rowView = lclA.rowConst(row);
438 auto length = rowView.length;
441 impl_scalar_type d2 = implATS::zero();
442 bool haveAddedToDiag =
false;
443 for (local_ordinal_type colID = 0; colID < length; colID++) {
444 auto col = rowView.colidx(colID);
446 d = distFunctor.distance2(row, col);
447 d2 += implATS::one() / d;
448 haveAddedToDiag =
true;
454 lclDiag(row, 0) = !haveAddedToDiag ? implATS::squareroot(implATS::rmax()) : d2;
457 auto importer = A.getCrsGraph()->getImporter();
458 if (!importer.is_null()) {
459 auto ghostedDiag = Xpetra::MultiVectorFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(A.getColMap(), 1,
false);
460 ghostedDiag->doImport(*diag, *importer, Xpetra::INSERT);
467template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node,
class DistanceFunctorType>
468Teuchos::RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
470 DistanceFunctorType& distFunctor) {
471 using scalar_type =
Scalar;
473 using ATS = KokkosKernels::ArithTraits<scalar_type>;
474 using impl_scalar_type =
typename ATS::val_type;
475 using implATS = KokkosKernels::ArithTraits<impl_scalar_type>;
476 using magnitudeType =
typename implATS::magnitudeType;
477 using execution_space =
typename Node::execution_space;
478 using range_type = Kokkos::RangePolicy<LocalOrdinal, execution_space>;
480 auto diag = Xpetra::MultiVectorFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(A.getRowMap(), 1,
false);
482 auto lclA = A.getLocalMatrixDevice();
483 auto lclDiag = diag->getLocalViewDevice(Tpetra::Access::OverwriteAll);
485 Kokkos::parallel_for(
486 "MueLu:CoalesceDropF:Build:scalar_filter:laplacian_diag",
487 range_type(0, lclA.numRows()),
488 KOKKOS_LAMBDA(
const local_ordinal_type& row) {
489 auto rowView = lclA.rowConst(row);
490 auto length = rowView.length;
492 impl_scalar_type mymax = implATS::zero();
495 for (local_ordinal_type colID = 0; colID < length; colID++) {
496 auto col = rowView.colidx(colID);
498 d = distFunctor.distance2(row, col);
499 d2 = implATS::one() / d;
500 if (implATS::magnitude(mymax) < implATS::magnitude(d2))
501 mymax = implATS::magnitude(d2);
504 lclDiag(row, 0) = mymax;
507 auto importer = A.getCrsGraph()->getImporter();
508 if (!importer.is_null()) {
509 auto ghostedDiag = Xpetra::MultiVectorFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(A.getColMap(), 1,
false);
510 ghostedDiag->doImport(*diag, *importer, Xpetra::INSERT);
527template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node,
class DistanceFunctorType, Misc::StrengthMeasure measure>
530 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
535 using diag_vec_type = Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
536 using diag_view_type =
typename Kokkos::DualView<const scalar_type*, Kokkos::LayoutStride, typename Node::device_type, Kokkos::MemoryUnmanaged>::t_dev;
540 using ATS = KokkosKernels::ArithTraits<scalar_type>;
543 using mATS = KokkosKernels::ArithTraits<magnitudeType>;
556 :
A(A_.getLocalMatrixDevice())
562 auto lclDiag2d =
diagVec->getLocalViewDevice(Tpetra::Access::ReadOnly);
563 diag = Kokkos::subview(lclDiag2d, Kokkos::ALL(), 0);
566 auto lclDiag2d =
diagVec->getLocalViewDevice(Tpetra::Access::ReadOnly);
567 diag = Kokkos::subview(lclDiag2d, Kokkos::ALL(), 0);
571 KOKKOS_FORCEINLINE_FUNCTION
573 auto row =
A.rowConst(rlid);
574 const size_t offset =
A.graph.row_map(rlid);
576#ifdef MUELU_COALESCE_DROP_DEBUG
578 Kokkos::printf(
"SoC: ");
580 auto clid = row.colidx(k);
584 val = -
one /
dist2.distance2(rlid, clid);
590 auto aiiajj = ATS::magnitude(
diag(rlid)) * ATS::magnitude(
diag(clid));
591 auto aij2 = ATS::magnitude(val) * ATS::magnitude(val);
593 Kokkos::printf(
"%5f ", ATS::sqrt(aij2 / aiiajj));
595 auto neg_aij = -ATS::real(val);
596 auto max_neg_aik = ATS::real(
diag(rlid));
597 Kokkos::printf(
"%5f ", neg_aij / max_neg_aik);
599 auto aiiajj = ATS::magnitude(
diag(rlid)) * ATS::magnitude(
diag(clid));
600 const bool is_nonpositive = ATS::real(val) <= mATS::zero();
601 magnitudeType aij2 = ATS::magnitude(val) * ATS::magnitude(val);
605 Kokkos::printf(
"%5f ", ATS::sqrt(aij2 / aiiajj));
608 Kokkos::printf(
"\n");
613 auto clid = row.colidx(k);
617 val = -
one /
dist2.distance2(rlid, clid);
623 auto aiiajj = ATS::magnitude(
diag(rlid)) * ATS::magnitude(
diag(clid));
624 auto aij2 = ATS::magnitude(val) * ATS::magnitude(val);
629 auto neg_aij = -ATS::real(val);
630 auto max_neg_aik =
eps * ATS::real(
diag(rlid));
631 results(offset + k) = Kokkos::max((neg_aij < max_neg_aik) ?
DROP :
KEEP,
634 auto aiiajj = ATS::magnitude(
diag(rlid)) * ATS::magnitude(
diag(clid));
635 const bool is_nonpositive = ATS::real(val) <= mATS::zero();
636 magnitudeType aij2 = ATS::magnitude(val) * ATS::magnitude(val);
647template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node,
class DistanceFunctorType, Misc::StrengthMeasure measure>
650 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
656 using diag_vec_type = Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
657 using diag_view_type =
typename Kokkos::DualView<const scalar_type*, Kokkos::LayoutStride, typename Node::device_type, Kokkos::MemoryUnmanaged>::t_dev;
661 using ATS = KokkosKernels::ArithTraits<scalar_type>;
664 using mATS = KokkosKernels::ArithTraits<magnitudeType>;
679 :
A(A_.getLocalMatrixDevice())
687 auto lclDiag2d =
diagVec->getLocalViewDevice(Tpetra::Access::ReadOnly);
688 diag = Kokkos::subview(lclDiag2d, Kokkos::ALL(), 0);
691 auto lclDiag2d =
diagVec->getLocalViewDevice(Tpetra::Access::ReadOnly);
692 diag = Kokkos::subview(lclDiag2d, Kokkos::ALL(), 0);
696 KOKKOS_FORCEINLINE_FUNCTION
699 auto row =
A.rowConst(rlid);
700 const size_t offset =
A.graph.row_map(rlid);
702#ifdef MUELU_COALESCE_DROP_DEBUG
704 Kokkos::printf(
"SoC: ");
706 auto clid = row.colidx(k);
710 if (brlid != bclid) {
711 val = -
one /
dist2.distance2(brlid, bclid);
717 auto aiiajj = ATS::magnitude(
diag(brlid)) * ATS::magnitude(
diag(bclid));
718 auto aij2 = ATS::magnitude(val) * ATS::magnitude(val);
720 Kokkos::printf(
"%5f ", ATS::sqrt(aij2 / aiiajj));
722 auto neg_aij = -ATS::real(val);
723 auto max_neg_aik =
eps * ATS::real(
diag(brlid));
724 Kokkos::printf(
"%5f ", neg_aij / max_neg_aik);
726 auto aiiajj = ATS::magnitude(
diag(brlid)) * ATS::magnitude(
diag(bclid));
727 const bool is_nonpositive = ATS::real(val) <= mATS::zero();
728 magnitudeType aij2 = ATS::magnitude(val) * ATS::magnitude(val);
732 Kokkos::printf(
"%5f ", ATS::sqrt(aij2 / aiiajj));
735 Kokkos::printf(
"\n");
740 auto clid = row.colidx(k);
744 if (brlid != bclid) {
745 val = -
one /
dist2.distance2(brlid, bclid);
751 auto aiiajj = ATS::magnitude(
diag(brlid)) * ATS::magnitude(
diag(bclid));
752 auto aij2 = ATS::magnitude(val) * ATS::magnitude(val);
757 auto neg_aij = -ATS::real(val);
758 auto max_neg_aik =
eps * ATS::real(
diag(brlid));
759 results(offset + k) = Kokkos::max((neg_aij < max_neg_aik) ?
DROP :
KEEP,
762 auto aiiajj = ATS::magnitude(
diag(brlid)) * ATS::magnitude(
diag(bclid));
763 const bool is_nonpositive = ATS::real(val) <= mATS::zero();
764 magnitudeType aij2 = ATS::magnitude(val) * ATS::magnitude(val);
776template <Misc::StrengthMeasure measure,
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node,
class DistanceFunctorType>
779 DistanceFunctorType& dist2_,
785template <Misc::StrengthMeasure measure,
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node,
class DistanceFunctorType>
787 Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& mergedA_,
789 DistanceFunctorType& dist2_,
793 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
KokkosKernels::ArithTraits< scalar_type > ATS
typename implATS::magnitudeType magnitudeType
Xpetra::MultiVector< magnitudeType, LocalOrdinal, GlobalOrdinal, Node > coords_type
KokkosKernels::ArithTraits< impl_scalar_type > implATS
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
Teuchos::RCP< coords_type > ghostedCoordsMV
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > matrix_type
typename ATS::val_type impl_scalar_type
KokkosKernels::ArithTraits< magnitudeType > magATS
typename local_matrix_type::value_type scalar_type
Teuchos::RCP< coords_type > coordsMV
local_ordinal_type interleaved_blocksize
Drops entries the unscaled distance Laplacian.
KokkosKernels::ArithTraits< magnitudeType > mATS
Teuchos::RCP< diag_vec_type > diagVec
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > matrix_type
typename local_matrix_type::memory_space memory_space
KokkosKernels::ArithTraits< scalar_type > ATS
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
DropFunctor(matrix_type &A_, magnitudeType threshold, DistanceFunctorType &dist2_, results_view &results_)
typename local_matrix_type::value_type scalar_type
Teuchos::RCP< material_type > ghostedMaterialMV
KokkosKernels::ArithTraits< magnitudeType > magATS
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
KokkosKernels::ArithTraits< scalar_type > ATS
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
KokkosKernels::ArithTraits< impl_scalar_type > implATS
local_coords_type ghostedCoords
typename local_matrix_type::value_type scalar_type
typename material_type::dual_view_type_const::t_dev local_material_type
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
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
KokkosKernels::ArithTraits< impl_scalar_type > implATS
Teuchos::RCP< coords_type > coordsMV
Kokkos::View< impl_scalar_type **, memory_space > local_dist_type
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
KokkosKernels::ArithTraits< scalar_type > ATS
local_material_type material
typename matrix_type::local_matrix_device_type local_matrix_type
Kokkos::View< impl_scalar_type ***, memory_space > local_material_type
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_)
Teuchos::RCP< coords_type > ghostedCoordsMV
KokkosKernels::ArithTraits< magnitudeType > magATS
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
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
LocalOrdinal local_ordinal_type
KokkosKernels::ArithTraits< impl_scalar_type > implATS
typename implATS::magnitudeType magnitudeType
KokkosKernels::ArithTraits< scalar_type > ATS
UnweightedDistanceFunctor(matrix_type &A, Teuchos::RCP< coords_type > &coords_)
KokkosKernels::ArithTraits< magnitudeType > magATS
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > matrix_type
typename ATS::val_type impl_scalar_type
typename local_matrix_type::ordinal_type local_ordinal_type
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > matrix_type
KokkosKernels::ArithTraits< magnitudeType > mATS
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
KokkosKernels::ArithTraits< scalar_type > ATS
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_)
typename ATS::magnitudeType magnitudeType
Computes the weighted distance Laplacian.
typename local_matrix_type::value_type scalar_type
typename implATS::magnitudeType magnitudeType
KokkosKernels::ArithTraits< impl_scalar_type > implATS
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
Teuchos::RCP< coords_type > coordsMV
KokkosKernels::ArithTraits< magnitudeType > magATS
WeightedDistanceFunctor(matrix_type &A, Teuchos::RCP< coords_type > &coords_, weight_type weight_)
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
KokkosKernels::ArithTraits< scalar_type > ATS
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