OOMMF Home next up previous contents index
Next: Data table format (ODT) Up: File Formats Previous: File Formats

Subsections


Problem specification format (MIF)

Micromagnetic simulations are specified to the OOMMF solvers using the OOMMF Micromagnetic Input Format (MIF). There are two distinct, incompatible versions of this format. The first, version 1.1, is the format used by the 2D solver ( mmSolve2D and batchsolve) and the mmProbEd problem editor. The new MIF format, version 2.0, is used by the Oxs 3D solver (Oxsii). In both cases all values are in SI units. A command line utility mifconvert is provided to aid in converting MIF 1.1 files to the MIF 2.0 format. For both versions it is recommended that MIF files be given names ending with the .mif file extension.


MIF 1.1

A sample MIF 1.1 file is included below. The first line of a MIF file must be of the form ``# MIF x.y'', where x.y represents the format revision number. (There was a MIF 1.0 format, but it was never part of a released version of OOMMF.)

After the format identifier line, any line ending in a backslash, `\', is joined to the succeeding line before any other processing is performed. Lines beginning with a `#' character are comments and are ignored. Blank lines are also ignored.

All other lines must consist of a Record Identifier followed by a parameter list. The Record Identifier is separated from the parameter list by one or more `:' and/or `=' characters. Whitespace and case is ignored in the Record Identifier field.

The parameter list must be a proper Tcl list. The parameters are parsed (broken into separate elements) following normal Tcl rules; in short, items are separated by whitespace, except as grouped by double quotes and curly braces. The grouping characters are removed during parsing. Any `#' character that is found outside of any grouping mechanism is interpreted as a comment start character. The `#' and all following characters on that line are interpreted as a comment.

Order of the records in a MIF 1.1 file is unimportant, except as explicitly stated below. If two or more lines contain the same Record Identifier, then the last one takes precedence (except for Field Range records, of which there may be several active). All records are required unless listed as optional. Some of these record types are not yet supported by mmProbEd, however your may edit a MIF 1.1 file by hand and supply it to mmSolve2D using FileSource.

For convenience, the Record Identifier tags are organized into several groups; these groups correspond to the buttons presented by mmProbEd. We follow this convention below.

Material parameters

Demag specification

Part geometry

Initial magnetization

Experiment parameters

The following records specify the applied field schedule:

Output specification

Miscellaneous



# MIF 1.1
#
# All units are SI.
#
####################### MATERIAL PARAMETERS ############################
Ms:  800e3                 # Saturation magnetization in A/m.
A:   13e-12                # Exchange stiffness in J/m.
K1:  0.5e3                 # Anisotropy constant in J/m^3.
Anisotropy Type: uniaxial  # One of <uniaxial|cubic>.
Anisotropy Dir1: 1 0 0     # Directional cosines wrt to coordinate axes

####################### DEMAG SPECIFICATION ############################
Demag Type: ConstMag # One of <ConstMag|3dSlab|2dSlab|3dCharge|FastPipe|None>.

########################## PART GEOMETRY ###############################
Part Width:     0.25e-6    # Nominal part width in m
Part Height:    1.0e-6     # Nominal part height in m
Part Thickness: 1e-9       # Part thickness in m.
Cell Size:      8.1e-9     # Cell size in m.
#Part Shape:    # One of <Rectangle|Ellipse|Oval|Mask>.  Optional.

###################### INITIAL MAGNETIZATION ###########################
Init Mag: Uniform 90 45 # Initial magnetization routine and parameters

###################### EXPERIMENT PARAMETERS ###########################
Field Range: -.05 -.01 0. .05 .01 0. 100 # Start_field Stop_field Steps
Field Range: .05 .01 0. -.05 -.01 0. 100
Field Type: Multi 4 \
 7 Ribbon 1 0 1.0e-6 0.25e-6 1.0e-6 1e-9 \
 7 Ribbon 1 0 0     0.25e-6 0     1e-9 \
 9 Tie 100 0 0 0.12e-6 0.5e-6 0.13e-6 0.5e-6 8.1e-9 \
 1 Uniform
