MueLu Version of the Day
Loading...
Searching...
No Matches
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
19#include "MueLu_LWGraph.hpp"
20
21namespace MueLu {
46template <class LocalOrdinal = DefaultLocalOrdinal,
48 class Node = DefaultNode>
49class 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_ */
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
Container class for aggregation information.
Pure virtual base class for all MueLu aggregation algorithms.
Kokkos::View< unsigned *, typename LWGraphHostType::device_type > AggStatHostType
Kokkos::View< unsigned *, typename LWGraphType::device_type > AggStatType
Algorithm for coarsening a graph with uncoupled aggregation.
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
std::string description() const
Return a simple one-line description of this object.
AggregationPhase1Algorithm(const RCP< const FactoryBase > &=Teuchos::null)
Constructor.
void BuildAggregatesNonKokkos(const ParameterList &params, const LWGraph &graph, Aggregates &aggregates, typename AggregationAlgorithmBase< LocalOrdinal, GlobalOrdinal, Node >::AggStatHostType &aggStat, LO &numNonAggregatedNodes) const
Local aggregation.
void BuildAggregatesDeterministic(const LO maxAggSize, const LWGraph_kokkos &graph, Aggregates &aggregates, typename AggregationAlgorithmBase< LocalOrdinal, GlobalOrdinal, Node >::AggStatType &aggStat, LO &numNonAggregatedNodes) const
int RandomOrdinal(int min, int max) const
Generate a random number in the range [min, max].
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.
Lightweight MueLu representation of a compressed row storage graph.
Namespace for MueLu classes and methods.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode