46 #ifndef MUELU_AGGREGATIONPHASE3ALGORITHM_DEF_HPP_ 47 #define MUELU_AGGREGATIONPHASE3ALGORITHM_DEF_HPP_ 49 #include <Teuchos_Comm.hpp> 50 #include <Teuchos_CommHelpers.hpp> 52 #include <Xpetra_Vector.hpp> 56 #include "MueLu_Aggregates.hpp" 65 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
67 Monitor m(*
this,
"BuildAggregates");
70 const int myRank = graph.
GetComm()->getRank();
77 for (LO i = 0; i < numRows; i++) {
85 bool isNewAggregate =
false;
86 for (
int j = 0; j < neighOfINode.
size(); j++) {
87 LO neigh = neighOfINode[j];
90 isNewAggregate =
true;
93 vertex2AggId[neigh] = numLocalAggregates;
94 procWinner [neigh] = myRank;
96 numNonAggregatedNodes--;
100 if (isNewAggregate) {
103 vertex2AggId[i] = numLocalAggregates++;
111 for (; j < neighOfINode.
size(); j++) {
112 LO neigh = neighOfINode[j];
119 if (j < neighOfINode.
size()) {
121 vertex2AggId[i] = vertex2AggId[neighOfINode[j]];
125 this->GetOStream(
Warnings1) <<
"Found singleton: " << i << std::endl;
128 vertex2AggId[i] = numLocalAggregates++;
134 procWinner[i] = myRank;
135 numNonAggregatedNodes--;
Container class for aggregation information.
void BuildAggregates(const ParameterList ¶ms, const GraphBase &graph, Aggregates &aggregates, std::vector< unsigned > &aggStat, LO &numNonAggregatedNodes) const
Local aggregation.
virtual size_t GetNodeNumVertices() const =0
Return number of vertices owned by the calling node.
Namespace for MueLu classes and methods.
void SetIsRoot(LO i, bool value=true)
Set root node information.
const RCP< LOVector > & GetVertex2AggId() const
Returns constant vector that maps local node IDs to local aggregates IDs.
virtual bool isLocalNeighborVertex(LocalOrdinal v) const =0
Return true if vertex with local id 'v' is on current process.
virtual const RCP< const Teuchos::Comm< int > > GetComm() const =0
MueLu representation of a graph.
Timer to be used in non-factories.
LO GetNumAggregates() const
returns the number of aggregates of the current processor. Note: could/should be renamed to GetNumLoc...
const RCP< LOVector > & GetProcWinner() const
Returns constant vector that maps local node IDs to owning processor IDs.
virtual Teuchos::ArrayView< const LocalOrdinal > getNeighborVertices(LocalOrdinal v) const =0
Return the list of vertices adjacent to the vertex 'v'.
void SetNumAggregates(LO nAggregates)
Set number of local aggregates on current processor.