MCPcopy Create free account
hub / github.com/boutproject/BOUT-dev / fixZShiftGuards

Function fixZShiftGuards

src/mesh/coordinates.cxx:1360–1386  ·  view source on GitHub ↗

Utility function for fixing up guard cells of zShift

Source from the content-addressed store, hash-verified

1358namespace {
1359// Utility function for fixing up guard cells of zShift
1360void 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
1389void Coordinates::setParallelTransform(Options* options) {

Callers 1

setParallelTransformMethod · 0.85

Calls 8

communicateFunction · 0.85
getMeshMethod · 0.80
hasBranchCutLowerMethod · 0.80
hasBranchCutUpperMethod · 0.80
getLocationMethod · 0.45

Tested by

no test coverage detected