103 Array<LO>& ghostedNodeCoarseLIDs, Array<int>& ghostedNodeCoarsePIDs, Array<GO>&ghostedNodeCoarseGIDs)
const {
105 ghostedNodeCoarseLIDs.resize(this->getNumLocalGhostedNodes());
106 ghostedNodeCoarsePIDs.resize(this->getNumLocalGhostedNodes());
107 ghostedNodeCoarseGIDs.resize(this->numGhostedNodes);
111 Array<GO> lCoarseNodeCoarseGIDs(this->lNumCoarseNodes),
112 lCoarseNodeFineGIDs(this->lNumCoarseNodes);
113 Array<GO> ghostedCoarseNodeFineGIDs(this->numGhostedNodes);
114 Array<LO> ghostedCoarseNodeCoarseIndices(3), ghostedCoarseNodeFineIndices(3), ijk(3);
115 LO currentIndex = -1, currentCoarseIndex = -1;
116 for(ijk[2] = 0; ijk[2] < this->ghostedNodesPerDir[2]; ++ijk[2]) {
117 for(ijk[1] = 0; ijk[1] < this->ghostedNodesPerDir[1]; ++ijk[1]) {
118 for(ijk[0] = 0; ijk[0] < this->ghostedNodesPerDir[0]; ++ijk[0]) {
119 currentIndex = ijk[2]*this->numGhostedNodes10 + ijk[1]*this->ghostedNodesPerDir[0] + ijk[0];
120 ghostedCoarseNodeCoarseIndices[0] = this->startGhostedCoarseNode[0] + ijk[0];
121 ghostedCoarseNodeCoarseIndices[1] = this->startGhostedCoarseNode[1] + ijk[1];
122 ghostedCoarseNodeCoarseIndices[2] = this->startGhostedCoarseNode[2] + ijk[2];
123 GO myCoarseGID = ghostedCoarseNodeCoarseIndices[0]
124 + ghostedCoarseNodeCoarseIndices[1]*this->gCoarseNodesPerDir[0]
125 + ghostedCoarseNodeCoarseIndices[2]*this->gNumCoarseNodes10;
126 ghostedNodeCoarseGIDs[currentIndex] = myCoarseGID;
127 GO myGID = 0, factor[3] = {};
128 factor[2] = this->gNumFineNodes10;
129 factor[1] = this->gFineNodesPerDir[0];
131 for(
int dim = 0; dim < 3; ++dim) {
132 if(dim < this->numDimensions) {
133 if(this->startIndices[dim] - this->offsets[dim] + ijk[dim]*this->coarseRate[dim]
134 < this->gFineNodesPerDir[dim] - 1) {
135 myGID += (this->startIndices[dim] - this->offsets[dim]
136 + ijk[dim]*this->coarseRate[dim])*factor[dim];
138 myGID += (this->startIndices[dim] - this->offsets[dim] + (ijk[dim] - 1)
139 *this->coarseRate[dim] + this->endRate[dim])*factor[dim];
147 if((!this->ghostInterface[0] || ijk[0] != 0) &&
148 (!this->ghostInterface[2] || ijk[1] != 0) &&
149 (!this->ghostInterface[4] || ijk[2] != 0) &&
150 (!this->ghostInterface[1] || ijk[0] != this->ghostedNodesPerDir[0] - 1) &&
151 (!this->ghostInterface[3] || ijk[1] != this->ghostedNodesPerDir[1] - 1) &&
152 (!this->ghostInterface[5] || ijk[2] != this->ghostedNodesPerDir[2] - 1)) {
155 if(this->interpolationOrder_ == 0) {
156 currentCoarseIndex = 0;
157 if(this->ghostInterface[4]) {
158 currentCoarseIndex += (ijk[2] - 1)*this->lNumCoarseNodes10;
160 currentCoarseIndex += ijk[2]*this->lNumCoarseNodes10;
162 if(this->ghostInterface[2]) {
163 currentCoarseIndex += (ijk[1] - 1)*this->getLocalCoarseNodesInDir(0);
165 currentCoarseIndex += ijk[1]*this->getLocalCoarseNodesInDir(0);
167 if(this->ghostInterface[0]) {
168 currentCoarseIndex += ijk[0] - 1;
170 currentCoarseIndex += ijk[0];
173 this->getGhostedNodeCoarseLID(ijk[0], ijk[1], ijk[2], currentCoarseIndex);
176 lCoarseNodeCoarseGIDs[currentCoarseIndex] = myCoarseGID;
177 lCoarseNodeFineGIDs[currentCoarseIndex] = myGID;
179 ghostedCoarseNodeFineGIDs[currentIndex] = myGID;
184 RCP<const Map> coarseMap = Xpetra::MapFactory<LO,GO,NO>::Build (fineMap->lib(),
185 this->gNumCoarseNodes,
186 lCoarseNodeCoarseGIDs(),
187 fineMap->getIndexBase(),
190 coarseMap->getRemoteIndexList(ghostedNodeCoarseGIDs(),
191 ghostedNodeCoarsePIDs(),
192 ghostedNodeCoarseLIDs());
199 Array<GO>& coarseNodeCoarseGIDs,
200 Array<GO>& coarseNodeFineGIDs)
const {
203 coarseNodeCoarseGIDs.resize(this->getNumLocalCoarseNodes());
204 coarseNodeFineGIDs.resize(this->getNumLocalCoarseNodes());
207 ArrayView<const GO> fineNodeGIDs = fineCoordinatesMap->getLocalElementList();
209 Array<GO> coarseStartIndices(3);
211 for(
int dim = 0; dim < 3; ++dim) {
212 coarseStartIndices[dim] = this->startIndices[dim] / this->coarseRate[dim];
213 tmp = this->startIndices[dim] % this->coarseRate[dim];
214 if(tmp > 0) {++coarseStartIndices[dim];}
219 Array<LO> lCoarseIndices(3);
220 Array<GO> gCoarseIndices(3);
221 for(LO coarseLID = 0; coarseLID < this->getNumLocalCoarseNodes(); ++coarseLID) {
222 this->getCoarseNodeLocalTuple(coarseLID,
226 getCoarseNodeFineLID(lCoarseIndices[0], lCoarseIndices[1], lCoarseIndices[2], fineLID);
227 coarseNodeFineGIDs[coarseLID] = fineNodeGIDs[fineLID];
230 for(
int dim=0; dim<3; dim++) {
231 gCoarseIndices[dim] = coarseStartIndices[dim] + lCoarseIndices[dim];
233 getCoarseNodeGID(gCoarseIndices[0],
236 coarseNodeCoarseGIDs[coarseLID] );
357 LO itmp = i - (this->offsets[0] > 0 ? 1 : 0);
358 LO jtmp = j - (this->offsets[1] > 0 ? 1 : 0);
359 LO ktmp = k - (this->offsets[2] > 0 ? 1 : 0);
361 if(ktmp*this->coarseRate[2] < this->lFineNodesPerDir[2]) {
362 myLID += ktmp*this->coarseRate[2]*this->lNumCoarseNodes10;
364 myLID += (this->lFineNodesPerDir[2] - 1)*this->lNumCoarseNodes10;
367 if(jtmp*this->coarseRate[1] < this->lFineNodesPerDir[1]) {
368 myLID += jtmp*this->coarseRate[1]*this->lFineNodesPerDir[0];
370 myLID += (this->lFineNodesPerDir[1] - 1)*this->lFineNodesPerDir[1];
373 if(itmp*this->coarseRate[0] < this->lFineNodesPerDir[0]) {
374 myLID += itmp*this->coarseRate[0];
376 myLID += this->lFineNodesPerDir[0] - 1;