8000 Fix #357: Msat=0 affects exchange by JonathanMaes · Pull Request #372 · mumax/3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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
merged 6 commits into from
Jun 17, 2025
Merged

Conversation

JonathanMaes
Copy link
Contributor

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

$$\vec{\boldsymbol{\mathrm{B}}}_\mathrm{exch} = 2 S \frac{2\frac{A_\mathrm{ex1}}{M_\mathrm{sat1}}\frac{A_\mathrm{ex2}}{M_\mathrm{sat1}}}{\frac{A_\mathrm{ex1}}{M_\mathrm{sat1}}+\frac{A_\mathrm{ex2}}{M_\mathrm{sat1}}} \sum_i \frac{(\vec{\boldsymbol{\mathrm{m}}}_i - \vec{\boldsymbol{\mathrm{m}}})}{\Delta_i^2} \mathrm{,}$$

but this was changed in PR #115 to

$$\vec{\boldsymbol{\mathrm{B}}}_\mathrm{exch} = \frac{2S}{M_\mathrm{sat1}} \frac{2 A_\mathrm{ex1} A_\mathrm{ex2}}{A_\mathrm{ex1}+A_\mathrm{ex2}} \sum_i \frac{(\vec{\boldsymbol{\mathrm{m}}}_i - \vec{\boldsymbol{\mathrm{m}}})}{\Delta_i^2} \mathrm{.}$$

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 by Msat 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 neighbouring Msat=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 like relax() were very slow if regions with Msat=0 were present. Hence, from now on, magnets with Msat=0 are no longer affected by demag fields.

@JonathanMaes JonathanMaes requested a review from JLeliaert June 17, 2025 12:01
@JonathanMaes JonathanMaes merged commit 9ae4126 into 3.11.1 Jun 17, 2025
@JonathanMaes JonathanMaes deleted the bugfix/MsatZeroExchange branch June 17, 2025 13:49
@JonathanMaes JonathanMaes mentioned this pull request Jun 17, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0