Implementation of Two-Dimensional Polycrystalline Grains in Object Oriented Micromagnetic Framework

In response to the growing need for a more accurate micromagnetic model to understand switching phenomenon in nanoscale magnets, we developed the capability to simulate two-dimensional polycrystalline grains using the Object Oriented Micromagnetic Framework (OOMMF). This addition allows users full flexibility in determining the magnetocrystalline anisotropy and axe in each grain as well as the inter- and intragranular exchange coupling strength.

The details of each step are summarized below. Other OOMMF specific references, such as Oxs child classes, can be found in the OOMMF User's Guide [3], available online at http://math.nist.gov/oommf/.

A. Generating Grain Maps
The executable named voronoi is used to generate a random 2D grain map in the PPM (portable pixmap) bitmap image format. The command line switches -x, -y, and -g specify the number of pixels along the x and y directions and the number of grains, respectively. The executable defaults to a grain map of 512 pixels × 128 pixels and 2000 grains. When imported into a MIF file, the grain map will be automatically resized to fit the simulation dimensions; however it is recommended that the number of pixels along the x and y directions in the grain map closely match the number of simulation cells specified in the MIF file so that resizing errors may be minimized.
The grain maps produced by the executable voronoi are colored in a red-blue-green combination scheme, such that each grain has a unique 6 character designation in the form #rrggbb. Each of the 6 positions in rrggbb can take a hex digit value (i.e, 0-9 or A-F). The theoretical maximum number of grains that can be colored this way is therefore 16 6 = 2 24 (24-bit color). The optional command line switches -nored, -nogreen, -noblue may be used to restrict the output color space; this can be useful for rogue grain selection, as described below.
In the OOMMF simulation, the grains as described by the grain map are projected through the film. A full three dimensional simulation is possible using a single (two dimensional) grain map with the caveat that each grain traverses the entire thickness, orthogonal to the defined view-plane. On the other hand, it is possible to define multilayers with a unique grain map associated with each layer. In the case of a single layer material, the 2D through-grains assumption may be a reasonable approximation if the layer thickness is comparable to the grain size.

B. MIF File Specifications
Appendices A and B present two examples of MIF files for polycrystalline samples. Appendix A is for a material with uniaxial magneto-crystalline anisotropy; a somewhat more complicated example involving cubic anisotropy is shown in Appendix B.
In both cases, the MIF files begin with the line The xrange, yrange, zrange parameters specify the simulation dimensions in meters, while the viewplane xy parameter tells the atlas to orient the grain map (as specified by the image parameter) with the xy-plane.
In pre-2.2 versions of MIF, the Oxs_ImageAtlas object required an explicit list of colors and region names. However, starting with MIF 2.2, the colorfunction auto option may be used instead to automatically assign distinct logical regions to each color occuring in the image. The assigned region names have the form #rrggbb, where rrggbb represent the 24-bit color of each grain as described earlier. In general, the user does not need to know the specific region names; the fact that each color (and hence grain) is assigned to a distict region is sufficient to assign different easy axis orientations, magneto-crystalline anisotropy and exchange coupling to each grain. The one exception is the case where one wants to assign particular properties to a particular grain; this is the case with "rogue grain" assignment, which is discussed below.
In Appendix A, a material with uniaxial anisotropy is modeled that has uniform K1, but with each grain having an easy axis randomly selected within the confines of a texture cone, that is, the anisotropy directions are distributed with equal probability within a cone symmetric about the z-axis with semiangle defined by the variable phideg. To do this, a list with an even number of elements is constructed; the first element in each pair is the name of an atlas region (i.e., grain), and the second is a three-element sublist providing the (x, y, z) coordinates (directional cosines) of the axis. A list of all the grain regions is obtained via a call to the GetAtlasRegions command, If one wants the axis to be randomly selected from the whole unit sphere, as opposed to from inside the texture cone, then one can copy the RandomUnitVec proc from Appendix B into the MIF file, and replace the call to Texture with a call to RandomUnitVec. In addition to setting the random vectors, this code also allows the specification of a list of "rogue" grains, where the axes are not chosen uniformly, but are peremptorily set to, say, (1, 0, 0) (i.e., the x-axis). The rogue grain list is set earlier in this MIF file as The Rogue list is a list of region names, but since the region names are determined by their color in the grain map, this is equivalent to selecting the grains by color. Many image viewers display the rgb-component values of a pixel selected by the user, so the grain map can be used to interactively select rogue grains. (As an alternative, rogue grains can be selected by position. This approach is explained below in the discussion covering Appendix B.) Once the axes list is constructed, the anisotropy is specified by In this code, the list A_list is constructed three elements at a time. The variable A_intragrain is the exchange coupling inside each grain, in J/m. In this example, this coupling is the same for all grains, but this could be varied if desired. The intragrain coupling list is used to set parameter A in the Oxs_Exchange6Ngbr specify block. The otherwise unspecified intergrain coupling is handled by the default_A parameter.
Intergranular coupling can be turned on or off by adjusting the value of A_intergrain. This may be a useful option for continuous granular media applications where decoupled grains are desirable. For fully exchanged grains as in patterned media applications, Oxs_UniformExchange may be used in place of Oxs_Exchange6Ngbr.
The remainder of the MIF file sets up an applied field, and specifies the evolver and driver to use. These are standard MIF blocks that do not involve any polycrystalline-specific features. See the OOMMF User's Guide for details. Journal of Research of the National Institute of Standards and Technology Appendix B provides an example using a material, such as Ni, that has cubic anisotropy. Setting up cubic anisotropy is similar to that for uniaxial anisotropy, except that instead of specifying a single easy axis, two orthogonal axes are required. (The third anisotropy axis is computed as the cross product of the other two.) Whereas in the uniaxial case a single list named axes was constructed interleaving region names and axes, in this case two lists are constructed, A_axes and B_axes. A_axes is constructed by calling the Texture proc for each grain; this produces an axis inside the texture cone defined by phideg, exactly as in the uniaxial case. The second axis, which is stored in B_axes, is constructed by picking a random vector on the unit sphere, and then crossing that vector with the associated A_axes axis element: This second axis is fully random subject to the constraint that it be orthogonal to the first axis.
Once A_list and B_list are complete, a vector field object is built with each list, and the cubic anisotropy is specified via As in the uniaxial case, rogue grain selection is built into the axis lists using a user-specified list, Rogue, of grain region names. In this example, however, the rogue list is populated by the code segment Here the GetAtlasRegionByPosition command is used to correlate a spatial location (in problem coordinates, in meters) with the region (i.e., grain) containing that location. The problem coordinates may be determined using the technique described in the following section to view the anisotropy axes in mmDisp, and then using :〈Shift〉+〈left mouse click〉 to reveal to coordinates under the mouse cursor.

