28 const std::string& droppingMethod,
30 const bool aggregationMayCreateDirichlet,
31 const bool symmetrizeDroppedGraph,
32 const bool useBlocking,
33 const std::string& distanceLaplacianMetric,
34 Teuchos::Array<double>& dlap_weights,
38 using doubleMultiVector = Xpetra::MultiVector<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>;
39 auto coords = level.template Get<Teuchos::RCP<doubleMultiVector>>(
"Coordinates", factory.
GetFactory(
"Coordinates").get());
40 if (distanceLaplacianMetric ==
"unweighted") {
42 runDroppingFunctors_on_dlap_inner(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, boundaryNodes, droppingMethod, threshold, aggregationMayCreateDirichlet, symmetrizeDroppedGraph, useBlocking, dist2, level, factory);
43 }
else if (distanceLaplacianMetric ==
"weighted") {
44 auto k_dlap_weights_host = Kokkos::View<double*, Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged>>(&dlap_weights[0], dlap_weights.size());
45 auto k_dlap_weights = Kokkos::View<double*>(
"dlap_weights", k_dlap_weights_host.extent(0));
46 Kokkos::deep_copy(k_dlap_weights, k_dlap_weights_host);
48 runDroppingFunctors_on_dlap_inner(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, boundaryNodes, droppingMethod, threshold, aggregationMayCreateDirichlet, symmetrizeDroppedGraph, useBlocking, dist2, level, factory);
49 }
else if (distanceLaplacianMetric ==
"block weighted") {
50 auto k_dlap_weights_host = Kokkos::View<double*, Kokkos::HostSpace, Kokkos::MemoryTraits<Kokkos::Unmanaged>>(&dlap_weights[0], dlap_weights.size());
51 auto k_dlap_weights = Kokkos::View<double*>(
"dlap_weights", k_dlap_weights_host.extent(0));
52 Kokkos::deep_copy(k_dlap_weights, k_dlap_weights_host);
54 runDroppingFunctors_on_dlap_inner(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, boundaryNodes, droppingMethod, threshold, aggregationMayCreateDirichlet, symmetrizeDroppedGraph, useBlocking, dist2, level, factory);
55 }
else if (distanceLaplacianMetric ==
"material") {
56 auto material = level.template Get<Teuchos::RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>>(
"Material", factory.
GetFactory(
"Material").get());
59 auto spatialDim = coords->getNumVectors();
60 if (material->getNumVectors() == 1) {
61 factory.
GetOStream(
Runtime0) <<
"material scalar mean = " << material->getVector(0)->meanValue() << std::endl;
63 TEUCHOS_TEST_FOR_EXCEPTION(spatialDim * spatialDim != material->getNumVectors(),
Exceptions::RuntimeError,
"Need \"Material\" to have spatialDim^2 vectors.");
65 Teuchos::Array<Scalar> means(material->getNumVectors());
66 material->meanValue(means());
68 ss <<
"material tensor mean =" << std::endl;
70 for (
size_t i = 0; i < spatialDim; ++i) {
72 for (
size_t j = 0; j < spatialDim; ++j) {
73 ss << means[k] <<
" ";
83 if (material->getNumVectors() == 1) {
85 runDroppingFunctors_on_dlap_inner(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, boundaryNodes, droppingMethod, threshold, aggregationMayCreateDirichlet, symmetrizeDroppedGraph, useBlocking, dist2, level, factory);
88 runDroppingFunctors_on_dlap_inner(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, boundaryNodes, droppingMethod, threshold, aggregationMayCreateDirichlet, symmetrizeDroppedGraph, useBlocking, dist2, level, factory);
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)