MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_HybridAggregationFactory_def.hpp
Go to the documentation of this file.
1 // @HEADER
2 //
3 // ***********************************************************************
4 //
5 // MueLu: A package for multigrid based preconditioning
6 // Copyright 2012 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact
39 // Jonathan Hu (jhu@sandia.gov)
40 // Andrey Prokopenko (aprokop@sandia.gov)
41 // Ray Tuminaro (rstumin@sandia.gov)
42 //
43 // ***********************************************************************
44 //
45 // @HEADER
46 #ifndef MUELU_HYBRIDAGGREGATIONFACTORY_DEF_HPP_
47 #define MUELU_HYBRIDAGGREGATIONFACTORY_DEF_HPP_
48 
49 #include <Xpetra_Matrix.hpp>
50 #include <Xpetra_Map.hpp>
51 #include <Xpetra_Vector.hpp>
53 #include <Xpetra_VectorFactory.hpp>
54 
56 
57 // Uncoupled Agg
58 #include "MueLu_InterfaceAggregationAlgorithm.hpp"
59 #include "MueLu_OnePtAggregationAlgorithm.hpp"
60 #include "MueLu_PreserveDirichletAggregationAlgorithm.hpp"
61 #include "MueLu_IsolatedNodeAggregationAlgorithm.hpp"
62 
63 #include "MueLu_AggregationPhase1Algorithm.hpp"
64 #include "MueLu_AggregationPhase2aAlgorithm.hpp"
65 #include "MueLu_AggregationPhase2bAlgorithm.hpp"
66 #include "MueLu_AggregationPhase3Algorithm.hpp"
67 
68 // Structured Agg
69 #include "MueLu_AggregationStructuredAlgorithm.hpp"
70 #include "MueLu_UncoupledIndexManager.hpp"
71 //#include "MueLu_LocalLexicographicIndexManager.hpp"
72 //#include "MueLu_GlobalLexicographicIndexManager.hpp"
73 
74 // Shared
75 #include "MueLu_Level.hpp"
76 #include "MueLu_GraphBase.hpp"
77 #include "MueLu_Aggregates.hpp"
78 #include "MueLu_MasterList.hpp"
79 #include "MueLu_Monitor.hpp"
80 #include "MueLu_Utilities.hpp"
81 #include "MueLu_AmalgamationInfo.hpp"
82 
83 
84 namespace MueLu {
85 
86  template <class LocalOrdinal, class GlobalOrdinal, class Node>
88  HybridAggregationFactory() : bDefinitionPhase_(true)
89  { }
90 
91  template <class LocalOrdinal, class GlobalOrdinal, class Node>
94  RCP<ParameterList> validParamList = rcp(new ParameterList());
95 
97 #define SET_VALID_ENTRY(name) validParamList->setEntry(name, MasterList::getEntry(name))
98  // From UncoupledAggregationFactory
99  SET_VALID_ENTRY("aggregation: max agg size");
100  SET_VALID_ENTRY("aggregation: min agg size");
101  SET_VALID_ENTRY("aggregation: max selected neighbors");
102  SET_VALID_ENTRY("aggregation: ordering");
103  validParamList->getEntry("aggregation: ordering").setValidator(
104  rcp(new validatorType(Teuchos::tuple<std::string>("natural", "graph", "random"), "aggregation: ordering")));
105  SET_VALID_ENTRY("aggregation: enable phase 1");
106  SET_VALID_ENTRY("aggregation: enable phase 2a");
107  SET_VALID_ENTRY("aggregation: enable phase 2b");
108  SET_VALID_ENTRY("aggregation: enable phase 3");
109  SET_VALID_ENTRY("aggregation: preserve Dirichlet points");
110  SET_VALID_ENTRY("aggregation: allow user-specified singletons");
111  SET_VALID_ENTRY("aggregation: use interface aggregation");
112  SET_VALID_ENTRY("aggregation: error on nodes with no on-rank neighbors");
113  SET_VALID_ENTRY("aggregation: phase3 avoid singletons");
114 
115  // From StructuredAggregationFactory
116  SET_VALID_ENTRY("aggregation: mesh layout");
117  SET_VALID_ENTRY("aggregation: mode");
118  SET_VALID_ENTRY("aggregation: output type");
119  SET_VALID_ENTRY("aggregation: coarsening rate");
120  SET_VALID_ENTRY("aggregation: number of spatial dimensions");
121  SET_VALID_ENTRY("aggregation: coarsening order");
122 
123  // From StructuredAggregationFactory
124 #undef SET_VALID_ENTRY
125 
126  /* From UncoupledAggregation */
127  // general variables needed in AggregationFactory
128  validParamList->set< RCP<const FactoryBase> >("Graph", null, "Generating factory of the graph");
129  validParamList->set< RCP<const FactoryBase> >("DofsPerNode", null, "Generating factory for variable \'DofsPerNode\', usually the same as for \'Graph\'");
130  // special variables necessary for OnePtAggregationAlgorithm
131  validParamList->set<std::string> ("OnePt aggregate map name", "",
132  "Name of input map for single node aggregates. (default='')");
133  validParamList->set<std::string> ("OnePt aggregate map factory", "",
134  "Generating factory of (DOF) map for single node aggregates.");
135 
136  // InterfaceAggregation parameters
137  validParamList->set< std::string > ("Interface aggregate map name", "",
138  "Name of input map for interface aggregates. (default='')");
139  validParamList->set< std::string > ("Interface aggregate map factory", "",
140  "Generating factory of (DOF) map for interface aggregates.");
141  validParamList->set<RCP<const FactoryBase> > ("nodeOnInterface", Teuchos::null,
142  "Array specifying whether or not a node is on the interface (1 or 0).");
143 
144  /* From StructuredAggregation */
145  // general variables needed in AggregationFactory
146  validParamList->set<RCP<const FactoryBase> >("aggregation: mesh data", Teuchos::null,
147  "Mesh ordering associated data");
148 
149  validParamList->set<RCP<const FactoryBase> >("gNodesPerDim", Teuchos::null,
150  "Number of nodes per spatial dimmension provided by CoordinatesTransferFactory.");
151  validParamList->set<RCP<const FactoryBase> >("lNodesPerDim", Teuchos::null,
152  "Number of nodes per spatial dimmension provided by CoordinatesTransferFactory.");
153 
154 
155  // Hybrid Aggregation Params
156  validParamList->set<RCP<const FactoryBase> > ("aggregationRegionType", Teuchos::null,
157  "Type of aggregation to use on the region (\"structured\" or \"uncoupled\")");
158 
159  return validParamList;
160  }
161 
162  template <class LocalOrdinal, class GlobalOrdinal, class Node>
164  DeclareInput(Level& currentLevel) const {
165  Input(currentLevel, "Graph");
166 
167  ParameterList pL = GetParameterList();
168 
169  /* Hybrid Aggregation */
170  if(currentLevel.GetLevelID() == 0){
171  if(currentLevel.IsAvailable("aggregationRegionType", NoFactory::get())) {
172  currentLevel.DeclareInput("aggregationRegionType", NoFactory::get(), this);
173  } else {
174  TEUCHOS_TEST_FOR_EXCEPTION(!currentLevel.IsAvailable("aggregationRegionType",NoFactory::get()),
176  "Aggregation region type was not provided by the user!");
177  }
178  } else {
179  Input(currentLevel, "aggregationRegionType");
180  }
181 
182 
183  /* UncoupledAggregation */
184  Input(currentLevel, "DofsPerNode");
185 
186  // request special data necessary for InterfaceAggregation
187  if (pL.get<bool>("aggregation: use interface aggregation") == true){
188  if(currentLevel.GetLevelID() == 0) {
189  if(currentLevel.IsAvailable("nodeOnInterface", NoFactory::get())) {
190  currentLevel.DeclareInput("nodeOnInterface", NoFactory::get(), this);
191  } else {
192  TEUCHOS_TEST_FOR_EXCEPTION(!currentLevel.IsAvailable("nodeOnInterface", NoFactory::get()),
194  "nodeOnInterface was not provided by the user on level0!");
195  }
196  } else {
197  Input(currentLevel, "nodeOnInterface");
198  }
199  }
200 
201  // request special data necessary for OnePtAggregationAlgorithm
202  std::string mapOnePtName = pL.get<std::string>("OnePt aggregate map name");
203  if (mapOnePtName.length() > 0) {
204  std::string mapOnePtFactName = pL.get<std::string>("OnePt aggregate map factory");
205  if (mapOnePtFactName == "" || mapOnePtFactName == "NoFactory") {
206  currentLevel.DeclareInput(mapOnePtName, NoFactory::get());
207  } else {
208  RCP<const FactoryBase> mapOnePtFact = GetFactory(mapOnePtFactName);
209  currentLevel.DeclareInput(mapOnePtName, mapOnePtFact.get());
210  }
211  }
212 
213 
214 
215  /* StructuredAggregation */
216  std::string coupling = pL.get<std::string>("aggregation: mode");
217  const bool coupled = (coupling == "coupled" ? true : false);
218  if(coupled) {
219  // Request the global number of nodes per dimensions
220  if(currentLevel.GetLevelID() == 0) {
221  if(currentLevel.IsAvailable("gNodesPerDim", NoFactory::get())) {
222  currentLevel.DeclareInput("gNodesPerDim", NoFactory::get(), this);
223  } else {
224  TEUCHOS_TEST_FOR_EXCEPTION(!currentLevel.IsAvailable("gNodesPerDim", NoFactory::get()),
226  "gNodesPerDim was not provided by the user on level0!");
227  }
228  } else {
229  Input(currentLevel, "gNodesPerDim");
230  }
231  }
232 
233  // Request the local number of nodes per dimensions
234  if(currentLevel.GetLevelID() == 0) {
235  if(currentLevel.IsAvailable("lNodesPerDim", NoFactory::get())) {
236  currentLevel.DeclareInput("lNodesPerDim", NoFactory::get(), this);
237  } else {
238  TEUCHOS_TEST_FOR_EXCEPTION(!currentLevel.IsAvailable("lNodesPerDim", NoFactory::get()),
240  "lNodesPerDim was not provided by the user on level0!");
241  }
242  } else {
243  Input(currentLevel, "lNodesPerDim");
244  }
245 
246 
247  }
248 
249  template <class LocalOrdinal, class GlobalOrdinal, class Node>
251  Build(Level &currentLevel) const {
252  FactoryMonitor m(*this, "Build", currentLevel);
253 
255  if(const char* dbg = std::getenv("MUELU_HYBRIDAGGREGATION_DEBUG")) {
256  out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
257  } else {
258  out = Teuchos::getFancyOStream(rcp(new Teuchos::oblackholestream()));
259  }
260  out->setShowAllFrontMatter(false).setShowProcRank(true);
261 
262  *out << "Entering hybrid aggregation" << std::endl;
263 
264  ParameterList pL = GetParameterList();
265  bDefinitionPhase_ = false; // definition phase is finished, now all aggregation algorithm information is fixed
266 
267  if (pL.get<int>("aggregation: max agg size") == -1)
268  pL.set("aggregation: max agg size", INT_MAX);
269 
270  // define aggregation algorithms
271  RCP<const FactoryBase> graphFact = GetFactory("Graph");
272 
273  // General problem informations are gathered from data stored in the problem matix.
274  RCP<const GraphBase> graph = Get< RCP<GraphBase> >(currentLevel, "Graph");
275  RCP<const Map> fineMap = graph->GetDomainMap();
276  const int myRank = fineMap->getComm()->getRank();
277  const int numRanks = fineMap->getComm()->getSize();
278 
279  // Build aggregates
280  RCP<Aggregates> aggregates = rcp(new Aggregates(*graph));
281  aggregates->setObjectLabel("HB");
282 
283  // construct aggStat information
284  const LO numRows = graph->GetNodeNumVertices();
285  std::vector<unsigned> aggStat(numRows, READY);
286 
287  // Get aggregation type for region
288  std::string regionType;
289  if(currentLevel.GetLevelID() == 0) {
290  // On level 0, data is provided by applications and has no associated factory.
291  regionType = currentLevel.Get< std::string >("aggregationRegionType", NoFactory::get());
292  } else {
293  // On level > 0, data is provided directly by generating factories.
294  regionType = Get< std::string >(currentLevel, "aggregationRegionType");
295  }
296  *out<<"p="<< myRank << " | "<<regionType<<" | regionType determined" << std::endl;
297 
298  algos_.clear();
299  if (regionType == "structured") {
300  // Add AggregationStructuredAlgorithm
301  algos_.push_back(rcp(new AggregationStructuredAlgorithm(graphFact)));
302 
303  // Since we want to operate on nodes and not dof, we need to modify the rowMap in order to
304  // obtain a nodeMap.
305  const int numDimensions = pL.get<int>("aggregation: number of spatial dimensions");
306  const int interpolationOrder = pL.get<int>("aggregation: coarsening order");
307  std::string meshLayout = pL.get<std::string>("aggregation: mesh layout");
308  std::string coupling = pL.get<std::string>("aggregation: mode");
309  const bool coupled = false; //Only support uncoupled
310  Array<GO> gFineNodesPerDir(3);
311  Array<LO> lFineNodesPerDir(3);
312  if(currentLevel.GetLevelID() == 0) {
313  // On level 0, data is provided by applications and has no associated factory.
314  if(coupled) {
315  gFineNodesPerDir = currentLevel.Get<Array<GO> >("gNodesPerDim", NoFactory::get());
316  }
317  lFineNodesPerDir = currentLevel.Get<Array<LO> >("lNodesPerDim", NoFactory::get());
318  } else {
319  // On level > 0, data is provided directly by generating factories.
320  if(coupled) {
321  gFineNodesPerDir = Get<Array<GO> >(currentLevel, "gNodesPerDim");
322  }
323  lFineNodesPerDir = Get<Array<LO> >(currentLevel, "lNodesPerDim");
324  }
325 
326  // Set lFineNodesPerDir to 1 for directions beyond numDimensions
327  for(int dim = numDimensions; dim < 3; ++dim) {
328  lFineNodesPerDir[dim] = 1;
329  }
330 
331  // Get the coarsening rate
332  std::string coarseningRate = pL.get<std::string>("aggregation: coarsening rate");
333  Teuchos::Array<LO> coarseRate;
334  try {
335  coarseRate = Teuchos::fromStringToArray<LO>(coarseningRate);
337  GetOStream(Errors,-1) << " *** \"aggregation: coarsening rate\" must be a string convertible into an array! *** "
338  << std::endl;
339  throw e;
340  }
341  TEUCHOS_TEST_FOR_EXCEPTION((coarseRate.size() > 1) && (coarseRate.size() < numDimensions),
343  "\"aggregation: coarsening rate\" must have at least as many"
344  " components as the number of spatial dimensions in the problem.");
345 
346  // Now that we have extracted info from the level, create the IndexManager
348  if(!coupled) {
349  geoData = rcp(new MueLu::UncoupledIndexManager<LO,GO,NO>(fineMap->getComm(),
350  coupled,
351  numDimensions,
352  interpolationOrder,
353  myRank,
354  numRanks,
355  gFineNodesPerDir,
356  lFineNodesPerDir,
357  coarseRate));
358  } else {
360  "Coupled aggregation is not yet implemented in hybrid aggregation");
361  }
362 
363  *out << "The index manager has now been built" << std::endl;
364  TEUCHOS_TEST_FOR_EXCEPTION(fineMap->getNodeNumElements()
365  != static_cast<size_t>(geoData->getNumLocalFineNodes()),
367  "The local number of elements in the graph's map is not equal to "
368  "the number of nodes given by: lNodesPerDim!");
369  if(coupled) {
370  TEUCHOS_TEST_FOR_EXCEPTION(fineMap->getGlobalNumElements()
371  != static_cast<size_t>(geoData->getNumGlobalFineNodes()),
373  "The global number of elements in the graph's map is not equal to "
374  "the number of nodes given by: gNodesPerDim!");
375  }
376 
377  *out << "Compute coarse mesh data" << std::endl;
378  std::vector<std::vector<GO> > coarseMeshData = geoData->getCoarseMeshData();
379 
380  aggregates->SetIndexManager(geoData);
381  aggregates->SetNumAggregates(geoData->getNumLocalCoarseNodes());
382 
383  Set(currentLevel, "gCoarseNodesPerDim", geoData->getGlobalCoarseNodesPerDir());
384  Set(currentLevel, "lCoarseNodesPerDim", geoData->getLocalCoarseNodesPerDir());
385 
386  }// end structured aggregation setup
387 
388  if (regionType == "uncoupled"){
389  // Add unstructred aggregation phases
390  algos_.push_back(rcp(new PreserveDirichletAggregationAlgorithm(graphFact)));
391  if (pL.get<bool>("aggregation: use interface aggregation") == true) algos_.push_back(rcp(new InterfaceAggregationAlgorithm (graphFact)));
392  if (pL.get<bool>("aggregation: allow user-specified singletons") == true) algos_.push_back(rcp(new OnePtAggregationAlgorithm (graphFact)));
393  if (pL.get<bool>("aggregation: enable phase 1" ) == true) algos_.push_back(rcp(new AggregationPhase1Algorithm (graphFact)));
394  if (pL.get<bool>("aggregation: enable phase 2a") == true) algos_.push_back(rcp(new AggregationPhase2aAlgorithm (graphFact)));
395  if (pL.get<bool>("aggregation: enable phase 2b") == true) algos_.push_back(rcp(new AggregationPhase2bAlgorithm (graphFact)));
396  if (pL.get<bool>("aggregation: enable phase 3" ) == true) algos_.push_back(rcp(new AggregationPhase3Algorithm (graphFact)));
397 
398 
399  // Set map for interface aggregates
400  std::string mapInterfaceName = pL.get<std::string>("Interface aggregate map name");
401  RCP<Map> InterfaceMap = Teuchos::null;
402  // interface
403  if (pL.get<bool>("aggregation: use interface aggregation") == true){
404  Teuchos::Array<LO> nodeOnInterface = Get<Array<LO>>(currentLevel,"nodeOnInterface");
405  for (LO i = 0; i < numRows; i++) {
406  if (nodeOnInterface[i])
407  aggStat[i] = INTERFACE;
408  }
409  }
410 
411  // Dirichlet boundary
412  ArrayRCP<const bool> dirichletBoundaryMap = graph->GetBoundaryNodeMap();
413  if (dirichletBoundaryMap != Teuchos::null)
414  for (LO i = 0; i < numRows; i++)
415  if (dirichletBoundaryMap[i] == true)
416  aggStat[i] = BOUNDARY;
417 
418  // OnePt aggregation
419  std::string mapOnePtName = pL.get<std::string>("OnePt aggregate map name");
420  RCP<Map> OnePtMap = Teuchos::null;
421  if (mapOnePtName.length()) {
422  std::string mapOnePtFactName = pL.get<std::string>("OnePt aggregate map factory");
423  if (mapOnePtFactName == "" || mapOnePtFactName == "NoFactory") {
424  OnePtMap = currentLevel.Get<RCP<Map> >(mapOnePtName, NoFactory::get());
425  } else {
426  RCP<const FactoryBase> mapOnePtFact = GetFactory(mapOnePtFactName);
427  OnePtMap = currentLevel.Get<RCP<Map> >(mapOnePtName, mapOnePtFact.get());
428  }
429  }
430  LO nDofsPerNode = Get<LO>(currentLevel, "DofsPerNode");
431  GO indexBase = graph->GetDomainMap()->getIndexBase();
432  if (OnePtMap != Teuchos::null) {
433  for (LO i = 0; i < numRows; i++) {
434  // reconstruct global row id (FIXME only works for contiguous maps)
435  GO grid = (graph->GetDomainMap()->getGlobalElement(i)-indexBase) * nDofsPerNode + indexBase;
436  for (LO kr = 0; kr < nDofsPerNode; kr++)
437  if (OnePtMap->isNodeGlobalElement(grid + kr))
438  aggStat[i] = ONEPT;
439  }
440  }
441 
442  // Create a fake lCoarseNodesPerDir for CoordinatesTranferFactory
443  Array<LO> lCoarseNodesPerDir(3,-1);
444  Set(currentLevel, "lCoarseNodesPerDim", lCoarseNodesPerDir);
445  }// end uncoupled aggregation setup
446 
447  aggregates->AggregatesCrossProcessors(false); // No coupled aggregation
448 
449  LO numNonAggregatedNodes = numRows;
450  for (size_t a = 0; a < algos_.size(); a++) {
451  std::string phase = algos_[a]->description();
452  SubFactoryMonitor sfm(*this, "Algo \"" + phase + "\"", currentLevel);
453  *out << "p=" << myRank << " | "<<regionType<<" | Executing phase " << a << std::endl;
454 
455  int oldRank = algos_[a]->SetProcRankVerbose(this->GetProcRankVerbose());
456  algos_[a]->BuildAggregates(pL, *graph, *aggregates, aggStat, numNonAggregatedNodes);
457  algos_[a]->SetProcRankVerbose(oldRank);
458  *out << "p=" << myRank << " | "<<regionType<<" | Done Executing phase " << a << std::endl;
459  }
460 
461  aggregates->ComputeAggregateSizes(true/*forceRecompute*/);
462 
463  Set(currentLevel, "Aggregates", aggregates);
464 
465  Set(currentLevel, "aggregationRegionTypeCoarse", regionType);
466 
467  GetOStream(Statistics1) << aggregates->description() << std::endl;
468  }
469 
470 } //namespace MueLu
471 
472 
473 #endif /* MUELU_HYBRIDAGGREGATIONFACTORY_DEF_HPP */
Algorithm for coarsening a graph with uncoupled aggregation. keep special marked nodes as singleton n...
Container class for aggregation information.
void setValidator(RCP< const ParameterEntryValidator > const &validator)
basic_FancyOStream & setShowProcRank(const bool showProcRank)
GlobalOrdinal GO
T & get(const std::string &name, T def_value)
virtual size_t GetNodeNumVertices() const =0
Return number of vertices owned by the calling node.
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Timer to be used in factories. Similar to Monitor but with additional timers.
virtual const ArrayRCP< const bool > GetBoundaryNodeMap() const =0
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Algorithm for coarsening a graph with structured aggregation.
Print more statistics.
virtual const RCP< const Map > GetDomainMap() const =0
LocalOrdinal LO
T * get() const
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
void SetIndexManager(RCP< IndexManager > &geoData)
Get the index manager used by structured aggregation algorithms.
Teuchos::ArrayRCP< LO > ComputeAggregateSizes(bool forceRecompute=false) const
Compute sizes of aggregates.
static const NoFactory * get()
Algorithm for coarsening a graph with uncoupled aggregation. creates aggregates along an interface us...
Builds one-to-one aggregates for all Dirichlet boundary nodes. For some applications this might be ne...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Class that holds all level-specific information.
Definition: MueLu_Level.hpp:99
Timer to be used in factories. Similar to SubMonitor but adds a timer level by level.
virtual void setObjectLabel(const std::string &objectLabel)
basic_FancyOStream & setShowAllFrontMatter(const bool showAllFrontMatter)
void Build(Level &currentLevel) const
Build aggregates.
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.
Add leftovers to existing aggregatesIdeaIn phase 2b non-aggregated nodes are added to existing aggreg...
void DeclareInput(Level &currentLevel) const
Input.
Algorithm for coarsening a graph with uncoupled aggregation.
int GetLevelID() const
Return level number.
Definition: MueLu_Level.cpp:76
Exception throws to report errors in the internal logical of the program.
Handle leftover nodes. Try to avoid singleton nodesIdeaIn phase 3 we try to stick unaggregated nodes ...
#define SET_VALID_ENTRY(name)
ParameterEntry & getEntry(const std::string &name)
std::string description() const
Return a simple one-line description of this object.
void AggregatesCrossProcessors(const bool &flag)
Record whether aggregates include DOFs from other processes.
void DeclareInput(const std::string &ename, const FactoryBase *factory, const FactoryBase *requestedBy=NoFactory::get())
Callback from FactoryBase::CallDeclareInput() and FactoryBase::DeclareInput()
bool IsAvailable(const std::string &ename, const FactoryBase *factory=NoFactory::get()) const
Test whether a need&#39;s value has been saved.
void SetNumAggregates(LO nAggregates)
Set number of local aggregates on current processor.