MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_AggregationPhase1Algorithm_decl.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // MueLu: A package for multigrid based preconditioning
4 //
5 // Copyright 2012 NTESS and the MueLu contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef MUELU_AGGREGATIONPHASE1ALGORITHM_DECL_HPP_
11 #define MUELU_AGGREGATIONPHASE1ALGORITHM_DECL_HPP_
12 
13 #include "MueLu_ConfigDefs.hpp"
16 
18 #include "MueLu_Aggregates_fwd.hpp"
19 #include "MueLu_LWGraph.hpp"
20 
21 namespace MueLu {
46 template <class LocalOrdinal = DefaultLocalOrdinal,
48  class Node = DefaultNode>
49 class AggregationPhase1Algorithm : public MueLu::AggregationAlgorithmBase<LocalOrdinal, GlobalOrdinal, Node> {
50 #undef MUELU_AGGREGATIONPHASE1ALGORITHM_SHORT
52 
53  public:
55 
56 
58  AggregationPhase1Algorithm(const RCP<const FactoryBase>& /* graphFact */ = Teuchos::null) {}
59 
62 
64 
66 
67 
70  void BuildAggregatesNonKokkos(const ParameterList& params, const LWGraph& graph, Aggregates& aggregates, typename AggregationAlgorithmBase<LocalOrdinal, GlobalOrdinal, Node>::AggStatHostType& aggStat, LO& numNonAggregatedNodes) const;
71 
72  void BuildAggregates(const Teuchos::ParameterList& params,
73  const LWGraph_kokkos& graph,
74  Aggregates& aggregates,
76  LO& numNonAggregatedNodes) const;
77 
78  void BuildAggregatesRandom(const LO maxAggSize,
79  const LWGraph_kokkos& graph,
80  Aggregates& aggregates,
82  LO& numNonAggregatedNodes) const;
83 
84  void BuildAggregatesDeterministic(const LO maxAggSize,
85  const LWGraph_kokkos& graph,
86  Aggregates& aggregates,
88  LO& numNonAggregatedNodes) const;
90 
91  std::string description() const { return "Phase 1 (main)"; }
92 
93  private:
98  void RandomReorder(ArrayRCP<LO> list) const;
99 
101  int RandomOrdinal(int min, int max) const;
102 };
103 
104 } // namespace MueLu
105 
106 #define MUELU_AGGREGATIONPHASE1ALGORITHM_SHORT
107 #endif /* MUELU_AGGREGATIONPHASE1ALGORITHM_DECL_HPP_ */
Kokkos::View< unsigned *, typename LWGraphHostType::device_type > AggStatHostType
MueLu::DefaultLocalOrdinal LocalOrdinal
void BuildAggregatesRandom(const LO maxAggSize, const LWGraph_kokkos &graph, Aggregates &aggregates, typename AggregationAlgorithmBase< LocalOrdinal, GlobalOrdinal, Node >::AggStatType &aggStat, LO &numNonAggregatedNodes) const
Lightweight MueLu representation of a compressed row storage graph.
void BuildAggregatesNonKokkos(const ParameterList &params, const LWGraph &graph, Aggregates &aggregates, typename AggregationAlgorithmBase< LocalOrdinal, GlobalOrdinal, Node >::AggStatHostType &aggStat, LO &numNonAggregatedNodes) const
Local aggregation.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
Container class for aggregation information.
Pure virtual base class for all MueLu aggregation algorithms.
LocalOrdinal LO
std::string description() const
Return a simple one-line description of this object.
MueLu::DefaultNode Node
MueLu::DefaultGlobalOrdinal GlobalOrdinal
void BuildAggregatesDeterministic(const LO maxAggSize, const LWGraph_kokkos &graph, Aggregates &aggregates, typename AggregationAlgorithmBase< LocalOrdinal, GlobalOrdinal, Node >::AggStatType &aggStat, LO &numNonAggregatedNodes) const
void RandomReorder(ArrayRCP< LO > list) const
Utility to take a list of integers and reorder them randomly (by using a local permutation).
void BuildAggregates(const Teuchos::ParameterList &params, const LWGraph_kokkos &graph, Aggregates &aggregates, typename AggregationAlgorithmBase< LocalOrdinal, GlobalOrdinal, Node >::AggStatType &aggStat, LO &numNonAggregatedNodes) const
Lightweight MueLu representation of a compressed row storage graph.
Algorithm for coarsening a graph with uncoupled aggregation.
int RandomOrdinal(int min, int max) const
Generate a random number in the range [min, max].
Kokkos::View< unsigned *, typename LWGraphType::device_type > AggStatType
AggregationPhase1Algorithm(const RCP< const FactoryBase > &=Teuchos::null)
Constructor.