OOmmf is a micromagnetic simulation software. A program to simulate magnetism inside a 2D material using as a premise that the magnetization can be viewed as produced by millions and millions of spins (micro – magnetic).


This software is the product of ITL (Information Technology Laboratory) a group inside NIST (National Institute of Standards and Technology).

It started as a prototype, and they always said that it is a prototype, but in fact, it has become a popular software among the users of low performance magnetic modelling software. (In their web page you can see about 1400 papers where they use it, and that is only a part of all the papers that use it).


So, let’s go with the installation. Step one, go to the download area.

In my case, I need the windows version, 64 bits.

Source with pre-compiled 64-bit Windows executables (x64) for 64-bit Tcl/Tk 8.5.x, pkzipped archive (15 253 491 bytes).

After downloading, unzip…. and… and you cannot use it. Because this software uses TCL language and TK graphic interface. Which means (as java based programs) that you need to install
another program before running it.

For advanced people there is a long way around, which includes installing binaries and such things… Fortunately, there is a short cut for us, and is called ActiveTcl.


Is a prebuilded version of the TCL TK developing tools that will interpret the code in the OOmmf scripts.

Just go to his webpage and download the correct version for your OS. Once you have it in your computer, just run and install it.

Now you can go to your OOmmf folder an try to run oommf.tcl because of ActiveTcl, now it will run.

When you run the program, a window will appear, indicating the computer (Virgilio in my case), and the user (myself, Hector), just select them.

initializeThis is the main menu where all the action takes place. For now, the only interesting buttons are:

mmDisp that will open a display window to show the system under simulation.

mmProbEd that will allow you to set up the parameters of the simulation such initial state, geometry, external fields applied during the simulation, material type…

mmSolve2D this will generate the grid division of the system under simulation, that grid will be used to simulate the system as formed by thousands of micro domains

Ok, now is time for fun. But instead of using the boring examples that came with the program, we are going to go through an experimental one.

A few days ago, I used a Scanning Prove Microscopy (to remember what this is, go to this old post) to take images of a square made of Permalloy (Ni20Fe80). This is the topography image.

001aAnd this is the magnetic image.


The particularity of Py is that when disposed in thin films (this square is about 20 micrometers side and has a heigth of 20 nanometers ) induces the magnetization to lay on the main plane defined by the geometry (in this case, the magnetization is mainly laying on your screen). What we see in the magnetic image is a series of 4 lines, those lines represent domain walls between domains with magnetization pointing in different directions.

Ok ok, enough. So, how to simulate this system? To do a experimental approach, we are going to use the topography as a mask for OOmmf. A mask is a image (a *.gif file in this case) made of black and white which represents in black where the material is in the system. In our case, I took the topography image and after playing with it, I made this one (click on it and download it).


To use this image, download it and put it into OOmmf main folder (where the executable is).

Now, let’s go for the simulation. First, click on mmDisp to open a display window.

Second, click on mmProbEd, this will open the next menu.


Here we can change many things, but now we only need to change a little bit the parameters.

Click on Material Parameters and in material type choose Permalloy. And the only thing you need to change is setting the damping coefficient to 0.5 (This coefficient is just technical, inside Landau–Lifshitz–Gilbert equation it fixes how fast the evolution of the magnetization converges).


The second thing you need to change is the Part Geometry. In that menu, you need to put the size of the mask, which is about 30 micrometers, and the thickness, which is about 20 nanometers. In this case I choose 50 nanometers for the cell size. This is more a try and error process, where you have to deal with simulation time and validation of results.


And finally, the Initial Mag. Just check the initial magnetization as random.

probedNow go back to the main menu and click on mmSolve2D. That will create the simulation, it will appear as a tick box on the right side of the menu, click on it and you will go into the simulation menu. On that menu, the first thing you need to do is load the problem and then select what you want to show in the display window. In our case, we want the total field to be displayed every 100 iterations in the display window that we create before.

probedAnd now you are ready! Hit run or relax to see how the magnetization evolves from this random initial state.

On the display window will appear something like this…


not very impressive, but if you choose the right parameters on the configuration and on the view menu…

probedNow the display looks more nice.


And after a long long time…. you get the stable magnetic configuration.


And that’s all for this tutorial.




Hey! Hold on, wait a second. That doesn’t look like the measured magnetization!

Where is the problem?

The problem is instabilities. This program tends to find solutions that are unstable in real world but are perfectly valid in simulations. How do we get rid of them?

One trick is use thermal noise (which I don’t know how to simulate in this program), the other trick is applying a gently magnetic field and reversing it. That is know as demagnetization. Sometimes it helps to get rid of unstable domains and allows the magnetization to evolve.

So, let’s go back to the mmProbEd and check Experiment Parameters. Here we can specify the applied magnetic field (direction and magnitude), and also for how many steps we want to apply it. The steps indicate how many stable solutions we want to find while the field is applied.


Here I have selected applying 10mT along the x-axis, first in the positive direction, later in the negative, and finally stop the field.

After setting this, repeat the simulation. The final result is now…


Ok, it’s still not the same, but now is closer.  A proper simulation will require even smaller cell size (wich will take several days of simulation).





What? Want more? Ok, here is a short animation I made with images of the square nanostructure taken while it was evolving in a magnetic field. Try to reproduce them with OOmmf!


33 thoughts on “OOmmf”

  1. Hi.
    It would be great if you could tell me, that how to apply a sinosoidal field (i.e. a time varying field) to a particular area of the device geometry?
    I have tried and searched in the user-guide of OOMMF but am unable to figure it out.

    Thanks in advance.

    1. I discussed this with two colleages.
      None of us did something like that in the past. If you go to the documentation, page 56. There is something about what you need, but is not for beginners level. I don’t know how to program it, if you try, please, tell us about the results. Another problem with what you propose, is the time needed for the simulation. A time varying field like the one you want could imply several days to get decent solutions.I will not try it if I don’t have any experience from other people to tell me that the solutions are correct, could be a huge lost of time with nice solutions but all wrong.

  2. Hi, I am a beginner and am doing 3D simulations. I am finding some difficulties while loading an image file. Will you please help?
    Thanks in advance..

      1. Thanks for response…are writing any .mif(2.1) file? then I can can tell you more specifically. actually there is some error in image atlas

  3. hi héctor , in the furst Thanks for response i want learn about theTheory of oommf (LLG)and understand how use oommf , in my thesis (master physique appliquée) i want doing a simulation of the metal fe3o4 , auther thing i want learning about how adding a new termes energie in the oommf . and a new thanx for your answer

  4. Pingback: 2 years old |
  5. Hi, I am beginner in OOMMF, doing 3D simulation. I have to abort my program after running it for 4 hours. The data upto that time is saved in archive. Now I want to start my program from that point, where I aborted. Please tell me what change I should do in the input file for the program.

  6. Pingback: OOmmf 3 |
  7. Dear friends!
    I’m a beginner and it’s for first time that I want to work with oommf.
    If it’s possible, please describe it for me that for example how I can simulate a “NOT gate”?
    as you know the simplest “NOT gate” is composed of 3 rectangular cell that their magnets are aligned in opposite direction or in other words it can be built simply using horizontal wires with an odd number of elements

  8. Hi, I’m new with oommf. I have problem, I do everything step by step but the destination thread and schedule is empty in my program. I have no idea why? So I can’t start any example. Please help me.

    1. The area represented in the image will have the dimension you specified when preparing the problem (part width and part height). In my example above, it was 30E-6m by 30E-6m. Using those values you can measure the side of the image and the size of your domain and calculate the real size.

  9. Hi. I’m trying to plot the position of a vortex core in a sub-micrometer disk as a function of time/applied field, but I can’t find a way to only send data for a specific magnetization strength/coordinate to mmGraph. Is there a way to do this using mmSolve2D?

    Please let me know whenever you can.

      1. Sort of. I’m an undergrad doing my first bit of research, and this is part of my introduction to doing lab work.

    1. Dynamics should be approached with caution, sometimes the algorithm used for static solutions is not valid for dynamic conditions. In the case of OOMMF, I’m not an expert, I always try to simulate situations where I have some experimental knowledge in order to compare the results. I haven’t seen any group simulating a laser inside OOMMF, I suggest asking in the email list to see if there is somebody already working on it.

      1. Thanks for reply, also, can we use Python code for simulating a laser as magnetic field and call this code in OOMMf

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s