Go to the documentation of this file.
53 #ifndef MUELU_ONEPTAGGREGATIONALGORITHM_DEF_HPP_
54 #define MUELU_ONEPTAGGREGATIONALGORITHM_DEF_HPP_
56 #include <Teuchos_Comm.hpp>
57 #include <Teuchos_CommHelpers.hpp>
59 #include <Xpetra_Vector.hpp>
61 #include "MueLu_OnePtAggregationAlgorithm.hpp"
65 #include "MueLu_Aggregates.hpp"
71 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
76 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
78 Monitor m(*
this,
"BuildAggregates");
81 const int myRank = graph.
GetComm()->getRank();
84 Teuchos::ArrayRCP<LocalOrdinal> vertex2AggId = aggregates.
GetVertex2AggId()->getDataNonConst(0);
85 Teuchos::ArrayRCP<LocalOrdinal> procWinner = aggregates.
GetProcWinner()->getDataNonConst(0);
89 LocalOrdinal iNode1 = 0;
92 while (iNode1 < nRows) {
94 if (aggStat[iNode1] ==
ONEPT) {
97 std::vector<int> aggList;
98 aggList.push_back(iNode1);
99 int aggIndex = nLocalAggregates++;
101 for (
size_t k = 0; k < aggList.size(); k++) {
103 vertex2AggId[aggList[k]] = aggIndex;
104 procWinner[aggList[k]] = myRank;
106 numNonAggregatedNodes -= aggList.size();
const RCP< LOVector > & GetProcWinner() const
Returns constant vector that maps local node IDs to owning processor IDs.
virtual const RCP< const Teuchos::Comm< int > > GetComm() const =0
virtual size_t GetNodeNumVertices() const =0
Return number of vertices owned by the calling node.
void SetIsRoot(LO i, bool value=true)
Set root node information.
Namespace for MueLu classes and methods.
MueLu representation of a graph.
const RCP< LOMultiVector > & GetVertex2AggId() const
Returns constant vector that maps local node IDs to local aggregates IDs.
Container class for aggregation information.
LO GetNumAggregates() const
returns the number of aggregates of the current processor. Note: could/should be renamed to GetNumLoc...
Timer to be used in non-factories.
OnePtAggregationAlgorithm(RCP< const FactoryBase > const &graphFact=Teuchos::null)
Constructor.
void SetNumAggregates(LO nAggregates)
Set number of local aggregates on current processor.
void BuildAggregates(Teuchos::ParameterList const ¶ms, GraphBase const &graph, Aggregates &aggregates, std::vector< unsigned > &aggStat, LO &numNonAggregatedNodes) const
Local aggregation.