Modify DMI Boundary Conditions

268 views
Skip to first unread message

MALCOM JACKSON

unread,
Jul 9, 2021, 2:38:02 AM7/9/21
to mumax2
Hi Can someone tell me the steps to modify and recompile the MUMAX source code. I want to add an additional DMI term . Is this possible?

I included an image of the current boundary conditions. Can I modify this?
Capture.PNG

jpla...@rams.colostate.edu

unread,
Jul 10, 2021, 12:15:49 AM7/10/21
to mumax2

Hello,

It is possible, although it will require some programming in golang. The download and steps for compiling Mumax on linux can be found on the github page. You'll have to modify the appropriate files. I haven't used DMI, but I would start with the DMI.go file , and possibly DMI.cu file.

You will probably have to do some testing on your own, when it comes to editing the go files directly, unless someone else has already tried to make similar changes. But the two files mentioned do have some documentation (DMI.cu in particular has comments on the boundary conditions used).

I would double check to make sure the current implementations don't already do what you need first, or if there is an existing fork somewhere, if you haven't. If i recall, version 3.10 has options for either Neumann or open BCs by default. You might also check if it can be accomplished using a custom effective field term. That said, if you do end up needing to recompile, it should mostly be tweaking the existing BCs, so you can use them for guidance.

Best,
Josh L.

MALCOM JACKSON

unread,
Sep 26, 2021, 7:07:17 PM9/26/21
to mumax2
Hi thank you Josh for your comments, and your other post on this page are also really helpful.

I was wondering , after I have modified the appropriate files, what steps should I follow after this? 
Do I need to run some sort of makefile? After I modify the file , I simply run the go install command. Is that sufficient?
I can not tell if my modifications have been made or not. The results turn out the same. 

Thank you!

 Malcolm

Josh Lauzier

unread,
Sep 27, 2021, 8:13:59 PM9/27/21
to mumax2
Hello,

All you need to do is run go install. (There is a makefile, but the go file will handle everything for you)

You shouldn't need to change anything else. As a test, i would recommend trying Mykola's directions here for building mumax from source for windows. You should be able to do this with no changes right out of the box (except perhaps an updated CUDA version) if everything is set up right. If it works, you can repeat the same process, just make your DMI changes and use go install (while inside mumax/3/cmd/mumax3/ folder) instead. (Note that by 'default' Mykola means your CUDA should be installed in C:\ , so that it's C:\cuda\bin etc).

In your other posts, you've mentioned a few errors. I suspect what is happening is you have a 32bit version of mingw installed from previous projects. I would uninstall it, and remove it from your path variables (on windows, in the search bar look for environment variables, and remove it from PATH), it may conflict as go will default to your already-installed mingw. (mysgit comes bundled with 64 bit mingw, which is a wrapper for compiling gcc on windows. you do not need to download mingw seperately). You can use your own version of mingw but it is rather picky on some of the settings. It's easier to just let mysgit and go handle it behind the scenes, you don't need to do anything beyond the instructions Mykola gave.

Another note, if you update Go versions from the one Mykola listed, there are some slight changes.

As an easy check to see if it's the new version, i would recommend changing some of the text at startup. For instance, the printed line " engine.LogOut("(c) Arne Vansteenkiste, Dynamat LAB, Ghent University, Belgium")" inside main.go , maybe add an extra line of text that says "new DMI version". If it prints "new DMI version" at startup to the command/terminal, you know it compiled yours and is calling your newly compiled executable

As far as testing your actual changes, i would recommend looking at a toy problem where you scale up your modified DMI values very high, or switch the sign or something. Something that makes it very obvious. I don't know DMI very well, but you can also try checking quantities like the total energy. Presumably your modifications should show up in the relevant quantities. A trivial example of this would be to change the periodic BC's to open BCs (which you can copy from the existing open BC code). Then if you call PBCs, but get the results for open BCs, you know it worked.

Also note inside the test folders there are some test .mx3 files the mumax guys have used to test DMI (such as dmibc.mx3 for bulk DMI BC's). You might find those useful, they're often intentionally constructed to test relevant interactions.

Best,
Josh L.

MALCOM JACKSON

unread,
Sep 28, 2021, 1:50:20 AM9/28/21
to mumax2
Perfect!
This was a frustrating process but I learned a lot.
Thank you so much for your help!

Take Care,
Malcolm


Reply all
Reply to author
Forward
0 new messages