# The above positions ribbons of positive charge along the upper
# and lower edges with strength Ms, applies a large (100 Ms) field
# to the center cell, and also applies a uniform field across the
# sample stepped from (-.05,-.01,0.) to (.05,.01,0.) (Tesla), and
# back, in approximately 0.001 T steps.

Default Control Point Spec: -torque 1e-6 # Assume equilibrium has been
# reached, and step the applied field, when the reduced torque |mxh|
# drops below 1e-6.

###################### OUTPUT SPECIFICATIONS ###########################
Base Output Filename: samplerun
Magnetization Output Format: binary 8 # Save magnetization states
# in binary format with full (8-byte) precision.

########################## MISCELLANEOUS ###############################
Randomizer Seed: 1   # Value to seed random number generator with.
User Comment: This is an example MIF 1.1 file, with lots of comments.
Figure 4: Example MIF 1.1 file. (Description.)



MIF 2.0

The MIF 2.0 format was introduced with the Oxsii 3D solver. It is not backwards compatible with the MIF 1.1 format, however a conversion utility, mifconvert, is available to aid in converting MIF 1.1 files to the MIF 2.0 format.

A sample MIF 2.0 file is included below. The first line of a MIF file must be of the form ``# MIF x.y'', where x.y represents the format revision number, here 2.0. Unlike MIF 1.1 files, the structure of MIF 2.0 files are governed by the requirement that they be valid Tcl scripts. During processing MIF 2.0 files are evaluated inside a Tcl safe interpreter. Safe interpreters disable certain commands (for example, disk input/output), but otherwise the full power of the Tcl scripting language is available for use inside a MIF 2.0 file. Two special commands, Specify and Miscellaneous, are used to communicate to the solver the details of the problem to be solved.

Specify Block

An OXS simulation is built as a collection of Oxs_Ext (OXS Extension) objects. Each Oxs_Ext object is specified and initialized in the input MIF 2.0 file using the Specify command. The Specify command takes two arguments: the name of the Oxs_Ext object to create, and an initialization string which is passed on to the Oxs_Ext object during its construction. The objects are created in the order in which they appear in the MIF file, so order is important in some cases. In particular, if one Oxs_Ext object refers to another in its initialization string, then the referred to object must precede the referrer in the MIF file.

Here is a simple Specify block:

Specify Oxs_EulerEvolve:foo {
  alpha 0.5
  start_dm 0.01
}
The name of the new Oxs_Ext object is ``Oxs_EulerEvolve:foo.'' The first part of this name, up to the colon, is the the C++ class name of the object. Here Oxs_EulerEvolve is a class that integrates the Landau-Lifshitz ODE using a simple forward Euler method. This must be a child of the Oxs_Ext class. The second part of the name (following the colon), is a name for this particular instance of the object. In general, it is possible to have multiple instances of an Oxs_Ext child class in a simulation, but each instance must have a unique name. These names are used for identification by output routines, and to allow one Specify block to refer to another Specify block appearing earlier in the MIF file. If the second part of the name is not given, then as a default the empty string is appended. (E.g., if instead of ``Oxs_EulerEvolve:foo'' above the name was specified as just ``Oxs_EulerEvolve'', then the effective full name of the created object would be ``Oxs_EulerEvolve:''.)

The second argument to the Specify command is an arbitrary string that is interpreted by the new Oxs_Ext (child) object in its constructor. The format of this string is up to the designer of the child class, but it is recommended that the string be structured as a Tcl list with an even number of elements, with each pair consisting of a key + value pair. This is the format followed by all Oxs_Ext classes released by the OOMMF team. (Refer to the Oxsii documentation for more details on the individual Oxs_Ext child classes.)

