MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_LocalLexicographicIndexManager_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 // Ray Tuminaro (rstumin@sandia.gov)
41 // Luc Berger-Vergoat (lberge@sandia.gov)
42 //
43 // ***********************************************************************
44 //
45 // @HEADER
46 #ifndef MUELU_LOCALLEXICOGRAPHICINDEXMANAGER_DEF_HPP_
47 #define MUELU_LOCALLEXICOGRAPHICINDEXMANAGER_DEF_HPP_
48 
50 #include <Xpetra_MapFactory.hpp>
51 
52 namespace MueLu {
53 
54 template <class LocalOrdinal, class GlobalOrdinal, class Node>
56  LocalLexicographicIndexManager(const RCP<const Teuchos::Comm<int> > comm, const bool coupled,
57  const int NumDimensions, const int interpolationOrder,
58  const int MyRank, const int NumRanks,
59  const Array<GO> GFineNodesPerDir, const Array<LO> LFineNodesPerDir,
60  const Array<LO> CoarseRate, const Array<GO> MeshData)
61  : IndexManager(comm, coupled, false, NumDimensions, interpolationOrder, GFineNodesPerDir, LFineNodesPerDir)
62  , myRank(MyRank)
63  , numRanks(NumRanks) {
64  // Allocate data based on user input
65  meshData.resize(numRanks);
67  coarseMeshData.resize(numRanks);
68 
69  // Load coarse rate, being careful about formating
70  for (int dim = 0; dim < 3; ++dim) {
71  if (dim < this->numDimensions) {
72  if (CoarseRate.size() == 1) {
73  this->coarseRate[dim] = CoarseRate[0];
74  } else if (CoarseRate.size() == this->numDimensions) {
75  this->coarseRate[dim] = CoarseRate[dim];
76  }
77  } else {
78  this->coarseRate[dim] = 1;
79  }
80  }
81 
82  // Load meshData for local lexicographic case
83  for (int rank = 0; rank < numRanks; ++rank) {
84  meshData[rank].resize(10);
85  for (int entry = 0; entry < 10; ++entry) {
86  meshData[rank][entry] = MeshData[10 * rank + entry];
87  }
88  }
89 
90  if (this->coupled_) {
91  myBlock = meshData[myRank][2];
93  }
94 
95  // Start simple parameter calculation
97  for (int dim = 0; dim < 3; ++dim) {
98  this->startIndices[dim] = meshData[myRankIndex][2 * dim + 3];
99  this->startIndices[dim + 3] = meshData[myRankIndex][2 * dim + 4];
100  }
101 
102  this->computeMeshParameters();
105 } // Constructor
106 
107 template <class LocalOrdinal, class GlobalOrdinal, class Node>
110  this->gNumCoarseNodes10 = this->gCoarseNodesPerDir[0] * this->gCoarseNodesPerDir[1];
111  this->gNumCoarseNodes = this->gNumCoarseNodes10 * this->gCoarseNodesPerDir[2];
112 }
113 
114 template <class LocalOrdinal, class GlobalOrdinal, class Node>
117  Array<LO>& ghostedNodeCoarseLIDs,
118  Array<int>& ghostedNodeCoarsePIDs,
119  Array<GO>& ghostedNodeCoarseGIDs) const {
120  // First we allocated memory for the outputs
121  ghostedNodeCoarseLIDs.resize(this->getNumLocalGhostedNodes());
122  ghostedNodeCoarsePIDs.resize(this->getNumLocalGhostedNodes());
123  ghostedNodeCoarseGIDs.resize(this->numGhostedNodes);
124 
125  // Now the tricky part starts, the coarse nodes / ghosted coarse nodes need to be imported.
126  // This requires finding what their GID on the fine mesh is. They need to be ordered
127  // lexicographically to allow for fast sweeps through the mesh.
128 
129  // We loop over all ghosted coarse nodes by increasing global lexicographic order
130  Array<LO> ghostedCoarseNodeCoarseIndices(3), ghostedCoarseNodeFineIndices(3);
131  Array<LO> lCoarseNodeCoarseIndices(3);
132  Array<GO> lCoarseNodeCoarseGIDs(this->lNumCoarseNodes);
133  LO currentIndex = -1, countCoarseNodes = 0;
134  for (int k = 0; k < this->ghostedNodesPerDir[2]; ++k) {
135  for (int j = 0; j < this->ghostedNodesPerDir[1]; ++j) {
136  for (int i = 0; i < this->ghostedNodesPerDir[0]; ++i) {
137  currentIndex = k * this->numGhostedNodes10 + j * this->ghostedNodesPerDir[0] + i;
138  ghostedCoarseNodeCoarseIndices[0] = this->startGhostedCoarseNode[0] + i;
139  ghostedCoarseNodeFineIndices[0] = ghostedCoarseNodeCoarseIndices[0] * this->coarseRate[0];
140  if (ghostedCoarseNodeFineIndices[0] > this->gFineNodesPerDir[0] - 1) {
141  ghostedCoarseNodeFineIndices[0] = this->gFineNodesPerDir[0] - 1;
142  }
143  ghostedCoarseNodeCoarseIndices[1] = this->startGhostedCoarseNode[1] + j;
144  ghostedCoarseNodeFineIndices[1] = ghostedCoarseNodeCoarseIndices[1] * this->coarseRate[1];
145  if (ghostedCoarseNodeFineIndices[1] > this->gFineNodesPerDir[1] - 1) {
146  ghostedCoarseNodeFineIndices[1] = this->gFineNodesPerDir[1] - 1;
147  }
148  ghostedCoarseNodeCoarseIndices[2] = this->startGhostedCoarseNode[2] + k;
149  ghostedCoarseNodeFineIndices[2] = ghostedCoarseNodeCoarseIndices[2] * this->coarseRate[2];
150  if (ghostedCoarseNodeFineIndices[2] > this->gFineNodesPerDir[2] - 1) {
151  ghostedCoarseNodeFineIndices[2] = this->gFineNodesPerDir[2] - 1;
152  }
153 
154  GO myGID = -1, myCoarseGID = -1;
155  LO myLID = -1, myPID = -1, myCoarseLID = -1;
156  getGIDLocalLexicographic(i, j, k, ghostedCoarseNodeFineIndices, myGID, myPID, myLID);
157 
158  int rankIndex = rankIndices[myPID];
159  for (int dim = 0; dim < 3; ++dim) {
160  if (dim < this->numDimensions) {
161  lCoarseNodeCoarseIndices[dim] = ghostedCoarseNodeCoarseIndices[dim] - coarseMeshData[rankIndex][3 + 2 * dim];
162  }
163  }
164  LO myRankIndexCoarseNodesInDir0 = coarseMeshData[rankIndex][4] - coarseMeshData[rankIndex][3] + 1;
165  LO myRankIndexCoarseNodes10 = (coarseMeshData[rankIndex][6] - coarseMeshData[rankIndex][5] + 1) * myRankIndexCoarseNodesInDir0;
166  myCoarseLID = lCoarseNodeCoarseIndices[2] * myRankIndexCoarseNodes10 + lCoarseNodeCoarseIndices[1] * myRankIndexCoarseNodesInDir0 + lCoarseNodeCoarseIndices[0];
167  myCoarseGID = myCoarseLID + coarseMeshData[rankIndex][9];
168 
169  ghostedNodeCoarseLIDs[currentIndex] = myCoarseLID;
170  ghostedNodeCoarsePIDs[currentIndex] = myPID;
171  ghostedNodeCoarseGIDs[currentIndex] = myCoarseGID;
172 
173  if (myPID == myRank) {
174  lCoarseNodeCoarseGIDs[countCoarseNodes] = myCoarseGID;
175  ++countCoarseNodes;
176  }
177  }
178  }
179  }
180 }
181 
182 template <class LocalOrdinal, class GlobalOrdinal, class Node>
184  getCoarseNodesData(const RCP<const Map> fineCoordinatesMap,
185  Array<GO>& coarseNodeCoarseGIDs,
186  Array<GO>& coarseNodeFineGIDs) const {
187  // Allocate sufficient storage space for outputs
188  coarseNodeCoarseGIDs.resize(this->getNumLocalCoarseNodes());
189  coarseNodeFineGIDs.resize(this->getNumLocalCoarseNodes());
190 
191  // Load all the GIDs on the fine mesh
192  ArrayView<const GO> fineNodeGIDs = fineCoordinatesMap->getLocalElementList();
193 
194  Array<GO> coarseStartIndices(3);
195  for (int dim = 0; dim < 3; ++dim) {
196  coarseStartIndices[dim] = this->coarseMeshData[myRankIndex][2 * dim + 3];
197  }
198 
199  // Extract the fine LIDs of the coarse nodes and store the corresponding GIDs
200  LO fineLID;
201  for (LO coarseLID = 0; coarseLID < this->getNumLocalCoarseNodes(); ++coarseLID) {
202  Array<LO> coarseIndices(3), fineIndices(3), gCoarseIndices(3);
203  this->getCoarseNodeLocalTuple(coarseLID,
204  coarseIndices[0],
205  coarseIndices[1],
206  coarseIndices[2]);
207  getCoarseNodeFineLID(coarseIndices[0], coarseIndices[1], coarseIndices[2], fineLID);
208  coarseNodeFineGIDs[coarseLID] = fineNodeGIDs[fineLID];
209 
210  LO myRankIndexCoarseNodesInDir0 = coarseMeshData[myRankIndex][4] - coarseMeshData[myRankIndex][3] + 1;
211  LO myRankIndexCoarseNodes10 = (coarseMeshData[myRankIndex][6] - coarseMeshData[myRankIndex][5] + 1) * myRankIndexCoarseNodesInDir0;
212  LO myCoarseLID = coarseIndices[2] * myRankIndexCoarseNodes10 + coarseIndices[1] * myRankIndexCoarseNodesInDir0 + coarseIndices[0];
213  GO myCoarseGID = myCoarseLID + coarseMeshData[myRankIndex][9];
214  coarseNodeCoarseGIDs[coarseLID] = myCoarseGID;
215  }
216 }
217 
218 template <class LocalOrdinal, class GlobalOrdinal, class Node>
220  getGIDLocalLexicographic(const LO iGhosted, const LO jGhosted, const LO kGhosted,
221  const Array<LO> coarseNodeFineIndices,
222  GO& myGID, LO& myPID, LO& myLID) const {
223  LO ni = -1, nj = -1, li = -1, lj = -1, lk = -1;
224  LO myRankGuess = myRankIndex;
225  // We try to make a logical guess as to which PID owns the current coarse node
226  if (iGhosted == 0 && this->ghostInterface[0]) {
227  --myRankGuess;
228  } else if ((iGhosted == this->ghostedNodesPerDir[0] - 1) && this->ghostInterface[1]) {
229  ++myRankGuess;
230  }
231  if (jGhosted == 0 && this->ghostInterface[2]) {
232  myRankGuess -= pi;
233  } else if ((jGhosted == this->ghostedNodesPerDir[1] - 1) && this->ghostInterface[3]) {
234  myRankGuess += pi;
235  }
236  if (kGhosted == 0 && this->ghostInterface[4]) {
237  myRankGuess -= pj * pi;
238  } else if ((kGhosted == this->ghostedNodesPerDir[2] - 1) && this->ghostInterface[5]) {
239  myRankGuess += pj * pi;
240  }
241  if (coarseNodeFineIndices[0] >= meshData[myRankGuess][3] && coarseNodeFineIndices[0] <= meshData[myRankGuess][4] && coarseNodeFineIndices[1] >= meshData[myRankGuess][5] && coarseNodeFineIndices[1] <= meshData[myRankGuess][6] && coarseNodeFineIndices[2] >= meshData[myRankGuess][7] && coarseNodeFineIndices[2] <= meshData[myRankGuess][8] && myRankGuess < numRanks - 1) {
242  myPID = meshData[myRankGuess][0];
243  ni = meshData[myRankGuess][4] - meshData[myRankGuess][3] + 1;
244  nj = meshData[myRankGuess][6] - meshData[myRankGuess][5] + 1;
245  li = coarseNodeFineIndices[0] - meshData[myRankGuess][3];
246  lj = coarseNodeFineIndices[1] - meshData[myRankGuess][5];
247  lk = coarseNodeFineIndices[2] - meshData[myRankGuess][7];
248  myLID = lk * nj * ni + lj * ni + li;
249  myGID = meshData[myRankGuess][9] + myLID;
250  } else { // The guess failed, let us use the heavy artilery: std::find_if()
251  // It could be interesting to monitor how many times this branch of the code gets
252  // used as it is far more expensive than the above one...
253  auto nodeRank = std::find_if(myBlockStart, myBlockEnd,
254  [coarseNodeFineIndices](const std::vector<GO>& vec) {
255  if (coarseNodeFineIndices[0] >= vec[3] && coarseNodeFineIndices[0] <= vec[4] && coarseNodeFineIndices[1] >= vec[5] && coarseNodeFineIndices[1] <= vec[6] && coarseNodeFineIndices[2] >= vec[7] && coarseNodeFineIndices[2] <= vec[8]) {
256  return true;
257  } else {
258  return false;
259  }
260  });
261  myPID = (*nodeRank)[0];
262  ni = (*nodeRank)[4] - (*nodeRank)[3] + 1;
263  nj = (*nodeRank)[6] - (*nodeRank)[5] + 1;
264  li = coarseNodeFineIndices[0] - (*nodeRank)[3];
265  lj = coarseNodeFineIndices[1] - (*nodeRank)[5];
266  lk = coarseNodeFineIndices[2] - (*nodeRank)[7];
267  myLID = lk * nj * ni + lj * ni + li;
268  myGID = (*nodeRank)[9] + myLID;
269  }
270 }
271 
272 template <class LocalOrdinal, class GlobalOrdinal, class Node>
275  std::sort(meshData.begin(), meshData.end(),
276  [](const std::vector<GO>& a, const std::vector<GO>& b) -> bool {
277  // The below function sorts ranks by blockID, kmin, jmin and imin
278  if (a[2] < b[2]) {
279  return true;
280  } else if (a[2] == b[2]) {
281  if (a[7] < b[7]) {
282  return true;
283  } else if (a[7] == b[7]) {
284  if (a[5] < b[5]) {
285  return true;
286  } else if (a[5] == b[5]) {
287  if (a[3] < b[3]) {
288  return true;
289  }
290  }
291  }
292  }
293  return false;
294  });
295 
296  numBlocks = meshData[numRanks - 1][2] + 1;
297  // Find the range of the current block
298  myBlockStart = std::lower_bound(meshData.begin(), meshData.end(), myBlock - 1,
299  [](const std::vector<GO>& vec, const GO val) -> bool {
300  return (vec[2] < val) ? true : false;
301  });
302  myBlockEnd = std::upper_bound(meshData.begin(), meshData.end(), myBlock,
303  [](const GO val, const std::vector<GO>& vec) -> bool {
304  return (val < vec[2]) ? true : false;
305  });
306  // Assuming that i,j,k and ranges are split in pi, pj and pk processors
307  // we search for these numbers as they will allow us to find quickly the PID of processors
308  // owning ghost nodes.
309  auto myKEnd = std::upper_bound(myBlockStart, myBlockEnd, (*myBlockStart)[3],
310  [](const GO val, const std::vector<GO>& vec) -> bool {
311  return (val < vec[7]) ? true : false;
312  });
313  auto myJEnd = std::upper_bound(myBlockStart, myKEnd, (*myBlockStart)[3],
314  [](const GO val, const std::vector<GO>& vec) -> bool {
315  return (val < vec[5]) ? true : false;
316  });
317  pi = std::distance(myBlockStart, myJEnd);
318  pj = std::distance(myBlockStart, myKEnd) / pi;
319  pk = std::distance(myBlockStart, myBlockEnd) / (pj * pi);
320 
321  // We also look for the index of the local rank in the current block.
322  const int MyRank = myRank;
323  myRankIndex = std::distance(meshData.begin(),
324  std::find_if(myBlockStart, myBlockEnd,
325  [MyRank](const std::vector<GO>& vec) -> bool {
326  return (vec[0] == MyRank) ? true : false;
327  }));
328  // We also construct a mapping of rank to rankIndex in the meshData vector,
329  // this will allow us to access data quickly later on.
330  for (int rankIndex = 0; rankIndex < numRanks; ++rankIndex) {
331  rankIndices[meshData[rankIndex][0]] = rankIndex;
332  }
333 }
334 
335 template <class LocalOrdinal, class GlobalOrdinal, class Node>
338  Array<LO> rankOffset(3);
339  for (int rank = 0; rank < numRanks; ++rank) {
340  coarseMeshData[rank].resize(10);
341  coarseMeshData[rank][0] = meshData[rank][0];
342  coarseMeshData[rank][1] = meshData[rank][1];
343  coarseMeshData[rank][2] = meshData[rank][2];
344  for (int dim = 0; dim < 3; ++dim) {
345  coarseMeshData[rank][3 + 2 * dim] = meshData[rank][3 + 2 * dim] / this->coarseRate[dim];
346  if (meshData[rank][3 + 2 * dim] % this->coarseRate[dim] > 0) {
347  ++coarseMeshData[rank][3 + 2 * dim];
348  }
349  coarseMeshData[rank][3 + 2 * dim + 1] = meshData[rank][3 + 2 * dim + 1] / this->coarseRate[dim];
350  if (meshData[rank][3 + 2 * dim + 1] == this->gFineNodesPerDir[dim] - 1 &&
351  meshData[rank][3 + 2 * dim + 1] % this->coarseRate[dim] > 0) {
352  // this->endRate[dim] < this->coarseRate[dim]) {
353  ++coarseMeshData[rank][3 + 2 * dim + 1];
354  }
355  }
356  if (rank > 0) {
357  coarseMeshData[rank][9] = coarseMeshData[rank - 1][9] + (coarseMeshData[rank - 1][8] - coarseMeshData[rank - 1][7] + 1) * (coarseMeshData[rank - 1][6] - coarseMeshData[rank - 1][5] + 1) * (coarseMeshData[rank - 1][4] - coarseMeshData[rank - 1][3] + 1);
358  }
359  }
360 }
361 
362 template <class LocalOrdinal, class GlobalOrdinal, class Node>
363 std::vector<std::vector<GlobalOrdinal> > LocalLexicographicIndexManager<LocalOrdinal, GlobalOrdinal, Node>::
364  getCoarseMeshData() const { return coarseMeshData; }
365 
366 template <class LocalOrdinal, class GlobalOrdinal, class Node>
368  getFineNodeGlobalTuple(const GO /* myGID */, GO& /* i */, GO& /* j */, GO& /* k */) const {
369 }
370 
371 template <class LocalOrdinal, class GlobalOrdinal, class Node>
373  getFineNodeLocalTuple(const LO myLID, LO& i, LO& j, LO& k) const {
374  LO tmp;
375  k = myLID / this->lNumFineNodes10;
376  tmp = myLID % this->lNumFineNodes10;
377  j = tmp / this->lFineNodesPerDir[0];
378  i = tmp % this->lFineNodesPerDir[0];
379 }
380 
381 template <class LocalOrdinal, class GlobalOrdinal, class Node>
383  getFineNodeGhostedTuple(const LO myLID, LO& i, LO& j, LO& k) const {
384  LO tmp;
385  k = myLID / this->lNumFineNodes10;
386  tmp = myLID % this->lNumFineNodes10;
387  j = tmp / this->lFineNodesPerDir[0];
388  i = tmp % this->lFineNodesPerDir[0];
389 
390  k += this->offsets[2];
391  j += this->offsets[1];
392  i += this->offsets[0];
393 }
394 
395 template <class LocalOrdinal, class GlobalOrdinal, class Node>
397  getFineNodeGID(const GO /* i */, const GO /* j */, const GO /* k */, GO& /* myGID */) const {
398 }
399 
400 template <class LocalOrdinal, class GlobalOrdinal, class Node>
402  getFineNodeLID(const LO /* i */, const LO /* j */, const LO /* k */, LO& /* myLID */) const {
403 }
404 
405 template <class LocalOrdinal, class GlobalOrdinal, class Node>
407  getCoarseNodeGlobalTuple(const GO /* myGID */, GO& /* i */, GO& /* j */, GO& /* k */) const {
408 }
409 
410 template <class LocalOrdinal, class GlobalOrdinal, class Node>
412  getCoarseNodeLocalTuple(const LO myLID, LO& i, LO& j, LO& k) const {
413  LO tmp;
414  k = myLID / this->lNumCoarseNodes10;
415  tmp = myLID % this->lNumCoarseNodes10;
416  j = tmp / this->lCoarseNodesPerDir[0];
417  i = tmp % this->lCoarseNodesPerDir[0];
418 }
419 
420 template <class LocalOrdinal, class GlobalOrdinal, class Node>
422  getCoarseNodeGID(const GO /* i */, const GO /* j */, const GO /* k */, GO& /* myGID */) const {
423 }
424 
425 template <class LocalOrdinal, class GlobalOrdinal, class Node>
427  getCoarseNodeLID(const LO /* i */, const LO /* j */, const LO /* k */, LO& /* myLID */) const {
428 }
429 
430 template <class LocalOrdinal, class GlobalOrdinal, class Node>
432  getCoarseNodeGhostedLID(const LO i, const LO j, const LO k, LO& myLID) const {
433  myLID = k * this->numGhostedNodes10 + j * this->ghostedNodesPerDir[0] + i;
434 }
435 
436 template <class LocalOrdinal, class GlobalOrdinal, class Node>
438  getCoarseNodeFineLID(const LO i, const LO j, const LO k, LO& myLID) const {
439  // Assumptions: (i,j,k) is a tuple on the coarse mesh
440  // myLID is the corresponding local ID on the fine mesh
441  const LO multiplier[3] = {1, this->lFineNodesPerDir[0], this->lNumFineNodes10};
442  const LO indices[3] = {i, j, k};
443 
444  myLID = 0;
445  for (int dim = 0; dim < 3; ++dim) {
446  if ((indices[dim] == this->getLocalCoarseNodesInDir(dim) - 1) && this->meshEdge[2 * dim + 1]) {
447  // We are dealing with the last node on the mesh in direction dim
448  // so we can simply use the number of nodes on the fine mesh in that direction
449  myLID += (this->getLocalFineNodesInDir(dim) - 1) * multiplier[dim];
450  } else {
451  myLID += (indices[dim] * this->getCoarseningRate(dim) + this->getCoarseNodeOffset(dim)) * multiplier[dim];
452  }
453  }
454 }
455 
456 template <class LocalOrdinal, class GlobalOrdinal, class Node>
458  getGhostedNodeFineLID(const LO /* i */, const LO /* j */, const LO /* k */, LO& /* myLID */) const {
459 }
460 
461 template <class LocalOrdinal, class GlobalOrdinal, class Node>
463  getGhostedNodeCoarseLID(const LO /* i */, const LO /* j */, const LO /* k */, LO& /* myLID */) const {
464 }
465 
466 } // namespace MueLu
467 
468 #endif /* MUELU_LOCALLEXICOGRAPHICINDEXMANAGER_DEF_HPP_ */
const bool coupled_
Flag for coupled vs uncoupled aggregation mode, if true aggregation is coupled.
void getCoarseNodeGlobalTuple(const GO myGID, GO &i, GO &j, GO &k) const
void getCoarseNodeLocalTuple(const LO myLID, LO &i, LO &j, LO &k) const
void getGhostedNodesData(const RCP< const Map > fineMap, Array< LO > &ghostedNodeCoarseLIDs, Array< int > &ghostedNodeCoarsePIDs, Array< GO > &ghostedNodeCoarseGIDs) const
void getFineNodeLocalTuple(const LO myLID, LO &i, LO &j, LO &k) const
std::vector< std::vector< GO > > getCoarseMeshData() const
void getFineNodeGhostedTuple(const LO myLID, LO &i, LO &j, LO &k) const
GlobalOrdinal GO
void getGhostedNodeCoarseLID(const LO i, const LO j, const LO k, LO &myLID) const
void getGhostedNodeFineLID(const LO i, const LO j, const LO k, LO &myLID) const
int myRankIndex
local process index for record in meshData after sorting.
void getCoarseNodesData(const RCP< const Map > fineCoordinatesMap, Array< GO > &coarseNodeCoarseGIDs, Array< GO > &coarseNodeFineGIDs) const
Array< GO > startIndices
lowest global tuple (i,j,k) of a node on the local process
void getCoarseNodeFineLID(const LO i, const LO j, const LO k, LO &myLID) const
std::vector< std::vector< GO > > meshData
layout of indices accross all processes.
LocalOrdinal LO
void getCoarseNodeLID(const LO i, const LO j, const LO k, LO &myLID) const
Array< int > coarseRate
coarsening rate in each direction
void getFineNodeGlobalTuple(const GO myGID, GO &i, GO &j, GO &k) const
const int numDimensions
Number of spacial dimensions in the problem.
Array< int > rankIndices
mapping between rank ID and reordered rank ID.
void getFineNodeGID(const GO i, const GO j, const GO k, GO &myGID) const
const int numRanks
Number of ranks used to decompose the problem.
void resize(size_type new_size, const value_type &x=value_type())
void getCoarseNodeGID(const GO i, const GO j, const GO k, GO &myGID) const
void getFineNodeLID(const LO i, const LO j, const LO k, LO &myLID) const
size_type size() const
void getCoarseNodeGhostedLID(const LO i, const LO j, const LO k, LO &myLID) const
void getGIDLocalLexicographic(const LO iGhosted, const LO jGhosted, const LO kGhosted, const Array< LO > coarseNodeFineIndices, GO &myGID, LO &myPID, LO &myLID) const
Container class for mesh layout and indices calculation.
std::vector< std::vector< GO > > coarseMeshData
layout of indices accross all processes after coarsening.