MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu_UncoupledAggregationFactory_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_UNCOUPLEDAGGREGATIONFACTORY_DECL_HPP_
11#define MUELU_UNCOUPLEDAGGREGATIONFACTORY_DECL_HPP_
12
13#include <Xpetra_Map_fwd.hpp>
14#include <Xpetra_Vector_fwd.hpp>
15
16#include "MueLu_ConfigDefs.hpp"
19
24
29
30#include "MueLu_Level_fwd.hpp"
31
32#include "MueLu_LWGraph_fwd.hpp"
34#include "MueLu_Exceptions.hpp"
35
36namespace MueLu {
37
101template <class LocalOrdinal = DefaultLocalOrdinal,
103 class Node = DefaultNode>
105#undef MUELU_UNCOUPLEDAGGREGATIONFACTORY_SHORT
107
108 public:
110
111
114
117
118 RCP<const ParameterList> GetValidParameterList() const;
119
120 void DoGraphColoring(Level& currentLevel,
121 const std::string& aggAlgo,
122 const bool deterministic,
123 const RCP<const LWGraph_kokkos> graph,
124 RCP<Aggregates> aggregates) const;
125
127
129
130
131 // Options shared by all aggregation algorithms
132
133 // deprecated
134 void SetOrdering(const std::string& ordering) {
135 SetParameter("aggregation: ordering", ParameterEntry(ordering));
136 }
137 // deprecated
138 void SetMaxNeighAlreadySelected(int maxNeighAlreadySelected) {
139 SetParameter("aggregation: max selected neighbors", ParameterEntry(Teuchos::as<LocalOrdinal>(maxNeighAlreadySelected))); // revalidate
140 }
141 // deprecated
142 void SetMinNodesPerAggregate(int minNodesPerAggregate) {
143 SetParameter("aggregation: min agg size", ParameterEntry(Teuchos::as<LocalOrdinal>(minNodesPerAggregate))); // revalidate
144 }
145 // set information about 1-node aggregates (map name and generating factory)
146 void SetOnePtMapName(const std::string name, Teuchos::RCP<const FactoryBase> mapFact) {
147 SetParameter("OnePt aggregate map name", ParameterEntry(std::string(name))); // revalidate
148 SetFactory("OnePt aggregate map factory", mapFact);
149 }
150
151 // deprecated
152 const std::string& GetOrdering() const {
153 const ParameterList& pL = GetParameterList();
154 return pL.get<std::string>("aggregation: ordering");
155 }
156 // deprecated
158 const ParameterList& pL = GetParameterList();
159 return Teuchos::as<int>(pL.get<LocalOrdinal>("aggregation: max selected neighbors"));
160 }
161 // deprecated
163 const ParameterList& pL = GetParameterList();
164 return Teuchos::as<int>(pL.get<LocalOrdinal>("aggregation: min agg size"));
165 }
166
168
170
171
172 void DeclareInput(Level& currentLevel) const;
173
175
177
178
180 void Build(Level& currentLevel) const;
181
183
185
186
188 // void Append(const RCP<MueLu::AggregationAlgorithmBase<LocalOrdinal, GlobalOrdinal, Node> > & alg);
189
191 // void ClearAggregationAlgorithms() { algos_.clear(); }
193
194 private:
196 // will be filled in Build routine
197 mutable std::vector<RCP<MueLu::AggregationAlgorithmBase<LocalOrdinal, GlobalOrdinal, Node> > > algos_;
198
202 mutable bool bDefinitionPhase_;
203
204}; // class UncoupledAggregationFactory
205
206} // namespace MueLu
207
208#define MUELU_UNCOUPLEDAGGREGATIONFACTORY_SHORT
209#endif /* MUELU_UNCOUPLEDAGGREGATIONFACTORY_DECL_HPP_ */
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
virtual void SetFactory(const std::string &varName, const RCP< const FactoryBase > &factory)
Configuration.
Class that holds all level-specific information.
virtual const Teuchos::ParameterList & GetParameterList() const
void SetParameter(const std::string &name, const ParameterEntry &entry)
Set a parameter directly as a ParameterEntry.
Base class for factories that use one level (currentLevel).
void SetOnePtMapName(const std::string name, Teuchos::RCP< const FactoryBase > mapFact)
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
void Build(Level &currentLevel) const
Build aggregates.
virtual ~UncoupledAggregationFactory()
Destructor.
void DoGraphColoring(Level &currentLevel, const std::string &aggAlgo, const bool deterministic, const RCP< const LWGraph_kokkos > graph, RCP< Aggregates > aggregates) const
std::vector< RCP< MueLu::AggregationAlgorithmBase< LocalOrdinal, GlobalOrdinal, Node > > > algos_
Append a new aggregation algorithm to list of aggregation algorithms.
Namespace for MueLu classes and methods.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode