MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_AggregationStructuredAlgorithm_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_AGGREGATIONSTRUCTUREDALGORITHM_DEF_HPP_
47 #define MUELU_AGGREGATIONSTRUCTUREDALGORITHM_DEF_HPP_
48 
49 
50 #include <Teuchos_Comm.hpp>
51 #include <Teuchos_CommHelpers.hpp>
52 
53 #include <Xpetra_MapFactory.hpp>
54 #include <Xpetra_Map.hpp>
55 #include <Xpetra_CrsGraphFactory.hpp>
56 #include <Xpetra_CrsGraph.hpp>
57 
59 
60 #include "MueLu_GraphBase.hpp"
61 #include "MueLu_Aggregates.hpp"
62 #include "MueLu_IndexManager.hpp"
63 #include "MueLu_Exceptions.hpp"
64 #include "MueLu_Monitor.hpp"
65 
66 namespace MueLu {
67 
68  template <class LocalOrdinal, class GlobalOrdinal, class Node>
70  BuildAggregates(const Teuchos::ParameterList& /* params */, const GraphBase& graph,
71  Aggregates& aggregates, std::vector<unsigned>& aggStat,
72  LO& numNonAggregatedNodes) const {
73  Monitor m(*this, "BuildAggregates");
74 
76  if(const char* dbg = std::getenv("MUELU_STRUCTUREDALGORITHM_DEBUG")) {
77  out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
78  out->setShowAllFrontMatter(false).setShowProcRank(true);
79  } else {
80  out = Teuchos::getFancyOStream(rcp(new Teuchos::oblackholestream()));
81  }
82 
83  RCP<IndexManager> geoData = aggregates.GetIndexManager();
84  const bool coupled = geoData->isAggregationCoupled();
85  ArrayRCP<LO> vertex2AggId = aggregates.GetVertex2AggId()->getDataNonConst(0);
86  ArrayRCP<LO> procWinner = aggregates.GetProcWinner() ->getDataNonConst(0);
87  Array<LO> ghostedCoarseNodeCoarseLIDs;
88  Array<int> ghostedCoarseNodeCoarsePIDs;
89  Array<GO> ghostedCoarseNodeCoarseGIDs;
90 
91  *out << "Extract data for ghosted nodes" << std::endl;
92  geoData->getGhostedNodesData(graph.GetDomainMap(), ghostedCoarseNodeCoarseLIDs,
93  ghostedCoarseNodeCoarsePIDs, ghostedCoarseNodeCoarseGIDs);
94 
95  LO rem, rate;
96  Array<LO> ghostedIdx(3), coarseIdx(3);
97  LO ghostedCoarseNodeCoarseLID, aggId;
98  *out << "Loop over fine nodes and assign them to an aggregate and a rank" << std::endl;
99  for(LO nodeIdx = 0; nodeIdx < geoData->getNumLocalFineNodes(); ++nodeIdx) {
100  // Compute coarse ID associated with fine LID
101  geoData->getFineNodeGhostedTuple(nodeIdx, ghostedIdx[0], ghostedIdx[1], ghostedIdx[2]);
102 
103  for(int dim = 0; dim < 3; ++dim) {
104  coarseIdx[dim] = ghostedIdx[dim] / geoData->getCoarseningRate(dim);
105  rem = ghostedIdx[dim] % geoData->getCoarseningRate(dim);
106  if(ghostedIdx[dim] - geoData->getOffset(dim)
107  < geoData->getLocalFineNodesInDir(dim) - geoData->getCoarseningEndRate(dim)) {
108  rate = geoData->getCoarseningRate(dim);
109  } else {
110  rate = geoData->getCoarseningEndRate(dim);
111  }
112  if(rem > (rate / 2)) {++coarseIdx[dim];}
113  if(coupled && (geoData->getStartGhostedCoarseNode(dim)*geoData->getCoarseningRate(dim)
114  > geoData->getStartIndex(dim))) {--coarseIdx[dim];}
115  }
116 
117  geoData->getCoarseNodeGhostedLID(coarseIdx[0], coarseIdx[1], coarseIdx[2],
118  ghostedCoarseNodeCoarseLID);
119 
120  aggId = ghostedCoarseNodeCoarseLIDs[ghostedCoarseNodeCoarseLID];
121  vertex2AggId[nodeIdx] = aggId;
122  procWinner[nodeIdx] = ghostedCoarseNodeCoarsePIDs[ghostedCoarseNodeCoarseLID];
123  aggStat[nodeIdx] = AGGREGATED;
124  --numNonAggregatedNodes;
125 
126  } // Loop over fine points
127  } // BuildAggregates()
128 
129 
130  template <class LocalOrdinal, class GlobalOrdinal, class Node>
132  BuildGraph(const GraphBase& graph, RCP<IndexManager>& geoData, const LO dofsPerNode,
133  RCP<CrsGraph>& myGraph, RCP<const Map>& coarseCoordinatesFineMap,
134  RCP<const Map>& coarseCoordinatesMap) const {
135  Monitor m(*this, "BuildGraphP");
136 
138  if(const char* dbg = std::getenv("MUELU_STRUCTUREDALGORITHM_DEBUG")) {
139  out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
140  out->setShowAllFrontMatter(false).setShowProcRank(true);
141  } else {
142  out = Teuchos::getFancyOStream(rcp(new Teuchos::oblackholestream()));
143  }
144 
145  const bool coupled = geoData->isAggregationCoupled();
146 
147  // Compute the number of coarse points needed to interpolate quantities to a fine point
148  int numInterpolationPoints = 0;
149  if(geoData->getInterpolationOrder() == 0) {
150  numInterpolationPoints = 1;
151  } else if(geoData->getInterpolationOrder() == 1) {
152  // Compute 2^numDimensions using bit logic to avoid round-off errors
153  numInterpolationPoints = 1 << geoData->getNumDimensions();
154  }
155  *out << "numInterpolationPoints=" << numInterpolationPoints << std::endl;
156 
157  Array<LO> colIndex((geoData->getNumLocalCoarseNodes() + numInterpolationPoints*
158  (geoData->getNumLocalFineNodes() - geoData->getNumLocalCoarseNodes()))*dofsPerNode);
159  Array<size_t> rowPtr(geoData->getNumLocalFineNodes()*dofsPerNode + 1);
160  rowPtr[0] = 0;
161  ArrayRCP<size_t> nnzOnRow(geoData->getNumLocalFineNodes()*dofsPerNode);
162 
163  *out << "Compute prolongatorGraph data" << std::endl;
164  if(geoData->getInterpolationOrder() == 0) {
165  ComputeGraphDataConstant(graph, geoData, dofsPerNode, numInterpolationPoints,
166  nnzOnRow, rowPtr, colIndex);
167  } else if(geoData->getInterpolationOrder() == 1) {
168  ComputeGraphDataLinear(graph, geoData, dofsPerNode, numInterpolationPoints,
169  nnzOnRow, rowPtr, colIndex);
170  }
171 
172  // Compute graph's rowMap, colMap and domainMap
173  RCP<Map> rowMap = MapFactory::Build(graph.GetDomainMap(), dofsPerNode);
174  RCP<Map> colMap, domainMap;
175  *out << "Compute domain and column maps of the CrsGraph" << std::endl;
176  if(coupled){
177  *out << "Extract data for ghosted nodes" << std::endl;
178  Array<LO> ghostedCoarseNodeCoarseLIDs;
179  Array<int> ghostedCoarseNodeCoarsePIDs;
180  Array<GO> ghostedCoarseNodeCoarseGIDs;
181  geoData->getGhostedNodesData(graph.GetDomainMap(), ghostedCoarseNodeCoarseLIDs,
182  ghostedCoarseNodeCoarsePIDs, ghostedCoarseNodeCoarseGIDs);
183 
184  // In this case we specify the global number of nodes on the coarse mesh
185  // as well as the GIDs needed on rank.
186  colMap = MapFactory::Build(graph.GetDomainMap()->lib(),
187  geoData->getNumGlobalCoarseNodes(),
188  ghostedCoarseNodeCoarseGIDs(),
189  graph.GetDomainMap()->getIndexBase(),
190  graph.GetDomainMap()->getComm());
191 
192  LO coarseNodeIdx = 0;
193  Array<GO> coarseNodeCoarseGIDs, coarseNodeFineGIDs;
194  geoData->getCoarseNodesData(graph.GetDomainMap(), coarseNodeCoarseGIDs, coarseNodeFineGIDs);
195  for(LO nodeIdx = 0; nodeIdx < ghostedCoarseNodeCoarseGIDs.size(); ++nodeIdx) {
196  if(ghostedCoarseNodeCoarsePIDs[nodeIdx] == colMap->getComm()->getRank()) {
197  coarseNodeCoarseGIDs[coarseNodeIdx] = ghostedCoarseNodeCoarseGIDs[nodeIdx];
198  ++coarseNodeIdx;
199  }
200  }
201  domainMap = MapFactory::Build(graph.GetDomainMap()->lib(),
202  geoData->getNumGlobalCoarseNodes(),
203  coarseNodeCoarseGIDs(),
204  graph.GetDomainMap()->getIndexBase(),
205  graph.GetDomainMap()->getComm());
206  coarseCoordinatesMap = MapFactory::Build(graph.GetDomainMap()->lib(),
207  geoData->getNumGlobalCoarseNodes(),
208  coarseNodeCoarseGIDs(),
209  graph.GetDomainMap()->getIndexBase(),
210  graph.GetDomainMap()->getComm());
211  coarseCoordinatesFineMap = MapFactory::Build(graph.GetDomainMap()->lib(),
212  geoData->getNumGlobalCoarseNodes(),
213  coarseNodeFineGIDs(),
214  graph.GetDomainMap()->getIndexBase(),
215  graph.GetDomainMap()->getComm());
216  } else {
217  // In this case the map will compute the global number of nodes on the coarse mesh
218  // and it will assign GIDs to the local coarse nodes.
219  colMap = MapFactory::Build(graph.GetDomainMap()->lib(),
221  geoData->getNumLocalCoarseNodes()*dofsPerNode,
222  graph.GetDomainMap()->getIndexBase(),
223  graph.GetDomainMap()->getComm());
224  domainMap = colMap;
225 
226  Array<GO> coarseNodeCoarseGIDs(geoData->getNumLocalCoarseNodes());
227  Array<GO> coarseNodeFineGIDs(geoData->getNumLocalCoarseNodes());
228  geoData->getCoarseNodesData(graph.GetDomainMap(), coarseNodeCoarseGIDs, coarseNodeFineGIDs);
229  coarseCoordinatesMap = MapFactory::Build(graph.GetDomainMap()->lib(),
231  geoData->getNumLocalCoarseNodes(),
232  graph.GetDomainMap()->getIndexBase(),
233  graph.GetDomainMap()->getComm());
234  coarseCoordinatesFineMap = MapFactory::Build(graph.GetDomainMap()->lib(),
236  coarseNodeFineGIDs(),
237  graph.GetDomainMap()->getIndexBase(),
238  graph.GetDomainMap()->getComm());
239  }
240 
241  *out << "Call constructor of CrsGraph" << std::endl;
242  myGraph = CrsGraphFactory::Build(rowMap,
243  colMap,
244  nnzOnRow);
245 
246  *out << "Fill CrsGraph" << std::endl;
247  LO rowIdx = 0;
248  for(LO nodeIdx = 0; nodeIdx < geoData->getNumLocalFineNodes(); ++nodeIdx) {
249  for(LO dof = 0; dof < dofsPerNode; ++dof) {
250  rowIdx = nodeIdx*dofsPerNode + dof;
251  myGraph->insertLocalIndices(rowIdx, colIndex(rowPtr[rowIdx], nnzOnRow[rowIdx]) );
252  }
253  }
254 
255  *out << "Call fillComplete on CrsGraph" << std::endl;
256  myGraph->fillComplete(domainMap, rowMap);
257  *out << "Prolongator CrsGraph computed" << std::endl;
258 
259  } // BuildGraph()
260 
261 
262  template <class LocalOrdinal, class GlobalOrdinal, class Node>
265  const LO dofsPerNode, const int /* numInterpolationPoints */,
266  ArrayRCP<size_t>& nnzOnRow, Array<size_t>& rowPtr,
267  Array<LO>& colIndex) const {
268 
270  if(const char* dbg = std::getenv("MUELU_STRUCTUREDALGORITHM_DEBUG")) {
271  out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
272  out->setShowAllFrontMatter(false).setShowProcRank(true);
273  } else {
274  out = Teuchos::getFancyOStream(rcp(new Teuchos::oblackholestream()));
275  }
276 
277  Array<LO> ghostedCoarseNodeCoarseLIDs;
278  Array<int> ghostedCoarseNodeCoarsePIDs;
279  Array<GO> ghostedCoarseNodeCoarseGIDs;
280  geoData->getGhostedNodesData(graph.GetDomainMap(), ghostedCoarseNodeCoarseLIDs,
281  ghostedCoarseNodeCoarsePIDs, ghostedCoarseNodeCoarseGIDs);
282 
283  LO ghostedCoarseNodeCoarseLID, rem, rate;
284  Array<LO> ghostedIdx(3), coarseIdx(3);
285  for(LO nodeIdx = 0; nodeIdx < geoData->getNumLocalFineNodes(); ++nodeIdx) {
286 
287  // Compute coarse ID associated with fine LID
288  geoData->getFineNodeGhostedTuple(nodeIdx, ghostedIdx[0], ghostedIdx[1], ghostedIdx[2]);
289 
290  for(int dim = 0; dim < 3; ++dim) {
291  coarseIdx[dim] = ghostedIdx[dim] / geoData->getCoarseningRate(dim);
292  rem = ghostedIdx[dim] % geoData->getCoarseningRate(dim);
293  if(ghostedIdx[dim] - geoData->getOffset(dim)
294  < geoData->getLocalFineNodesInDir(dim) - geoData->getCoarseningEndRate(dim)) {
295  rate = geoData->getCoarseningRate(dim);
296  } else {
297  rate = geoData->getCoarseningEndRate(dim);
298  }
299  if(rem > (rate / 2)) {++coarseIdx[dim];}
300  if( (geoData->getStartGhostedCoarseNode(dim)*geoData->getCoarseningRate(dim)
301  > geoData->getStartIndex(dim)) && geoData->isAggregationCoupled() ) {--coarseIdx[dim];}
302  }
303 
304  geoData->getCoarseNodeGhostedLID(coarseIdx[0], coarseIdx[1], coarseIdx[2],
305  ghostedCoarseNodeCoarseLID);
306 
307  for(LO dof = 0; dof < dofsPerNode; ++dof) {
308  nnzOnRow[nodeIdx*dofsPerNode + dof] = 1;
309  rowPtr[nodeIdx*dofsPerNode + dof + 1] = rowPtr[nodeIdx*dofsPerNode + dof] + 1;
310  colIndex[rowPtr[nodeIdx*dofsPerNode + dof]] =
311  ghostedCoarseNodeCoarseLIDs[ghostedCoarseNodeCoarseLID]*dofsPerNode + dof;
312  }
313  } // Loop over fine points
314 
315  } // ComputeGraphDataConstant()
316 
317 
318  template <class LocalOrdinal, class GlobalOrdinal, class Node>
321  const LO dofsPerNode, const int numInterpolationPoints,
322  ArrayRCP<size_t>& nnzOnRow, Array<size_t>& rowPtr,
323  Array<LO>& colIndex) const {
324 
326  if(const char* dbg = std::getenv("MUELU_STRUCTUREDALGORITHM_DEBUG")) {
327  out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
328  out->setShowAllFrontMatter(false).setShowProcRank(true);
329  } else {
330  out = Teuchos::getFancyOStream(rcp(new Teuchos::oblackholestream()));
331  }
332 
333  const bool coupled = geoData->isAggregationCoupled();
334  const int numDimensions = geoData->getNumDimensions();
335  Array<LO> ghostedIdx(3,0);
336  Array<LO> coarseIdx(3,0);
337  Array<LO> ijkRem(3,0);
338  const LO coarsePointOffset[8][3] = {{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {1, 1, 0},
339  {0, 0, 1}, {1, 0, 1}, {0, 1, 1}, {1, 1, 1}};
340 
341  for(LO nodeIdx = 0; nodeIdx < geoData->getNumLocalFineNodes(); ++nodeIdx) {
342 
343  // Compute coarse ID associated with fine LID
344  geoData->getFineNodeGhostedTuple(nodeIdx, ghostedIdx[0], ghostedIdx[1], ghostedIdx[2]);
345  for(int dim=0; dim < numDimensions; dim++){
346  coarseIdx[dim] = ghostedIdx[dim] / geoData->getCoarseningRate(dim);
347  ijkRem[dim] = ghostedIdx[dim] % geoData->getCoarseningRate(dim);
348  if(coupled) {
349  if (geoData->getStartGhostedCoarseNode(dim)*geoData->getCoarseningRate(dim)
350  > geoData->getStartIndex(dim)) {
351  --coarseIdx[dim];
352  }
353  } else {
354  if(ghostedIdx[dim] == geoData->getLocalFineNodesInDir(dim) - 1) {
355  coarseIdx[dim] = geoData->getLocalCoarseNodesInDir(dim) - 1;
356  }
357  }
358  }
359 
360  // Fill Graph
361  // Check if Fine node lies on Coarse Node
362  bool allCoarse = true;
363  Array<bool> isCoarse(numDimensions);
364  for(int dim = 0; dim < numDimensions; ++dim) {
365  isCoarse[dim] = false;
366  if(ijkRem[dim] == 0)
367  isCoarse[dim] = true;
368 
369  if(coupled){
370  if( ghostedIdx[dim]-geoData->getOffset(dim) == geoData->getLocalFineNodesInDir(dim)-1 &&
371  geoData->getMeshEdge(dim*2+1) )
372  isCoarse[dim] = true;
373  } else {
374  if( ghostedIdx[dim]-geoData->getOffset(dim) == geoData->getLocalFineNodesInDir(dim)-1)
375  isCoarse[dim] = true;
376  }
377 
378  if(!isCoarse[dim])
379  allCoarse = false;
380  }
381 
382  LO rowIdx = 0, colIdx = 0;
383  if(allCoarse) {
384  for(LO dof = 0; dof < dofsPerNode; ++dof) {
385  rowIdx = nodeIdx*dofsPerNode + dof;
386  nnzOnRow[rowIdx] = 1;
387  rowPtr[rowIdx + 1] = rowPtr[rowIdx] + 1;
388 
389  // Fine node lies on Coarse node, easy case, we only need the LID of the coarse node.
390  geoData->getCoarseNodeGhostedLID(coarseIdx[0], coarseIdx[1], coarseIdx[2], colIdx);
391  colIndex[rowPtr[rowIdx]] = colIdx*dofsPerNode + dof;
392  }
393  } else {
394  // Harder case, we need the LIDs of all the coarse nodes contributing to the interpolation
395  for(int dim = 0; dim < numDimensions; ++dim) {
396  if(coarseIdx[dim] == geoData->getGhostedNodesInDir(dim) - 1)
397  --coarseIdx[dim];
398  }
399 
400  for(LO dof = 0; dof < dofsPerNode; ++dof) {
401  // at the current node.
402  rowIdx = nodeIdx*dofsPerNode + dof;
403  nnzOnRow[rowIdx] = Teuchos::as<size_t>( numInterpolationPoints );
404  rowPtr[rowIdx + 1] = rowPtr[rowIdx] + Teuchos::as<LO>(numInterpolationPoints);
405  // Compute Coarse Node LID
406  for(LO interpIdx = 0; interpIdx < numInterpolationPoints; ++interpIdx) {
407  geoData->getCoarseNodeGhostedLID(coarseIdx[0] + coarsePointOffset[interpIdx][0],
408  coarseIdx[1] + coarsePointOffset[interpIdx][1],
409  coarseIdx[2] + coarsePointOffset[interpIdx][2],
410  colIdx);
411  colIndex[rowPtr[rowIdx] + interpIdx] = colIdx*dofsPerNode + dof;
412  } // Loop over numInterpolationPoints
413  } // Loop over dofsPerNode
414  }
415  } // Loop over fine points
416  } // ComputeGraphDataLinear()
417 
418 } // end namespace
419 
420 
421 #endif /* MUELU_AGGREGATIONSTRUCTUREDALGORITHM_DEF_HPP_ */
GO getStartIndex(int const dim) const
LO getLocalCoarseNodesInDir(const int dim) const
void ComputeGraphDataConstant(const GraphBase &graph, RCP< IndexManager > &geoData, const LO dofsPerNode, const int numInterpolationPoints, ArrayRCP< size_t > &nnzOnRow, Array< size_t > &rowPtr, Array< LO > &colIndex) const
virtual void getFineNodeGhostedTuple(const LO myLID, LO &i, LO &j, LO &k) const =0
bool getMeshEdge(const int dir) const
const RCP< LOVector > & GetProcWinner() const
Returns constant vector that maps local node IDs to owning processor IDs.
Container class for aggregation information.
RCP< IndexManager > & GetIndexManager()
Get the index manager used by structured aggregation algorithms.
LO getGhostedNodesInDir(const int dim) const
basic_FancyOStream & setShowProcRank(const bool showProcRank)
GO getStartGhostedCoarseNode(int const dim) const
int getCoarseningRate(const int dim) const
virtual const RCP< const Map > GetDomainMap() const =0
virtual void getGhostedNodesData(const RCP< const Map > fineMap, Array< LO > &ghostedNodeCoarseLIDs, Array< int > &ghostedNodeCoarsePIDs, Array< GO > &ghostedNodeCoarseGIDs) const =0
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void ComputeGraphDataLinear(const GraphBase &graph, RCP< IndexManager > &geoData, const LO dofsPerNode, const int numInterpolationPoints, ArrayRCP< size_t > &nnzOnRow, Array< size_t > &rowPtr, Array< LO > &colIndex) const
virtual void getCoarseNodeGhostedLID(const LO i, const LO j, const LO k, LO &myLID) const =0
virtual void getCoarseNodesData(const RCP< const Map > fineCoordinatesMap, Array< GO > &coarseNodeCoarseGIDs, Array< GO > &coarseNodeFineGIDs) const =0
basic_FancyOStream & setShowAllFrontMatter(const bool showAllFrontMatter)
void BuildAggregates(const Teuchos::ParameterList &params, const GraphBase &graph, Aggregates &aggregates, std::vector< unsigned > &aggStat, LO &numNonAggregatedNodes) const
Local aggregation.
const RCP< LOMultiVector > & GetVertex2AggId() const
Returns constant vector that maps local node IDs to local aggregates IDs.
LO getLocalFineNodesInDir(const int dim) const
MueLu representation of a graph.
LO getOffset(int const dim) const
Timer to be used in non-factories.
size_type size() const
int getCoarseningEndRate(const int dim) const
void BuildGraph(const GraphBase &graph, RCP< IndexManager > &geoData, const LO dofsPerNode, RCP< CrsGraph > &myGraph, RCP< const Map > &coarseCoordinatesFineMap, RCP< const Map > &coarseCoordinatesMap) const
Local aggregation.