mumax / 3

GPU-accelerated micromagnetic simulator
Other
447 stars 150 forks source link

About DMI with negative sign #236

Closed Liciou closed 4 years ago

Liciou commented 4 years ago

Recently,I set DMI in two regions with opposite sign,however,when I input"relax()",the cmd is closed and the mumax shows disconnected after a period of process of calculating demag kernel.I;m wondering why. 图片

JeroenMulkers commented 4 years ago

Thank you for reporting this issue.

Mumax3 does not seem to handle DMI interfaces correctly if the two DMI strengths do not have the same sign. By default, mumax3 takes the harmonic mean of exchange and DMI parameters at the interface. The harmonic mean of two values is nonsensical if there is a sign difference, and becomes infinite if the absolute values are the same. This explains the error message.

We could solve this issue by taking the arithmetic mean if the DMI strengths do not have the same sign. In this case, however, the interpolation of the DMI strengths D1 and D2 is no longer continuous at D1=0 or D2=0.

A less trivial way to average/interpolate DMI strengths with an opposite sign is by taking the geometric mean of the geometric mean and the arithmetic mean (see code below). This looks a bit ugly, but it is continuous everywhere, monotonic increasing, and bounded by the two DMI strengths. Furthermore, it reduces to the harmonic mean if the DMI strengths have the same sign, which ensures maximal backwards compatibility.

if sign(D1) == sign(D2) {
    Di = 2*D1*D2/(D1+D2) // harmonic mean 
} else {
    Di = sign(D1+D2) * sqrt( sqrt(-D1*D2) * |D1+D2|/2)
}

Let me know if you know a better way to interpolate/average the DMI strengths at material interfaces. If I get no response, I will implement the 'less trivial' interpolation.

Liciou commented 4 years ago

Thanks for telling me this. And I'm looking forward to next release to realize more complex simulations.