The OIF file structure consists of an identification record followed by header and data blocks. All non-data lines begin with a `#' character. Comments may be embedded inside the header block, with the `##' pair denoting the start of a comment. Comments run to the end of the line. The data block consists of non-negative integer values in either plain text or little endian binary form.
The file type identification record must be the first line of an OIF file, with the form
# OOMMF OIF 1.0Segment count and begin records, as in the OVF formats, may follow the identification line, but are optional in OIF files and are ignored. The next required record is the header block start record
# Begin: HeaderThe header block continues until the header block end record
# End: HeaderAll records inside the header block are structured as label+value pairs. The label tag consists of all characters after the initial `#' up to the first colon (`:') character. Case is ignored, and all space and tab characters are eliminated. The value consists of all characters after the first colon, continuing up to a `##' comment designator or the end of the line.
Records inside the header block include
The data block follows the header block, and starts with a record of the form
In text data blocks, the data items are whitespace separated. Binary data blocks are more compact, with items distinguished by item width. Multi-byte binary values are stored with the least significant byte first (little endian). To guard again byte ordering mishaps, and to provide a partial check that the file hasn't been sent through a non 8-bit clean channel, the first item in a binary data block is a check value: 255 (hex 0xFF), 65 306 (hex 0xFF1A), or 83 827 228 (hex 0x04FF1A1C), for 1 byte, 2 byte, and 4 byte binary respectively. (These will read sequentially in the the file as 0xFF, 0x1A 0xFF, and 0x1C 0x1A 0xFF 0x04.) Including the check value, each binary data block contains a total of items.
In all cases the ordering runs with the index incremented first, then the index, and the index last. This is the same ordering as used by the OVF formats. (Note that as compared to images used by the Oxs_ImageAtlas class, where the index typically runs from the top to the bottom of the image, the index in OIF files would be interpreted as running from the “bottom” to the “top”.) Text and data blocks both end with a trailing end of line marker (newline or carriage return + newline) followed by either
# OOMMF OIF 1.0 # Begin: Header ## Two '#' characters denote a comment # meshtype: rectangular # xbase: 2.5e-9 # ybase: 2.5e-9 # zbase: 2.5e-9 # xstepsize: 5e-9 # ystepsize: 5e-9 # zstepsize: 4e-9 # labels: Fe Ni Co spacer # ## The x/y/zbase, x/y/zstepsize, and labels records are optional. Each ## may be treated as a hint and ignored by a client application. In ## particular, the Oxs class Oxs_FileAtlas Specify block may override ## these file values, and regardless always implicitly inserts a ## "universe" region as the first label value which corresponds to the ## data value 0. Thus, in this example, 1 corresponds to Fe, 2 to Ni, ## 3 to Co, and 4 to spacer. # ## The x/y/znodes records are required. The product ## xnodes * ynodes * znodes ## equals the number of entries in the data block. # # xnodes: 4 # ynodes: 3 # znodes: 2 # End: Header # Begin: data text 4 4 4 4 4 4 4 4 4 4 4 4 2 2 2 2 2 2 2 2 2 2 2 2 4 4 4 4 4 4 4 4 4 4 4 4 0 0 0 3 3 3 3 3 3 0 0 0 # End: data text