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>
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,
246 
247  *out << "Fill CrsGraph" << std::endl;
248  LO rowIdx = 0;
249  for(LO nodeIdx = 0; nodeIdx < geoData->getNumLocalFineNodes(); ++nodeIdx) {
250  for(LO dof = 0; dof < dofsPerNode; ++dof) {
251  rowIdx = nodeIdx*dofsPerNode + dof;
252  myGraph->insertLocalIndices(rowIdx, colIndex(rowPtr[rowIdx], nnzOnRow[rowIdx]) );
253  }
254  }
255 
256  *out << "Call fillComplete on CrsGraph" << std::endl;
257  myGraph->fillComplete(domainMap, rowMap);
258  *out << "Prolongator CrsGraph computed" << std::endl;
259 
260  } // BuildAggregates()
261 
262 
263  template <class LocalOrdinal, class GlobalOrdinal, class Node>
266  const LO dofsPerNode, const int /* numInterpolationPoints */,
267  ArrayRCP<size_t>& nnzOnRow, Array<size_t>& rowPtr,
268  Array<LO>& colIndex) const {
269 
271  if(const char* dbg = std::getenv("MUELU_STRUCTUREDALGORITHM_DEBUG")) {
272  out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
273  out->setShowAllFrontMatter(false).setShowProcRank(true);
274  } else {
275  out = Teuchos::getFancyOStream(rcp(new Teuchos::oblackholestream()));
276  }
277 
278  Array<LO> ghostedCoarseNodeCoarseLIDs;
279  Array<int> ghostedCoarseNodeCoarsePIDs;
280  Array<GO> ghostedCoarseNodeCoarseGIDs;
281  geoData->getGhostedNodesData(graph.GetDomainMap(), ghostedCoarseNodeCoarseLIDs,
282  ghostedCoarseNodeCoarsePIDs, ghostedCoarseNodeCoarseGIDs);
283 
284  LO ghostedCoarseNodeCoarseLID, rem, rate;
285  Array<LO> ghostedIdx(3), coarseIdx(3);
286  for(LO nodeIdx = 0; nodeIdx < geoData->getNumLocalFineNodes(); ++nodeIdx) {
287 
288  // Compute coarse ID associated with fine LID
289  geoData->getFineNodeGhostedTuple(nodeIdx, ghostedIdx[0], ghostedIdx[1], ghostedIdx[2]);
290 
291  for(int dim = 0; dim < 3; ++dim) {
292  coarseIdx[dim] = ghostedIdx[dim] / geoData->getCoarseningRate(dim);
293  rem = ghostedIdx[dim] % geoData->getCoarseningRate(dim);
294  if(ghostedIdx[dim] - geoData->getOffset(dim)
295  < geoData->getLocalFineNodesInDir(dim) - geoData->getCoarseningEndRate(dim)) {
296  rate = geoData->getCoarseningRate(dim);
297  } else {
298  rate = geoData->getCoarseningEndRate(dim);
299  }
300  if(rem > (rate / 2)) {++coarseIdx[dim];}
301  if( (geoData->getStartGhostedCoarseNode(dim)*geoData->getCoarseningRate(dim)
302  > geoData->getStartIndex(dim)) && geoData->isAggregationCoupled() ) {--coarseIdx[dim];}
303  }
304 
305  geoData->getCoarseNodeGhostedLID(coarseIdx[0], coarseIdx[1], coarseIdx[2],
306  ghostedCoarseNodeCoarseLID);
307 
308  for(LO dof = 0; dof < dofsPerNode; ++dof) {
309  nnzOnRow[nodeIdx*dofsPerNode + dof] = 1;
310  rowPtr[nodeIdx*dofsPerNode + dof + 1] = rowPtr[nodeIdx*dofsPerNode + dof] + 1;
311  colIndex[rowPtr[nodeIdx*dofsPerNode + dof]] =
312  ghostedCoarseNodeCoarseLIDs[ghostedCoarseNodeCoarseLID]*dofsPerNode + dof;
313  }
314  } // Loop over fine points
315 
316  } // ComputeGraphDataConstant()
317 
318 
319  template <class LocalOrdinal, class GlobalOrdinal, class Node>
322  const LO dofsPerNode, const int numInterpolationPoints,
323  ArrayRCP<size_t>& nnzOnRow, Array<size_t>& rowPtr,
324  Array<LO>& colIndex) const {
325 
327  if(const char* dbg = std::getenv("MUELU_STRUCTUREDALGORITHM_DEBUG")) {
328  out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
329  out->setShowAllFrontMatter(false).setShowProcRank(true);
330  } else {
331  out = Teuchos::getFancyOStream(rcp(new Teuchos::oblackholestream()));
332  }
333 
334  const bool coupled = geoData->isAggregationCoupled();
335  const int numDimensions = geoData->getNumDimensions();
336  Array<LO> ghostedIdx(3,0);
337  Array<LO> coarseIdx(3,0);
338  Array<LO> ijkRem(3,0);
339  int rate = 0;
340  const LO coarsePointOffset[8][3] = {{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {1, 1, 0},
341  {0, 0, 1}, {1, 0, 1}, {0, 1, 1}, {1, 1, 1}};
342 
343  for(LO nodeIdx = 0; nodeIdx < geoData->getNumLocalFineNodes(); ++nodeIdx) {
344 
345  // Compute coarse ID associated with fine LID
346  geoData->getFineNodeGhostedTuple(nodeIdx, ghostedIdx[0], ghostedIdx[1], ghostedIdx[2]);
347  for(int dim=0; dim < numDimensions; dim++){
348  coarseIdx[dim] = ghostedIdx[dim] / geoData->getCoarseningRate(dim);
349  ijkRem[dim] = ghostedIdx[dim] % geoData->getCoarseningRate(dim);
350  if(ghostedIdx[dim] - geoData->getOffset(dim)
351  < geoData->getLocalFineNodesInDir(dim) - geoData->getCoarseningEndRate(dim)) {
352  rate = geoData->getCoarseningRate(dim);
353  } else {
354  rate = geoData->getCoarseningEndRate(dim);
355  }
356  if(ijkRem[dim] > (rate / 2)) {++coarseIdx[dim];}
357  if(coupled && (geoData->getStartGhostedCoarseNode(dim)*geoData->getCoarseningRate(dim)
358  > geoData->getStartIndex(dim))) {--coarseIdx[dim];}
359  }
360 
361  // Fill Graph
362  // Check if Fine node lies on Coarse Node
363  bool allCoarse = true;
364  Array<bool> isCoarse(numDimensions);
365  for(int dim = 0; dim < numDimensions; ++dim) {
366  isCoarse[dim] = false;
367  if(ijkRem[dim] == 0)
368  isCoarse[dim] = true;
369 
370  if(coupled){
371  if( ghostedIdx[dim]-geoData->getOffset(dim) == geoData->getLocalFineNodesInDir(dim)-1 &&
372  geoData->getMeshEdge(dim*2+1) )
373  isCoarse[dim] = true;
374  } else {
375  if( ghostedIdx[dim]-geoData->getOffset(dim) == geoData->getLocalFineNodesInDir(dim)-1)
376  isCoarse[dim] = true;
377  }
378 
379  if(!isCoarse[dim])
380  allCoarse = false;
381  }
382 
383  LO rowIdx = 0, colIdx = 0;
384  if(allCoarse) {
385  for(LO dof = 0; dof < dofsPerNode; ++dof) {
386  rowIdx = nodeIdx*dofsPerNode + dof;
387  nnzOnRow[rowIdx] = 1;
388  rowPtr[rowIdx + 1] = rowPtr[rowIdx] + 1;
389 
390  // Fine node lies on Coarse node, easy case, we only need the LID of the coarse node.
391  geoData->getCoarseNodeGhostedLID(coarseIdx[0], coarseIdx[1], coarseIdx[2], colIdx);
392  colIndex[rowPtr[rowIdx]] = colIdx*dofsPerNode + dof;
393  }
394  } else {
395  // Harder case, we need the LIDs of all the coarse nodes contributing to the interpolation
396  for(int dim = 0; dim < numDimensions; ++dim) {
397  if(coarseIdx[dim] == geoData->getGhostedNodesInDir(dim) - 1)
398  --coarseIdx[dim];
399  }
400 
401  for(LO dof = 0; dof < dofsPerNode; ++dof) {
402  // at the current node.
403  rowIdx = nodeIdx*dofsPerNode + dof;
404  nnzOnRow[rowIdx] = Teuchos::as<size_t>( numInterpolationPoints );
405  rowPtr[rowIdx + 1] = rowPtr[rowIdx] + Teuchos::as<LO>(numInterpolationPoints);
406  // Compute Coarse Node LID
407  for(LO interpIdx = 0; interpIdx < numInterpolationPoints; ++interpIdx) {
408  geoData->getCoarseNodeGhostedLID(coarseIdx[0] + coarsePointOffset[interpIdx][0],
409  coarseIdx[1] + coarsePointOffset[interpIdx][1],
410  coarseIdx[2] + coarsePointOffset[interpIdx][2],
411  colIdx);
412  colIndex[rowPtr[rowIdx] + interpIdx] = colIdx*dofsPerNode + dof;
413  } // Loop over numInterpolationPoints
414  } // Loop over dofsPerNode
415  }
416  } // Loop over fine points
417  } // ComputeGraphDataLinear()
418 
419 } // end namespace
420 
421 
422 #endif /* MUELU_AGGREGATIONSTRUCTUREDALGORITHM_DEF_HPP_ */
GO getStartIndex(int const 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
LocalOrdinal LO
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.