A couple of days ago there was a question posted in my OOmmf tutorial post.
My answer is that I don’t know a way of doing it inside OOmmf (although, there might be one, but my knowledge is limited). So, I’m going to show how I will do it outside OOmmf with Matlab and using my script for importing the magnetization into Matlab. (If you want to see other OOmmf examples, I recommend reading my other OOmmf posts).
So, first, let’s create a problem with a Py disk where the magnetic field is going to rotate around the disk moving the vortex core.
These are the options for the mmProbEd. I start by choosing Py from the materials list.
For the part geometry, I’m guessing, but one of my colleagues has done some experiments with Nickel disks, and I think about 2 micron in diameter will be enough to have a vortex. (Since this is just a test, I’m using 10 nm cell size, but a proper simulation on Py should be at least 5 nm).
I choose to start with random magnetization, and after the initial evolution from the random state into stable state, I’m applying 5 field steps that are going to produce a circular movement of the vortex’s core (the magnitude has been chosen after a few trial and error).
The next step is very important in order to be able to import the data into Matlab as I did in (OOmmf 2), we need to specify text %g as output format.
The problem is now ready. Without closing the mmProbEd window, we open one mmDisp to visualize the magnetization evolution, one mmArchive to store the data, and the mmSolve2D to run the simulation.
So, lets run the simulation. I choose to visualize the magnetization every 50 iteration steps and to save the data every control point (I put 10 steps per applied field). This is how the simulation looks like at different stages.
Now, by using the method I explained in my OOmmf 2 tutorial, you can turn the data files into images and using a photo editing program, you can create an animation like this where we can see the movement of the vortex core in response of the applied field.
Now to extract the position of the core. To do that, I use my Matlab script to import the magnetization vector files we saved.
>> data=oommf2matlab('disk.field0010-pass20294.omf'); >> quiver(data.positionx(1:10:end,1:10:end),data.positiony(1:10:end,1:10:end),data.datax(1:10:end,1:10:end),data.datay(1:10:end,1:10:end),0.5)
Will produce a graph like this (I’m plotting one every 10 data points).
An easy way of detecting the position of the vortex is looking for a vector with z component of the magnetization (the centre of the vortex will be pointing up). The next code will draw a circular marker at the position of the core.
>> hold on [a,b]=size(data.datax); for k=1:a for j=1:b if data.dataz(k,j)>0.2e-5 plot(data.positionx(k,j),data.positiony(k,j),'ro') end end end
It will look like this
Or by putting together all the positions:
Unfortunately, this is far from perfect. A better way of doing it will be using divergence. But it is a quick fix that will work… (suggestion, play a little bit with the threshold in Matlab).
By the way, data.positionx(k,j) and data.positiony(k,j) are the data needed to answer the question shown at the beginning of the post.
My final though. If you want to combine this to some kind of automatic testing, visit my OOmmf 3 tutorial and find a way of generating the mif scripts automatically.