46 #ifndef MUELU_PRESERVEDIRICHLETAGGREGATIONALGORITHM_KOKKOS_DEF_HPP
47 #define MUELU_PRESERVEDIRICHLETAGGREGATIONALGORITHM_KOKKOS_DEF_HPP
49 #ifdef HAVE_MUELU_KOKKOS_REFACTOR
51 #include <Teuchos_Comm.hpp>
52 #include <Teuchos_CommHelpers.hpp>
56 #include "MueLu_PreserveDirichletAggregationAlgorithm_kokkos.hpp"
58 #include "MueLu_LWGraph_kokkos.hpp"
59 #include "MueLu_Aggregates_kokkos.hpp"
65 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
66 void PreserveDirichletAggregationAlgorithm_kokkos<LocalOrdinal, GlobalOrdinal, Node>::BuildAggregates(
Teuchos::ParameterList const & params, LWGraph_kokkos
const & graph, Aggregates_kokkos & aggregates, std::vector<unsigned>& aggStat,
LO& numNonAggregatedNodes)
const {
67 Monitor m(*
this,
"BuildAggregates");
69 bool preserve = params.
get<
bool>(
"aggregation: preserve Dirichlet points");
71 const LO numRows = graph.GetNodeNumVertices();
72 const int myRank = graph.GetComm()->getRank();
74 ArrayRCP<LO> vertex2AggId = aggregates.GetVertex2AggId()->getDataNonConst(0);
75 ArrayRCP<LO> procWinner = aggregates.GetProcWinner() ->getDataNonConst(0);
77 LO numLocalAggregates = aggregates.GetNumAggregates();
79 for (
LO i = 0; i < numRows; i++)
82 numNonAggregatedNodes--;
85 aggregates.SetIsRoot(i);
87 vertex2AggId[i] = numLocalAggregates++;
88 procWinner [i] = myRank;
93 aggregates.SetNumAggregates(numLocalAggregates);
98 #endif // HAVE_MUELU_KOKKOS_REFACTOR
99 #endif // MUELU_PRESERVEDIRICHLETAGGREGATIONALGORITHM_KOKKOS_DEF_HPP
T & get(const std::string &name, T def_value)