103 if (interpolationOrder_ == 0) {
104 int rem = startIndices[dim] % coarseRate[dim];
105 if ((rem != 0) && (rem <= Teuchos::as<double>(coarseRate[dim]) / 2.0)) {
106 ghostInterface[2 * dim] =
true;
108 rem = startIndices[dim + 3] % coarseRate[dim];
110 if (coupled_ && (startIndices[dim + 3] != gFineNodesPerDir[dim] - 1) &&
111 (rem > Teuchos::as<double>(coarseRate[dim]) / 2.0)) {
112 ghostInterface[2 * dim + 1] =
true;
115 }
else if (interpolationOrder_ == 1) {
116 if (coupled_ && (startIndices[dim] % coarseRate[dim] != 0 ||
117 startIndices[dim] == gFineNodesPerDir[dim] - 1)) {
118 ghostInterface[2 * dim] =
true;
120 if (coupled_ && (startIndices[dim + 3] != gFineNodesPerDir[dim] - 1) &&
121 ((lFineNodesPerDir[dim] == 1) || (startIndices[dim + 3] % coarseRate[dim] != 0))) {
122 ghostInterface[2 * dim + 1] =
true;
131 *out <<
"singleCoarsePoint? " << singleCoarsePoint_ << std::endl;
132 *out <<
"gFineNodesPerDir: " << gFineNodesPerDir << std::endl;
133 *out <<
"lFineNodesPerDir: " << lFineNodesPerDir << std::endl;
134 *out <<
"endRate: " << endRate << std::endl;
135 *out <<
"ghostInterface: {" << ghostInterface[0] <<
", " << ghostInterface[1] <<
", "
136 << ghostInterface[2] <<
", " << ghostInterface[3] <<
", " << ghostInterface[4] <<
", "
137 << ghostInterface[5] <<
"}" << std::endl;
138 *out <<
"meshEdge: {" << meshEdge[0] <<
", " << meshEdge[1] <<
", "
139 << meshEdge[2] <<
", " << meshEdge[3] <<
", " << meshEdge[4] <<
", "
140 << meshEdge[5] <<
"}" << std::endl;
141 *out <<
"startIndices: " << startIndices << std::endl;
142 *out <<
"offsets: " << offsets << std::endl;
143 *out <<
"coarseNodeOffsets: " << coarseNodeOffsets << std::endl;
158 for (
int dim = 0; dim < 3; ++dim) {
159 if (dim < numDimensions) {
163 if (meshEdge[2 * dim + 1]) {
164 lCoarseNodesPerDir[dim] = (lFineNodesPerDir[dim] - endRate[dim] + offsets[dim] - 1) / coarseRate[dim] + 1;
165 if (offsets[dim] == 0) {
166 ++lCoarseNodesPerDir[dim];
171 if (singleCoarsePoint_ && lFineNodesPerDir[dim] - 1 < coarseRate[dim]) {
172 lCoarseNodesPerDir[dim] = 1;
175 lCoarseNodesPerDir[dim] = (lFineNodesPerDir[dim] + offsets[dim] - 1) / coarseRate[dim];
176 if (offsets[dim] == 0) {
177 ++lCoarseNodesPerDir[dim];
184 if (interpolationOrder_ == 0) {
185 startGhostedCoarseNode[dim] = startIndices[dim] / coarseRate[dim];
186 int rem = startIndices[dim] % coarseRate[dim];
187 if (rem > (Teuchos::as<double>(coarseRate[dim]) / 2.0)) {
188 ++startGhostedCoarseNode[dim];
191 if ((startIndices[dim] == gFineNodesPerDir[dim] - 1) &&
192 (startIndices[dim] % coarseRate[dim] == 0)) {
193 startGhostedCoarseNode[dim] = startIndices[dim] / coarseRate[dim] - 1;
195 startGhostedCoarseNode[dim] = startIndices[dim] / coarseRate[dim];
201 gCoarseNodesPerDir[dim] = (gFineNodesPerDir[dim] - 1) / coarseRate[dim];
202 if ((gFineNodesPerDir[dim] - 1) % coarseRate[dim] == 0) {
203 ++gCoarseNodesPerDir[dim];
205 gCoarseNodesPerDir[dim] += 2;
209 gCoarseNodesPerDir[dim] = 1;
210 lCoarseNodesPerDir[dim] = 1;
215 if (lFineNodesPerDir[dim] < 1) {
216 lCoarseNodesPerDir[dim] = 0;
218 ghostedNodesPerDir[dim] = lCoarseNodesPerDir[dim];
220 if (ghostInterface[2 * dim]) {
221 ghostedNodesPerDir[dim] += 1;
224 if (ghostInterface[2 * dim + 1]) {
225 ghostedNodesPerDir[dim] += 1;
231 for (
int dim = 0; dim < 3; ++dim) {
232 gCoarseNodesPerDir[dim] = -1;
237 lNumCoarseNodes10 = lCoarseNodesPerDir[0] * lCoarseNodesPerDir[1];
238 lNumCoarseNodes = lNumCoarseNodes10 * lCoarseNodesPerDir[2];
239 numGhostedNodes10 = ghostedNodesPerDir[1] * ghostedNodesPerDir[0];
240 numGhostedNodes = numGhostedNodes10 * ghostedNodesPerDir[2];
241 numGhostNodes = numGhostedNodes - lNumCoarseNodes;
243 *out <<
"lCoarseNodesPerDir: " << lCoarseNodesPerDir << std::endl;
244 *out <<
"gCoarseNodesPerDir: " << gCoarseNodesPerDir << std::endl;
245 *out <<
"ghostedNodesPerDir: " << ghostedNodesPerDir << std::endl;
246 *out <<
"lNumCoarseNodes=" << lNumCoarseNodes << std::endl;
247 *out <<
"numGhostedNodes=" << numGhostedNodes << std::endl;