In the above example, the initialization string consists of two key + value pairs, ``alpha 0.5'' and ``start_dm 0.01''. The first specifies that the damping parameter $ \alpha$ in the Landau-Lifshitz ODE is 0.5. The second specifies the initial step size for the integration routine. Interested parties should refer to a Tcl programming reference (e.g., [15]) for details on forming a proper Tcl list, but in this example the list as a whole is set off with curly braces (``{'' and ``}''), and individual elements are white space delimited.

Sometimes the value portion of a key + value pair will itself be a list, as in this next example:

Specify Oxs_RectangularMesh:mesh {
  cellsize {10e-9 10e-9 10e-9}
  atlas Oxs_SectionAtlas:WorldAtlas
}
Here the value associated with ``cellsize'' is a list of 3 elements (the sampling rate along each of the coordinate axes, in meters). Notice also that the ``atlas'' value refers to an earlier Oxs_Ext object, ``Oxs_SectionAtlas:WorldAtlas''.

A Specify block may also include embedded Oxs_Ext objects. This is frequently used to initialize a spatially varying quantity. For example,

Specify Oxs_UniaxialAnisotropy {
  axis { Oxs_RandomVectorFieldInit {
             min_norm 1
             max_norm 1
         }
  }
  K1  { Oxs_UniformScalarFieldInit { value 530e3 } }
}
This magneto-crystalline anisotropy object has a cell-wise randomly distributed easy axis. To initialize its internal data structure, Oxs_UniaxialAnisotropy creates a temporary Oxs_RandomVectorFieldInit object. This temporary object is also a child of the Oxs_Ext hierarchy--this allows it to be constructed using the same name-lookup machinery invoked by the Specify command--but the temporary is known only to the enclosing Oxs_UniaxialAnisotropy object, so it cannot be referenced from other Specify blocks. It also does not need to be given an instance name. It does need an initialization string, however, which is given here as the 4-tuple ``min_norm 1 max_norm 1''. Notice how the curly braces are nested so that this 4-tuple is presented to Oxs_RandomVectorFieldInit as a single item, while ``Oxs_RandomVectorFieldInit'' and the associated initialization string are wrapped up in another Tcl list, so that the value associated with ``axis'' is parsed at that level as a single item.

The Oxs_UniaxialAnisotropy class also supports cell-wise varying K1, so the value associated with ``K1'' is another embedded Oxs_Ext object. In this particular example, however, K1 is uniform throughout the simulation region, so the trivial Oxs_UniformScalarFieldInit class is used for initialization (to the value 530e3 J/m^3).

This concludes a brief overview of the Specify block command and structure. Because the interpretation of the initialization string in the Specify block is left to the constructed object, the MIF 2.0 format is freely extensible. This also means that one must refer to the documentation of each Oxs_Ext child class to know how to interpret the corresponding initialization string. Details on the standard Oxs_Ext child classes are included with the Oxsii documentation.

Miscellaneous Block

The Miscellaneous block is intended to provide to the solver any information that does not fit naturally into one of the Specify blocks. This is intended mainly for development purposes, and may be deprecated in the future.

The content of the Miscellaneous block is structured as a Tcl list with an even number of elements, consisting of key + value pairs. The only key currently supported is basename; the associated value is used as a base for output name construction by some of the data output routines. There is an example Miscellaneous block in the sample MIF 2.0 file included below.



# MIF 2.0
#
# All units are SI.
#
# This file must be a valid Tcl script.
#

# Individual Oxs_Ext objects are loaded and initialized
# via Specify command blocks.  The following block defines
# the extents (in meters) of the volume to be modeled.
# The prefix 'Oxs_SectionAtlas' specifies the type
# of Oxs_Ext object to create, and the suffix ':WorldAtlas' is
# the name assigned to this particular instance.  Each object
# created by a Specify command must have a unique full name
# (here 'Oxs_SectionAtlas:WorldAtlas').  If the suffix is
# not explicitly given, then the default ':' is automatically
# assigned.  References may be made to either the full name,
# or the shorter suffix instance name (here ':WorldAtlas') if the
# latter is unique. See the Oxs_StandardDriver block for some
# reference examples.
Specify Oxs_SectionAtlas:WorldAtlas {
   top { Oxs_RectangularSection {
       xrange {0 500e-9}
       yrange {0 250e-9}
       zrange {3e-9 9e-9}
   }   }
   bottom { Oxs_RectangularSection {
       xrange {0 500e-9}
       yrange {0 250e-9}
       zrange {0 3e-9}
   }   }
   world { Oxs_RectangularSection {
       xrange {0 500e-9}
       yrange {0 250e-9}
       zrange {0 9e-9}
   }   }
}

