MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_AggregationPhase2aAlgorithm_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_AGGREGATIONPHASE2AALGORITHM_DECL_HPP_
11 #define MUELU_AGGREGATIONPHASE2AALGORITHM_DECL_HPP_
12 
13 #include "MueLu_ConfigDefs.hpp"
15 
17 
19 #include "MueLu_Aggregates_fwd.hpp"
20 #include "MueLu_LWGraph.hpp"
21 
22 namespace MueLu {
45 template <class LocalOrdinal = DefaultLocalOrdinal,
47  class Node = DefaultNode>
48 class AggregationPhase2aAlgorithm : public MueLu::AggregationAlgorithmBase<LocalOrdinal, GlobalOrdinal, Node> {
49 #undef MUELU_AGGREGATIONPHASE2AALGORITHM_SHORT
51 
52  public:
54 
55 
57  AggregationPhase2aAlgorithm(const RCP<const FactoryBase>& /* graphFact */ = Teuchos::null) {}
58 
61 
63 
65 
66 
69  void SetupPhase(const ParameterList& params, Teuchos::RCP<const Teuchos::Comm<int>>& comm, LO& numLocalNodes, LO& numNonAggregatedNodes) override;
70 
71  void BuildAggregatesNonKokkos(const ParameterList& params, const LWGraph& graph, Aggregates& aggregates, typename AggregationAlgorithmBase<LocalOrdinal, GlobalOrdinal, Node>::AggStatHostType& aggStat, LO& numNonAggregatedNodes) const override;
72 
73  void BuildAggregates(const Teuchos::ParameterList& params,
74  const LWGraph_kokkos& graph,
75  Aggregates& aggregates,
77  LO& numNonAggregatedNodes) const override;
78 
80  const LWGraph_kokkos& graph,
81  Aggregates& aggregates,
83  LO& numNonAggregatedNodes) const;
84 
86  const LWGraph_kokkos& graph,
87  Aggregates& aggregates,
89  LO& numNonAggregatedNodes) const;
91 
92  std::string description() const override { return "Phase 2a (secondary)"; }
93 
94  private:
96 };
97 
98 } // namespace MueLu
99 
100 #define MUELU_AGGREGATIONPHASE2AALGORITHM_SHORT
101 
102 #endif /* MUELU_AGGREGATIONPHASE2AALGORITHM_DECL_HPP_ */
Kokkos::View< unsigned *, typename LWGraphHostType::device_type > AggStatHostType
MueLu::DefaultLocalOrdinal LocalOrdinal
void BuildAggregatesRandom(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.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
Container class for aggregation information.
Pure virtual base class for all MueLu aggregation algorithms.
LocalOrdinal LO
MueLu::DefaultNode Node
void SetupPhase(const ParameterList &params, Teuchos::RCP< const Teuchos::Comm< int >> &comm, LO &numLocalNodes, LO &numNonAggregatedNodes) override
Local aggregation.
MueLu::DefaultGlobalOrdinal GlobalOrdinal
AggregationPhase2aAlgorithm(const RCP< const FactoryBase > &=Teuchos::null)
Constructor.
void BuildAggregates(const Teuchos::ParameterList &params, const LWGraph_kokkos &graph, Aggregates &aggregates, typename AggregationAlgorithmBase< LocalOrdinal, GlobalOrdinal, Node >::AggStatType &aggStat, LO &numNonAggregatedNodes) const override
void BuildAggregatesNonKokkos(const ParameterList &params, const LWGraph &graph, Aggregates &aggregates, typename AggregationAlgorithmBase< LocalOrdinal, GlobalOrdinal, Node >::AggStatHostType &aggStat, LO &numNonAggregatedNodes) const override
Among unaggregated points, see if we can make a reasonable size aggregate out of it.IdeaAmong unaggregated points, see if we can make a reasonable size aggregate out of it. We do this by looking at neighbors and seeing how many are unaggregated and on my processor. Loosely, base the number of new aggregates created on the percentage of unaggregated nodes.
void BuildAggregatesDeterministic(const Teuchos::ParameterList &params, const LWGraph_kokkos &graph, Aggregates &aggregates, typename AggregationAlgorithmBase< LocalOrdinal, GlobalOrdinal, Node >::AggStatType &aggStat, LO &numNonAggregatedNodes) const
std::string description() const override
Return a simple one-line description of this object.
Lightweight MueLu representation of a compressed row storage graph.
Kokkos::View< unsigned *, typename LWGraphType::device_type > AggStatType