22 const std::string& droppingMethod,
24 const bool aggregationMayCreateDirichlet,
25 const bool symmetrizeDroppedGraph,
26 const bool useBlocking,
27 const std::string& distanceLaplacianMetric,
30 using doubleMultiVector = Xpetra::MultiVector<magnitudeType, LocalOrdinal, GlobalOrdinal, Node>;
31 auto coords = level.template Get<Teuchos::RCP<doubleMultiVector>>(
"Coordinates", factory.
GetFactory(
"Coordinates").get());
32 if (distanceLaplacianMetric ==
"unweighted") {
34 runDroppingFunctors_on_dlap_inner(A, results, filtered_rowptr, nnz_filtered, boundaryNodes, droppingMethod, threshold, aggregationMayCreateDirichlet, symmetrizeDroppedGraph, useBlocking, dist2, level, factory);
35 }
else if (distanceLaplacianMetric ==
"material") {
36 auto material = level.template Get<Teuchos::RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>>(
"Material", factory.
GetFactory(
"Material").get());
39 auto spatialDim = coords->getNumVectors();
40 if (material->getNumVectors() == 1) {
41 factory.
GetOStream(
Runtime0) <<
"material scalar mean = " << material->getVector(0)->meanValue() << std::endl;
43 TEUCHOS_TEST_FOR_EXCEPTION(spatialDim * spatialDim != material->getNumVectors(),
Exceptions::RuntimeError,
"Need \"Material\" to have spatialDim^2 vectors.");
45 Teuchos::Array<Scalar> means(material->getNumVectors());
46 material->meanValue(means());
48 ss <<
"material tensor mean =" << std::endl;
50 for (
size_t i = 0; i < spatialDim; ++i) {
52 for (
size_t j = 0; j < spatialDim; ++j) {
53 ss << means[k] <<
" ";
63 if (material->getNumVectors() == 1) {
65 runDroppingFunctors_on_dlap_inner(A, results, filtered_rowptr, nnz_filtered, boundaryNodes, droppingMethod, threshold, aggregationMayCreateDirichlet, symmetrizeDroppedGraph, useBlocking, dist2, level, factory);
68 runDroppingFunctors_on_dlap_inner(A, results, filtered_rowptr, nnz_filtered, boundaryNodes, droppingMethod, threshold, aggregationMayCreateDirichlet, symmetrizeDroppedGraph, useBlocking, dist2, level, factory);
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)