C. Visualize and Saving Anisotropy Axes
The grain anisotropy axes information may be displayed or saved through the OOMMF mmDisp viewer utility. First load a pre-simulation where the initial magnetization setting in the Driver Specify block uses the same vector field that is used to set the anistropy axis; in the uniaxial example of Appendix A that means to replace (For the cubic anisotropy example, use :A_axes or :B_axes in place of :axes.) Once the problem is loaded into the OOMMF Oxsii application, send the driver "Magnetization" output to mmDisp, from which the axis directions can be directly viewed. One can also write these data to disk from mmDisp, but note that it will be necessary to divide each entry by the saturation magnetization M s in order to recover the unit axes vectors.

Results With Polycrystalline OOMMF
The polycrystalline Co/Pd multilayer system is regarded as a promising candidate for patterned media applications [4][5][6]. Nanodots ≤ 200 nm are perpendicularly magnetized and typically switch in the single domain regime [5]. The easy axes for the material lies along the < 111 > and is thought to be uniaxial. Additionally, the < 111 > texture along the surface normal is thought to be a cause of the perpendicular magnetization [7][8][9]. Experimental evidence has suggested that switching in this system was triggered by local pockets of volume with dimensions on the same order as the grain size [6].
We used polycrystalline OOMMF to model a 100 nm disc, 6 nm thick, to mimic the experiment from Lau et all [1] in order to further understand the role of grain orientation. The cell dimensions are 1 nm laterally, and 3 nm along the thickness direction, giving a total of N x = N y = 100 and N z = 2 cells along the x, y, and z directions.  Table 1.  Fig. l b shows the magnetization along the z-direction at the point of switching. The 100 nm dot was initially magnetized along the -z-direction (blue). Applying a field along the +z-direction causes the magnetization in the dot to rotate towards the +z direction (red). The white contrast within the dot means that the local magnetization is within the xy plane.
There is a one-to-one correspondence between the offaxis grains (purple regions, Fig. l a) and the region of least perpendicular magnetization (regions in white Fig. l b). Furthermore, magnetization reversal from the -z to +z direction occurs at the site of the heaviest off-axis grain concentration.

Conclusion
We have fully integrated 2D polycrystalline capability for simulating sub-100 nm magnets in OOMMF. Magneto-crystalline anisotropy magnitude and direction, as well as exchange coupling strength may be defined separately for each grain. In an example, we showed that polycrystallinity plays a significant role in the magnetization reversal mechanism in perpendicularly magnetized nanodots. Our results corroborate previous experimental observations.  shot near the coercive field of a magnetization reversal simulation using the system described in (a). The dot was initially perpendicularly magnetized along the -z-direction (blue). The dot is expected to be red (magnetized along the +z-direction) once the reversal is complete. Magnetization is primarily in-plane (white shadows) at the locations where perpendicular magnetization is weakest (corresponds to purple grains from (a). Here a localized concentration of off-axis grains is seen to trigger the onset of reversal (red spot).