Fix #357: Msat=0 affects exchange #372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
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.
This PR fixes issue #357, where cells with
Msat=0
were reported to affect other cells through the exchange interaction.Background
As correctly identified by @jplauzie, this bug appeared in mumax3.10 as part of PR #115 (6303d01), which addressed an "increasing-energy" problem related to Eq. (9) of the mumax³ paper. Note that, since 3.10, Eq. (9) in the paper is no longer the actually implemented equation. Originally, it was
but this was changed in PR #115 to
In other words, since then, the exchange interaction of a spin with its neighbours has no longer been scaled by the
Msat
of each neighbour separately, but only byMsat
of the spin itself.Edge case for
Msat=0
While PR #115 solved the "increasing-energy" problem, it also caused magnets with nonzero
Msat
to be affected by neighbouringMsat=0
cells. This edge case was the underlying reason for issue #358 and has now been fixed.On a related note, but unrelated to PR #115: magnets with
Msat=0
were affected by the demag field generated by other cells. Since this is a rather weak interaction compared to exchange, functions likerelax()
were very slow if regions withMsat=0
were present. Hence, from now on, magnets withMsat=0
are no longer affected by demag fields.