Fix bug from #372 that made B_demag==0 where Msat==0#381
Merged
JonathanMaes merged 1 commit into3.11.2from Mar 18, 2026
Merged
Conversation
…g from SetDemagField to SetLLTorque
JLeliaert
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As reported by @ac2290 on GitHub and the mailing list, PR #372 (included in mumax3.11.1) set
B_demagto zero outside the geometry (whereMsat==0), preventing users from obtaining stray fields.Fix
The (inverse) zero-masking by
Msatapplied in the previous fix was moved fromSetDemagFieldtoSetLLTorque. This...B_demagvariable back to its pre-3.11.1 behaviour (see validation 2), i.e., it is once again nonzero outside the geometry.mvector whereMsat==0(see validation 3). Indeed, recall from Fix #357: Msat=0 affects exchange #372 that cells withMsat==0should not experience a torque, since this makesrelax()converge incredibly slowly.Validation
As expected, this fix does not change the results of
test/msatzero.mx3.The behavior of the script in the aforementioned mailing list issue returns to how it was in mumax3.11.0 and earlier. Indeed, the top-down view of
B_demag000050.ovfgenerated by this mailing list script in different mumax versions is as follows:The script of the original issue (Minor) change in exchange nonmagnetic boundary behavior from mumax3.9.3 to Mumax 3.10 #357 (where the right half of the system has
Msat=0) yields the following relaxedmin different mumax versions: