Utility function for fixing up guard cells of zShift
| 1358 | namespace { |
| 1359 | // Utility function for fixing up guard cells of zShift |
| 1360 | void fixZShiftGuards(Field2D& zShift) { |
| 1361 | auto localmesh = zShift.getMesh(); |
| 1362 | |
| 1363 | // extrapolate into boundary guard cells if necessary |
| 1364 | zShift = interpolateAndExtrapolate(zShift, zShift.getLocation(), |
| 1365 | not localmesh->sourceHasXBoundaryGuards(), |
| 1366 | not localmesh->sourceHasYBoundaryGuards(), false); |
| 1367 | |
| 1368 | // make sure zShift has been communicated |
| 1369 | communicate(zShift); |
| 1370 | |
| 1371 | // Correct guard cells for discontinuity of zShift at poloidal branch cut |
| 1372 | for (int x = 0; x < localmesh->LocalNx; x++) { |
| 1373 | const auto lower = localmesh->hasBranchCutLower(x); |
| 1374 | if (lower.first) { |
| 1375 | for (int y = 0; y < localmesh->ystart; y++) { |
| 1376 | zShift(x, y) -= lower.second; |
| 1377 | } |
| 1378 | } |
| 1379 | const auto upper = localmesh->hasBranchCutUpper(x); |
| 1380 | if (upper.first) { |
| 1381 | for (int y = localmesh->yend + 1; y < localmesh->LocalNy; y++) { |
| 1382 | zShift(x, y) += upper.second; |
| 1383 | } |
| 1384 | } |
| 1385 | } |
| 1386 | } |
| 1387 | } // namespace |
| 1388 | |
| 1389 | void Coordinates::setParallelTransform(Options* options) { |
no test coverage detected