# The Oxs_RectangularMesh object is initialized with the
# discretization cell size (in meters).
Specify Oxs_RectangularMesh:mesh {
  cellsize {10e-9 10e-9 10e-9}
  atlas :WorldAtlas
}

# Magnetocrystalline anisotropy block.
# Oxs_UniformScalarFieldInit and Oxs_UniformVectorFieldInit
# are examples of embedded Oxs_Ext objects used to provide
# internal initialization of the Oxs_UniaxialAnisotropy
# object.
Specify Oxs_UniaxialAnisotropy {
  K1  { Oxs_UniformScalarFieldInit { value 530e3 } }
  axis { Oxs_RandomVectorFieldInit {
             min_norm 1
             max_norm 1
         }
  }
}

# Exchange energy with spatially varying exchange
# coefficient A.  Inside the top layer (refer to
# Oxs_SectionAtlas:WorldAtlas above) A = 13e-12 J/m,
# in the bottom layer A = 30e-12 J/m (taken from the
# default_A value), and the interlayer coupling is
# A = 20e-12 J/m.
Specify Oxs_Exchange6Ngbr {
  default_A 30e-12
  atlas :WorldAtlas
  A  {
    { top top 13e-12 }
    { top bottom 20e-12 }
  }
}

# Define a couple of constants for later use.
set PI [expr {4*atan(1.)}]
set MU0 [expr {4*$PI*1e-7}]

# The Oxs_UZeeman class is initialized with field ranges
# in A/m.  The following block uses the Hscale option to
# allow inputs in mT.  To make the $mu0 subsitution active,
# we enclose the block with double quotes ("") instead of
# curly braces ({}).  (There are other ways to achieve this.)
Specify Oxs_UZeeman:AppliedField "
  Hscale [expr 0.001/$MU0]
  Hrange {
     {  0  0  0   10  0  0   2 }
     { 10  0  0  -10  0  0   2 }
     {  0  0  0    0 10  0   4 }
     {  1  1  1    5  5  5   0 }
  }
"

# Enable demagnetization (stray) field computation.
# This block takes no parameters.
Specify Oxs_Demag {}

# First order Euler ODE solver
Specify Oxs_EulerEvolve {
  alpha 0.5
  start_dm 0.01
}

# The following procedure is used to initialize the initial
# spin configuration in the Oxs_StandardDriver block.
proc UpDownSpin { x y z xmin ymin zmin xmax ymax zmax } {
    if { $x < 0.55*$xmin + 0.45*$xmax } {
        return "0 1 0"
    } elseif { $x > 0.45*$xmin + 0.55*$xmax } {
        return "0 -1 0"
    } else {
        return "0 0 1"
    }
}

Specify Oxs_StandardDriver {
 evolver Oxs_EulerEvolve
 min_timestep 1e-18
 max_timestep 1e-9
 stopping_dm_dt 0.01
 mesh :mesh
 number_of_stages 1
 stage_iteration_limit 0
 total_iteration_limit 0
 Ms { Oxs_UniformScalarFieldInit { value 8e5 } }
 m0 { Oxs_ScriptVectorFieldInit {
        script {UpDownSpin}
        norm  1
 } }
}

# Block specifying various miscellaneous data
Miscellaneous {
 basename test
}
Figure 5: Example MIF 2.0 file. (Description.)



OOMMF Home next up previous Contents index

OOMMF Documentation Team
January 22, 2001