10 #ifndef MUELU_SCALARDROPPINGDISTANCELAPLACIAN_DEF_HPP
11 #define MUELU_SCALARDROPPINGDISTANCELAPLACIAN_DEF_HPP
16 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node, Misc::StrengthMeasure SoC>
22 const std::string& droppingMethod,
24 const bool aggregationMayCreateDirichlet,
25 const bool symmetrizeDroppedGraph,
26 const bool useBlocking,
27 const std::string& distanceLaplacianMetric,
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;
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);
74 #define MUELU_ETI_GROUP(SC, LO, GO, NO) \
75 MUELU_ETI_SLGN_SoC(MueLu::ScalarDroppingDistanceLaplacian, SC, LO, GO, NO)
MueLu::DefaultLocalOrdinal LocalOrdinal
Teuchos::FancyOStream & GetOStream(MsgType type, int thisProcRankOnly=0) const
Get an output stream for outputting the input message type.
typename Teuchos::ScalarTraits< Scalar >::magnitudeType magnitudeType
Kokkos::View< DecisionType *, memory_space > results_view
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
One-liner description of what is happening.
typename MueLu::LWGraph_kokkos< LocalOrdinal, GlobalOrdinal, Node >::boundary_nodes_type boundary_nodes_type
Class that holds all level-specific information.
bool IsPrint(MsgType type, int thisProcRankOnly=-1) const
Find out whether we need to print out information for a specific message 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)
Computes the unscaled distance Laplacian.
typename local_graph_type::row_map_type::non_const_type rowptr_type
Exception throws to report errors in the internal logical of the program.
const RCP< const FactoryBase > GetFactory(const std::string &varName) const
Default implementation of FactoryAcceptor::GetFactory()