Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While the newly added
EdgeCarryShift
(proposed in #316) worked as mathematically expected, the original implementation allowed nonphysical situations to arise where the zero magnetization(0,0,0)
from edge cells outside the geometry was copied to cells which, after shifting, lay inside the geometry.To address this, cells which would have been assigned the zero-vector, but are actually inside the geometry, are instead assigned the vector
ShiftMagL
,ShiftMagR
,ShiftMagD
orShiftMagU
(depending on the shift direction).Observe an example of the updated
EdgeCarryShift
behavior below.A slanted geometry with random initial magnetization is shifted 32 cells to the right. As
EdgeCarryShift = true
, the left edge values are applied to all the newly introduced cells. For the cells at the very bottom of the new geometry, those left edge cells were outside the geometry, so the vectorShiftMagL
is applied (set to(-1,0,0)
here). The pre-bugfix behavior was that these bottom cells would have magnetization(0,0,0)
(grey).I also implemented the
geom.GetCell()
method, which allows a sanity check in the updatedtest/edgeCarryShift.mx3
test script.