143 (rem > Teuchos::as<double>(
coarseRate[dim]) / 2.0)) {
147 }
else if(interpolationOrder_ == 1) {
148 if(coupled_ && (startIndices[dim] % coarseRate[dim] != 0 ||
149 startIndices[dim] == gFineNodesPerDir[dim]-1)) {
150 ghostInterface[2*dim] =
true;
152 if(coupled_ && (startIndices[dim + 3] != gFineNodesPerDir[dim] - 1) &&
153 ((lFineNodesPerDir[dim] == 1) || (startIndices[dim + 3] % coarseRate[dim] != 0))) {
154 ghostInterface[2*dim+1] =
true;
163 *out <<
"singleCoarsePoint? " << singleCoarsePoint_ << std::endl;
164 *out <<
"gFineNodesPerDir: " << gFineNodesPerDir << std::endl;
165 *out <<
"lFineNodesPerDir: " << lFineNodesPerDir << std::endl;
166 *out <<
"endRate: " << endRate << std::endl;
167 *out <<
"ghostInterface: {" << ghostInterface[0] <<
", " << ghostInterface[1] <<
", "
168 << ghostInterface[2] <<
", " << ghostInterface[3] <<
", " << ghostInterface[4] <<
", "
169 << ghostInterface[5] <<
"}" << std::endl;
170 *out <<
"meshEdge: {" << meshEdge[0] <<
", " << meshEdge[1] <<
", "
171 << meshEdge[2] <<
", " << meshEdge[3] <<
", " << meshEdge[4] <<
", "
172 << meshEdge[5] <<
"}" << std::endl;
173 *out <<
"startIndices: " << startIndices << std::endl;
174 *out <<
"offsets: " << offsets << std::endl;
175 *out <<
"coarseNodeOffsets: " << coarseNodeOffsets << std::endl;
190 for(
int dim = 0; dim < 3; ++dim) {
191 if(dim < numDimensions) {
195 if( meshEdge[2*dim + 1] ) {
196 lCoarseNodesPerDir[dim] = (lFineNodesPerDir[dim] - endRate[dim] + offsets[dim] - 1)
197 / coarseRate[dim] + 1;
198 if(offsets[dim] == 0) {++lCoarseNodesPerDir[dim];}
202 if(singleCoarsePoint_ && lFineNodesPerDir[dim] - 1 < coarseRate[dim]) {
203 lCoarseNodesPerDir[dim] =1;
206 lCoarseNodesPerDir[dim] = (lFineNodesPerDir[dim] + offsets[dim] - 1) / coarseRate[dim];
207 if(offsets[dim] == 0) {++lCoarseNodesPerDir[dim];}
213 if(interpolationOrder_ == 0) {
214 startGhostedCoarseNode[dim] = startIndices[dim] / coarseRate[dim];
215 int rem = startIndices[dim] % coarseRate[dim];
216 if(rem > (Teuchos::as<double>(coarseRate[dim]) / 2.0) ) {
217 ++startGhostedCoarseNode[dim];
220 if((startIndices[dim] == gFineNodesPerDir[dim] - 1) &&
221 (startIndices[dim] % coarseRate[dim] == 0)) {
222 startGhostedCoarseNode[dim] = startIndices[dim] / coarseRate[dim] - 1;
224 startGhostedCoarseNode[dim] = startIndices[dim] / coarseRate[dim];
230 gCoarseNodesPerDir[dim] = (gFineNodesPerDir[dim] - 1) / coarseRate[dim];
231 if((gFineNodesPerDir[dim] - 1) % coarseRate[dim] == 0) {
232 ++gCoarseNodesPerDir[dim];
234 gCoarseNodesPerDir[dim] += 2;
238 gCoarseNodesPerDir[dim] = 1;
239 lCoarseNodesPerDir[dim] = 1;
244 if(lFineNodesPerDir[dim] < 1) {lCoarseNodesPerDir[dim] = 0;}
245 ghostedNodesPerDir[dim] = lCoarseNodesPerDir[dim];
247 if(ghostInterface[2*dim]) {ghostedNodesPerDir[dim] += 1;}
249 if(ghostInterface[2*dim + 1]) {ghostedNodesPerDir[dim] += 1;}
254 for(
int dim = 0; dim < 3; ++dim) {
255 gCoarseNodesPerDir[dim] = -1;
260 lNumCoarseNodes10 = lCoarseNodesPerDir[0]*lCoarseNodesPerDir[1];
261 lNumCoarseNodes = lNumCoarseNodes10*lCoarseNodesPerDir[2];
262 numGhostedNodes10 = ghostedNodesPerDir[1]*ghostedNodesPerDir[0];
263 numGhostedNodes = numGhostedNodes10*ghostedNodesPerDir[2];
264 numGhostNodes = numGhostedNodes - lNumCoarseNodes;
266 *out <<
"lCoarseNodesPerDir: " << lCoarseNodesPerDir << std::endl;
267 *out <<
"gCoarseNodesPerDir: " << gCoarseNodesPerDir << std::endl;
268 *out <<
"ghostedNodesPerDir: " << ghostedNodesPerDir << std::endl;
269 *out <<
"lNumCoarseNodes=" << lNumCoarseNodes << std::endl;
270 *out <<
"numGhostedNodes=" << numGhostedNodes << std::endl;