MueLu  Version of the Day
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>
52 #include <Xpetra_MultiVectorFactory.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  // From StructuredAggregationFactory
114 #undef SET_VALID_ENTRY
115 
116  /* From UncoupledAggregation */
117  // general variables needed in AggregationFactory
118  validParamList->set< RCP<const FactoryBase> >("Graph", null, "Generating factory of the graph");
119  validParamList->set< RCP<const FactoryBase> >("DofsPerNode", null, "Generating factory for variable \'DofsPerNode\', usually the same as for \'Graph\'");
120  // special variables necessary for OnePtAggregationAlgorithm
121  validParamList->set<std::string> ("OnePt aggregate map name", "",
122  "Name of input map for single node aggregates. (default='')");
123  validParamList->set<std::string> ("OnePt aggregate map factory", "",
124  "Generating factory of (DOF) map for single node aggregates.");
125 
126  // InterfaceAggregation parameters
127  validParamList->set< std::string > ("Interface aggregate map name", "",
128  "Name of input map for interface aggregates. (default='')");
129  validParamList->set< std::string > ("Interface aggregate map factory", "",
130  "Generating factory of (DOF) map for interface aggregates.");
131  validParamList->set<RCP<const FactoryBase> > ("nodeOnInterface", Teuchos::null,
132  "Array specifying whether or not a node is on the interface (1 or 0).");
133 
134  /* From StructuredAggregation */
135  // general variables needed in AggregationFactory
136  validParamList->set<std::string > ("aggregation: mesh layout","Global Lexicographic",
137  "Type of mesh ordering");
138  validParamList->set<std::string > ("aggregation: coupling", "uncoupled",
139  "aggregation coupling mode: coupled or uncoupled");
140  validParamList->set<int> ("aggregation: number of spatial dimensions", 3,
141  "The number of spatial dimensions in the problem");
142  validParamList->set<int> ("aggregation: coarsening order", 0,
143  "The interpolation order used to construct grid transfer operators based off these aggregates.");
144  validParamList->set<std::string> ("aggregation: coarsening rate", "{3}",
145  "Coarsening rate per spatial dimensions");
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: coupling");
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  const GO minGlobalIndex = fineMap->getMinGlobalIndex();
279 
280  // Build aggregates
281  RCP<Aggregates> aggregates = rcp(new Aggregates(*graph));
282  aggregates->setObjectLabel("HB");
283 
284  // construct aggStat information
285  const LO numRows = graph->GetNodeNumVertices();
286  std::vector<unsigned> aggStat(numRows, READY);
287 
288  // Get aggregation type for region
289  std::string regionType;
290  if(currentLevel.GetLevelID() == 0) {
291  // On level 0, data is provided by applications and has no associated factory.
292  regionType = currentLevel.Get< std::string >("aggregationRegionType", NoFactory::get());
293  } else {
294  // On level > 0, data is provided directly by generating factories.
295  regionType = Get< std::string >(currentLevel, "aggregationRegionType");
296  }
297  *out<<"p="<< myRank << " | "<<regionType<<" | regionType determined" << std::endl;
298 
299  algos_.clear();
300  if (regionType == "structured") {
301  // Add AggregationStructuredAlgorithm
302  algos_.push_back(rcp(new AggregationStructuredAlgorithm(graphFact)));
303 
304  // Since we want to operate on nodes and not dof, we need to modify the rowMap in order to
305  // obtain a nodeMap.
306  const int numDimensions = pL.get<int>("aggregation: number of spatial dimensions");
307  const int interpolationOrder = pL.get<int>("aggregation: coarsening order");
308  std::string meshLayout = pL.get<std::string>("aggregation: mesh layout");
309  std::string coupling = pL.get<std::string>("aggregation: coupling");
310  const bool coupled = false; //Only support uncoupled
311  Array<GO> gFineNodesPerDir(3);
312  Array<LO> lFineNodesPerDir(3);
313  if(currentLevel.GetLevelID() == 0) {
314  // On level 0, data is provided by applications and has no associated factory.
315  if(coupled) {
316  gFineNodesPerDir = currentLevel.Get<Array<GO> >("gNodesPerDim", NoFactory::get());
317  }
318  lFineNodesPerDir = currentLevel.Get<Array<LO> >("lNodesPerDim", NoFactory::get());
319  } else {
320  // On level > 0, data is provided directly by generating factories.
321  if(coupled) {
322  gFineNodesPerDir = Get<Array<GO> >(currentLevel, "gNodesPerDim");
323  }
324  lFineNodesPerDir = Get<Array<LO> >(currentLevel, "lNodesPerDim");
325  }
326 
327  // Set lFineNodesPerDir to 1 for directions beyond numDimensions
328  for(int dim = numDimensions; dim < 3; ++dim) {
329  lFineNodesPerDir[dim] = 1;
330  }
331 
332  // Get the coarsening rate
333  std::string coarseningRate = pL.get<std::string>("aggregation: coarsening rate");
334  Teuchos::Array<LO> coarseRate;
335  try {
336  coarseRate = Teuchos::fromStringToArray<LO>(coarseningRate);
338  GetOStream(Errors,-1) << " *** \"aggregation: coarsening rate\" must be a string convertible into an array! *** "
339  << std::endl;
340  throw e;
341  }
342  TEUCHOS_TEST_FOR_EXCEPTION((coarseRate.size() > 1) && (coarseRate.size() < numDimensions),
344  "\"aggregation: coarsening rate\" must have at least as many"
345  " components as the number of spatial dimensions in the problem.");
346 
347  // Now that we have extracted info from the level, create the IndexManager
349  if(!coupled) {
350  geoData = rcp(new MueLu::UncoupledIndexManager<LO,GO,NO>(fineMap->getComm(),
351  coupled,
352  numDimensions,
353  interpolationOrder,
354  myRank,
355  numRanks,
356  gFineNodesPerDir,
357  lFineNodesPerDir,
358  coarseRate));
359  } else {
361  "Coupled aggregation is not yet implemented in hybrid aggregation");
362  }
363 
364  *out << "The index manager has now been built" << std::endl;
365  TEUCHOS_TEST_FOR_EXCEPTION(fineMap->getNodeNumElements()
366  != static_cast<size_t>(geoData->getNumLocalFineNodes()),
368  "The local number of elements in the graph's map is not equal to "
369  "the number of nodes given by: lNodesPerDim!");
370  if(coupled) {
371  TEUCHOS_TEST_FOR_EXCEPTION(fineMap->getGlobalNumElements()
372  != static_cast<size_t>(geoData->getNumGlobalFineNodes()),
374  "The global number of elements in the graph's map is not equal to "
375  "the number of nodes given by: gNodesPerDim!");
376  }
377 
378  *out << "Compute coarse mesh data" << std::endl;
379  std::vector<std::vector<GO> > coarseMeshData = geoData->getCoarseMeshData();
380 
381  aggregates->SetIndexManager(geoData);
382  aggregates->SetNumAggregates(geoData->getNumLocalCoarseNodes());
383 
384  Set(currentLevel, "gCoarseNodesPerDim", geoData->getGlobalCoarseNodesPerDir());
385  Set(currentLevel, "lCoarseNodesPerDim", geoData->getLocalCoarseNodesPerDir());
386 
387  }// end structured aggregation setup
388 
389  if (regionType == "uncoupled"){
390  // Add unstructred aggregation phases
391  algos_.push_back(rcp(new PreserveDirichletAggregationAlgorithm(graphFact)));
392  if (pL.get<bool>("aggregation: use interface aggregation") == true) algos_.push_back(rcp(new InterfaceAggregationAlgorithm (graphFact)));
393  if (pL.get<bool>("aggregation: allow user-specified singletons") == true) algos_.push_back(rcp(new OnePtAggregationAlgorithm (graphFact)));
394  if (pL.get<bool>("aggregation: enable phase 1" ) == true) algos_.push_back(rcp(new AggregationPhase1Algorithm (graphFact)));
395  if (pL.get<bool>("aggregation: enable phase 2a") == true) algos_.push_back(rcp(new AggregationPhase2aAlgorithm (graphFact)));
396  if (pL.get<bool>("aggregation: enable phase 2b") == true) algos_.push_back(rcp(new AggregationPhase2bAlgorithm (graphFact)));
397  if (pL.get<bool>("aggregation: enable phase 3" ) == true) algos_.push_back(rcp(new AggregationPhase3Algorithm (graphFact)));
398 
399 
400  // Set map for interface aggregates
401  std::string mapInterfaceName = pL.get<std::string>("Interface aggregate map name");
402  RCP<Map> InterfaceMap = Teuchos::null;
403  // interface
404  if (pL.get<bool>("aggregation: use interface aggregation") == true){
405  Teuchos::Array<LO> nodeOnInterface = Get<Array<LO>>(currentLevel,"nodeOnInterface");
406  for (LO i = 0; i < numRows; i++) {
407  if (nodeOnInterface[i])
408  aggStat[i] = INTERFACE;
409  }
410  }
411 
412  // Dirichlet boundary
413  ArrayRCP<const bool> dirichletBoundaryMap = graph->GetBoundaryNodeMap();
414  if (dirichletBoundaryMap != Teuchos::null)
415  for (LO i = 0; i < numRows; i++)
416  if (dirichletBoundaryMap[i] == true)
417  aggStat[i] = BOUNDARY;
418 
419  // OnePt aggregation
420  std::string mapOnePtName = pL.get<std::string>("OnePt aggregate map name");
421  RCP<Map> OnePtMap = Teuchos::null;
422  if (mapOnePtName.length()) {
423  std::string mapOnePtFactName = pL.get<std::string>("OnePt aggregate map factory");
424  if (mapOnePtFactName == "" || mapOnePtFactName == "NoFactory") {
425  OnePtMap = currentLevel.Get<RCP<Map> >(mapOnePtName, NoFactory::get());
426  } else {
427  RCP<const FactoryBase> mapOnePtFact = GetFactory(mapOnePtFactName);
428  OnePtMap = currentLevel.Get<RCP<Map> >(mapOnePtName, mapOnePtFact.get());
429  }
430  }
431  LO nDofsPerNode = Get<LO>(currentLevel, "DofsPerNode");
432  GO indexBase = graph->GetDomainMap()->getIndexBase();
433  if (OnePtMap != Teuchos::null) {
434  for (LO i = 0; i < numRows; i++) {
435  // reconstruct global row id (FIXME only works for contiguous maps)
436  GO grid = (graph->GetDomainMap()->getGlobalElement(i)-indexBase) * nDofsPerNode + indexBase;
437  for (LO kr = 0; kr < nDofsPerNode; kr++)
438  if (OnePtMap->isNodeGlobalElement(grid + kr))
439  aggStat[i] = ONEPT;
440  }
441  }
442 
443  // Create a fake lCoarseNodesPerDir for CoordinatesTranferFactory
444  Array<LO> lCoarseNodesPerDir(3,-1);
445  Set(currentLevel, "lCoarseNodesPerDim", lCoarseNodesPerDir);
446  }// end uncoupled aggregation setup
447 
448  aggregates->AggregatesCrossProcessors(false); // No coupled aggregation
449 
450  LO numNonAggregatedNodes = numRows;
451  for (size_t a = 0; a < algos_.size(); a++) {
452  std::string phase = algos_[a]->description();
453  SubFactoryMonitor sfm(*this, "Algo \"" + phase + "\"", currentLevel);
454  *out << "p=" << myRank << " | "<<regionType<<" | Executing phase " << a << std::endl;
455 
456  int oldRank = algos_[a]->SetProcRankVerbose(this->GetProcRankVerbose());
457  algos_[a]->BuildAggregates(pL, *graph, *aggregates, aggStat, numNonAggregatedNodes);
458  algos_[a]->SetProcRankVerbose(oldRank);
459  *out << "p=" << myRank << " | "<<regionType<<" | Done Executing phase " << a << std::endl;
460  }
461 
462  aggregates->ComputeAggregateSizes(true/*forceRecompute*/);
463 
464  Set(currentLevel, "Aggregates", aggregates);
465 
466  Set(currentLevel, "aggregationRegionTypeCoarse", regionType);
467 
468  GetOStream(Statistics1) << aggregates->description() << std::endl;
469  }
470 
471 } //namespace MueLu
472 
473 
474 #endif /* MUELU_HYBRIDAGGREGATIONFACTORY_DEF_HPP */
std::string description() const
Return a simple one-line description of this object.
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)
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
Namespace for MueLu classes and methods.
void SetIndexManager(RCP< IndexManager > &geoData)
Get the index manager used by structured aggregation algorithms.
T * get() const
static const NoFactory * get()
int GetLevelID() const
Return level number.
Definition: MueLu_Level.cpp:76
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)
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
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.
void DeclareInput(Level &currentLevel) const
Input.
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...
Algorithm for coarsening a graph with uncoupled aggregation.
bool IsAvailable(const std::string &ename, const FactoryBase *factory=NoFactory::get()) const
Test whether a need&#39;s value has been saved.
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)
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()
Teuchos::ArrayRCP< LO > ComputeAggregateSizes(bool forceRecompute=false) const
Compute sizes of aggregates.
void SetNumAggregates(LO nAggregates)
Set number of local aggregates on current processor.