10 #ifndef MUELU_VECTORDROPPINGDISTANCELAPLACIAN_DECL_HPP
11 #define MUELU_VECTORDROPPINGDISTANCELAPLACIAN_DECL_HPP
20 #include "MueLu_Utilities.hpp"
24 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node, Misc::StrengthMeasure SoC>
32 using rowptr_type =
typename local_graph_type::row_map_type::non_const_type;
42 template <
class DistanceFunctorType>
45 typename matrix_type::local_ordinal_type blkPartSize,
53 const std::string& droppingMethod,
55 const bool aggregationMayCreateDirichlet,
56 const bool symmetrizeDroppedGraph,
57 const bool useBlocking,
58 DistanceFunctorType& dist2,
61 auto lclA = A.getLocalMatrixDevice();
65 if (droppingMethod ==
"point-wise") {
66 auto dist_laplacian_dropping = DistanceLaplacian::make_vector_drop_functor<SoC>(A, mergedA, threshold, dist2, results, rowTranslation, colTranslation);
68 if (aggregationMayCreateDirichlet) {
69 if (symmetrizeDroppedGraph) {
71 VectorDroppingDistanceLaplacian::runDroppingFunctors(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, useBlocking, level, factory,
72 dist_laplacian_dropping,
75 mark_singletons_as_boundary);
78 VectorDroppingDistanceLaplacian::runDroppingFunctors(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, useBlocking, level, factory,
79 dist_laplacian_dropping,
82 mark_singletons_as_boundary);
85 if (symmetrizeDroppedGraph) {
87 VectorDroppingDistanceLaplacian::runDroppingFunctors(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, useBlocking, level, factory,
88 dist_laplacian_dropping,
93 VectorDroppingDistanceLaplacian::runDroppingFunctors(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, useBlocking, level, factory,
94 dist_laplacian_dropping,
99 }
else if (droppingMethod ==
"cut-drop") {
100 auto comparison = CutDrop::make_dlap_comparison_functor<SoC>(A, dist2, results);
103 if (symmetrizeDroppedGraph) {
105 VectorDroppingDistanceLaplacian::runDroppingFunctors(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, useBlocking, level, factory,
111 VectorDroppingDistanceLaplacian::runDroppingFunctors(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, useBlocking, level, factory,
129 const std::string& droppingMethod,
131 const bool aggregationMayCreateDirichlet,
132 const bool symmetrizeDroppedGraph,
133 const bool useBlocking,
134 const std::string& distanceLaplacianMetric,
MueLu::DefaultLocalOrdinal LocalOrdinal
static void runDroppingFunctors_on_dlap_inner(matrix_type &A, matrix_type &mergedA, typename matrix_type::local_ordinal_type blkPartSize, block_indices_view_type &rowTranslation, block_indices_view_type &colTranslation, results_view &results, rowptr_type &filtered_rowptr, rowptr_type &graph_rowptr, nnz_count_type &nnz, 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 device_type::memory_space memory_space
Functor that drops boundary nodes for a blockSize > 1 problem.
typename Teuchos::ScalarTraits< Scalar >::magnitudeType magnitudeType
Functor that marks singletons (all off-diagonal entries in a row are dropped) as boundary.
Kokkos::View< DecisionType *, memory_space > results_view
typename Node::device_type device_type
typename GraphType::local_graph_type local_graph_type
Kokkos::View< DecisionType *, memory_space > results_view
Kokkos::View< bool *, memory_space > boundary_nodes_type
Class that holds all level-specific information.
typename local_graph_type::row_map_type::non_const_type rowptr_type
typename local_graph_type::row_map_type::non_const_type rowptr_type
Kokkos::pair< LocalOrdinal, LocalOrdinal > nnz_count_type
Order each row by a criterion, compare the ratio of values and drop all entries once the ratio is bel...
static void runDroppingFunctors_on_dlap(matrix_type &A, matrix_type &mergedA, LocalOrdinal blkPartSize, block_indices_view_type &rowTranslation, block_indices_view_type &colTranslation, results_view &results, rowptr_type &filtered_rowptr, rowptr_type &graph_rowptr, nnz_count_type &nnz, boundary_nodes_type &boundaryNodes, const std::string &droppingMethod, const magnitudeType threshold, const bool aggregationMayCreateDirichlet, const bool symmetrizeDroppedGraph, const bool useBlocking, const std::string &distanceLaplacianMetric, Teuchos::Array< double > &dlap_weights, LocalOrdinal interleaved_blocksize, Level &level, const Factory &factory)
Functor that marks diagonal as kept, unless the are already marked as boundary.
static void runDroppingFunctors(matrix_type &A, matrix_type &mergedA, typename matrix_type::local_ordinal_type &blkPartSize, block_indices_view_type &rowTranslation, block_indices_view_type &colTranslation, results_view &results, rowptr_type &filtered_rowptr, rowptr_type &graph_rowptr, nnz_count_type &nnz, const bool useBlocking, Level &level, const Factory &factory, Functors &...functors)
typename crs_matrix_type::local_matrix_type local_matrix_type
Functor that drops boundary nodes for a blockSize > 1 problem.
typename Kokkos::View< LocalOrdinal *, typename Node::device_type > block_indices_view_type
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > matrix_type
Kokkos::pair< LocalOrdinal, LocalOrdinal > nnz_count_type
typename Kokkos::View< LocalOrdinal *, typename Node::device_type > block_indices_view_type
typename MueLu::LWGraph_kokkos< LocalOrdinal, GlobalOrdinal, Node >::boundary_nodes_type boundary_nodes_type