10#ifndef MUELU_SCALARDROPPINGDISTANCELAPLACIAN_DECL_HPP
11#define MUELU_SCALARDROPPINGDISTANCELAPLACIAN_DECL_HPP
18#include "MueLu_Utilities.hpp"
19#include "MueLu_LWGraph_kokkos.hpp"
23template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node, Misc::StrengthMeasure SoC>
26 using matrix_type = Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
27 using crs_matrix_type = Xpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
28 using GraphType = Xpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>;
31 using rowptr_type =
typename local_graph_type::row_map_type::non_const_type;
32 using entries_type =
typename local_graph_type::entries_type::non_const_type;
33 using values_type =
typename local_matrix_type::values_type::non_const_type;
37 using magnitudeType =
typename Teuchos::ScalarTraits<Scalar>::magnitudeType;
41 template <
class DistanceFunctorType>
47 const std::string& droppingMethod,
49 const bool aggregationMayCreateDirichlet,
50 const bool symmetrizeDroppedGraph,
51 const bool useBlocking,
52 DistanceFunctorType& dist2,
55 auto lclA = A.getLocalMatrixDevice();
58 if (droppingMethod ==
"point-wise") {
61 if (aggregationMayCreateDirichlet) {
64 if (symmetrizeDroppedGraph) {
67 dist_laplacian_dropping,
70 mark_singletons_as_boundary);
74 dist_laplacian_dropping,
77 mark_singletons_as_boundary);
80 if (symmetrizeDroppedGraph) {
83 dist_laplacian_dropping,
89 dist_laplacian_dropping,
94 }
else if (droppingMethod ==
"cut-drop") {
98 if (symmetrizeDroppedGraph) {
119 const std::string& droppingMethod,
121 const bool aggregationMayCreateDirichlet,
122 const bool symmetrizeDroppedGraph,
123 const bool useBlocking,
124 const std::string& distanceLaplacianMetric,
MueLu::DefaultLocalOrdinal LocalOrdinal
Order each row by a criterion, compare the ratio of values and drop all entries once the ratio is bel...
Kokkos::View< bool *, memory_space > boundary_nodes_type
Class that holds all level-specific information.
Functor that marks diagonal as kept, unless the are already marked as boundary.
Functor that marks singletons (all off-diagonal entries in a row are dropped) as boundary.
Functor that drops boundary nodes for a blockSize == 1 problem.
Functor that drops boundary nodes for a blockSize == 1 problem.
static void runDroppingFunctors(matrix_type &A, results_view &results, rowptr_type &filtered_rowptr, LocalOrdinal &nnz_filtered, const bool useBlocking, Level &level, const Factory &factory, Functors &... functors)
typename GraphType::local_graph_device_type local_graph_type
typename MueLu::LWGraph_kokkos< LocalOrdinal, GlobalOrdinal, Node >::boundary_nodes_type boundary_nodes_type
Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > GraphType
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > matrix_type
typename crs_matrix_type::local_matrix_device_type local_matrix_type
typename local_matrix_type::values_type::non_const_type values_type
static void runDroppingFunctors_on_dlap(matrix_type &A, results_view &results, rowptr_type &filtered_rowptr, LocalOrdinal &nnz_filtered, boundary_nodes_type &boundaryNodes, const std::string &droppingMethod, const magnitudeType threshold, const bool aggregationMayCreateDirichlet, const bool symmetrizeDroppedGraph, const bool useBlocking, const std::string &distanceLaplacianMetric, Level &level, const Factory &factory)
typename device_type::memory_space memory_space
Xpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > crs_matrix_type
typename local_graph_type::entries_type::non_const_type entries_type
typename Teuchos::ScalarTraits< Scalar >::magnitudeType magnitudeType
Kokkos::View< DecisionType *, memory_space > results_view
typename Node::device_type device_type
static void runDroppingFunctors_on_dlap_inner(matrix_type &A, results_view &results, rowptr_type &filtered_rowptr, LocalOrdinal &nnz_filtered, boundary_nodes_type &boundaryNodes, const std::string &droppingMethod, const magnitudeType threshold, const bool aggregationMayCreateDirichlet, const bool symmetrizeDroppedGraph, const bool useBlocking, DistanceFunctorType &dist2, Level &level, const Factory &factory)
typename local_graph_type::row_map_type::non_const_type rowptr_type
auto make_dlap_comparison_functor(Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A_, DistanceFunctorType &dist2_, typename ScaledDistanceLaplacianComparison< Scalar, LocalOrdinal, GlobalOrdinal, Node, DistanceFunctorType, measure >::results_view &results_)
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_)
Namespace for MueLu classes and methods.