OOMMF Home next up previous contents
Next: Data Archive: mmArchive Up: OOMMF Documentation Previous: Data Graph Display: mmGraph


Vector Field Display: mmDisp

mmDisp Screen Shot

Overview
The application mmDisp displays two-dimensional spatial distributions of three-dimensional vectors (i.e., vector fields). It can load vector fields from files in a variety of formats, or it can accept vector field data from a client application, typically a running solver. mmDisp offers a rich interface for controlling the display of vector field data, and can also save the data to a file and produce Postscript print output.

Launching
mmDisp may be started either by selecting the mmDisp button on mmLaunch, or from the command line via

tclsh app/oommf/oommf.tcl mmDisp [-server] [-version] \
       [-console] [--] [<filename>]

The command line option -server makes mmDisp a server supplying vector field display services to other applications. Without that option mmDisp only displays vector field data loaded from files. The -server option is automatically included when mmDisp is launched by mmLaunch.

If the option -version is present on the command line, version information is printed, and mmDisp exits immediately.

If a filename is supplied on the command line, mmDisp takes it to be the name of a file containing vector field data for display. That file will be opened on startup.

Inputs
Input to mmDisp may come from either a file or from a client application (typically a running solver), in any of the OOMMF vector field formats. Other file formats can also be supported if a translation filter program is available.

Client applications that send data to mmDisp control the flow of data. The user, interacting with the mmDisp window, determines how the vector field data are displayed.

File input is initiated through the File|Open... dialog box. Several example files are included in the OOMMF release in the directory app/mmdisp/examples. When the Browse button is enabled, the ``Open File'' dialog box will remain open after loading a file, so that multiple files may be displayed in sequence. The Auto configuration box determines whether the vector subsampling or the zoom factor of the display should be determined automatically (based on the data in the file and the current display window size), or whether their values should be held constant while loading the file.

mmDisp permits local customization allowing for automatic translation from other file formats into one of the OOMMF vector field formats that mmDisp recognizes. When loading a file, mmDisp compares the file name to a list of glob-style patterns. These patterns typically match on the filename extension. An example pattern is *.gz. The assumption is that the pattern identifies files containing data in a particular format. For each pattern in the list, there is a corresponding translation program. mmDisp calls on that program as a filter which takes data in one format from standard input and writes to standard output the same data in one of the formats supported by mmDisp. In its default configuration, mmDisp recognizes the pattern *.gz and invokes the translation program gzip -dc to perform the ``translation.'' In this way, support for reading gzip compressed files is ``built in'' to mmDisp on any platform where the gzip program is installed.

New patterns and translation programs may be added to mmDisp by the usual method of local customization. The command to add to the customization file is of the form

Oc_Option Add mmDisp Input filters {{*.gz {gzip -dc}}}
The final argument in this command is a list of pairs. The first element in each pair is the filename pattern. The second element in each pair is the command line for launching the corresponding translation program. If a program foo were known to translate a file format identified by the extension .foo into the OVF file format, that program could be made known to mmDisp by changing the above customization command to:
Oc_Option Add mmDisp Input filters {{*.gz {gzip -dc}} {*.foo foo}}

Outputs
The vector field displayed by mmDisp may be saved to disk via the File|Save As... dialog box. The output is in the OVF format. The OVF file options may be set by selecting the appropriate radio buttons in the OVF File Options panel. The Title and Desc fields may be edited before saving. Enabling the Browse button allows for saving multiple files without closing the ``Save File'' dialog box.

The File|Print... dialog is used to produce a Postscript file of the current display. On Unix systems, the output may be sent directly to a printer by filling the Print to: entry with the appropriate pipe command, e.g., |lpr. (The exact form is system dependent.)

Controls

The View menu provides high-level control over how the vector field is placed in the display window. The menu selection View|Wrap Display resizes the display window so that it just contains the entire vector field surrounded by a margin. View|Fill Display resizes the vector field until it fills the current size of the display window. If the aspect ratio of the display window does not match the aspect ratio of the vector field, a larger than requested margin appears along one edge to make up the difference. View|Rotate ccw and View|Rotate cw rotate the display one quarter turn counter-clockwise and clockwise respectively. The display window also rotates, so that the portion of the vector field seen and any margins are preserved (unless the display of the control bar forces the display window to be wider). View|reDraw allows the user to invoke a redrawing of the display window.

The vector field may be rescaled (``zoomed'') and moved so that only a portion of it is visible in the display window. When a portion of the vector field lies outside the display window, scrollbars appear that may be used to translate the vector field so that different portions are visible in the display window. On systems that have a middle mouse button, clicking the middle button on a point in the display window translates the vector field so that the selected point is centered within the display window.

The mouse may also be used within the display window to rescale the display. A click and drag with the left mouse button displays a red rectangle that changes size as the mouse is dragged. When the left mouse button is released, the vector field is rescaled so that the portion of the display window within the red rectangle expands until it reaches the edges of the display window. Both dimensions are scaled by the same amount so there is no distortion of the vector field. Small red arrows on the sides of the red rectangle indicate which dimension will expand to meet the display window boundaries upon release of the left mouse button. After the rescaling, the red rectangle remains in the display window briefly, surrounding the same region of the vector field, but at the new scale.

A click and drag with the right mouse button displays a blue rectangle that changes size as the mouse is dragged. When the right mouse button is released, the vector field is rescaled so that all of the vector field currently visible in the display window fits in the size of the blue rectangle. Both dimensions are scaled by the same amount so there is no distortion of the vector field. Small blue arrows on the sides of the blue rectangle indicate the dimension in which the vector field will shrink to exactly transform the display window size to the blue rectangle size. After the rescaling, the blue rectangle remains in the display window briefly, surrounding the same region of the vector field, now centered in the display window, and at the new scale.

mmDisp remembers the previous display scale. To revert to the previous scale, the user may hit the ESC key. This is a limited ``Undo'' feature.

The menu selection Options|Configure... brings up a dialog box through which the user may control many features of the vector field display. Vectors in the vector field may be displayed as arrows, pixels, or both. The Arrow and Pixel buttons in the Plot type column on the left of the dialog box enable each type of display.

Columns 2-4 in the Configure dialog box control the use of color. Both arrows and pixels may be independently colored to indicate some quantity. The Color Quantity column controls which scalar quantity the color of the arrow or pixel represents. The x, y, or z components of the vector may be selected. On regularly gridded data the vector field divergence is also available for display.

The assignment of a color to a quantity value is determined by the Colormap selected. Colormaps are labeled by a sequence of colors that are mapped across the range of the selected quantity. For example, if the ``Red-Black-Blue'' colormap is applied to the Color Quantity ``z'', then vectors pointing into the xy-plane (z < 0) are colored red, those lying in the plane (z = 0) are colored black, and those pointing out of the plane (z > 0) are colored blue. Values between the extremes are colored with intermediate colors, selected using a discretization determined by the # of Colors value. This value limits the use of potentially limited color resources, and can be used to achieve some special coloring effects.

When there are many vectors in a vector field, a display of all of them can be more confusing than helpful. The Subsample Rate column allows the user to request that only a sampling of vectors from the vector field be displayed. The Subsample Rate value is roughly the number of vectors along one spatial dimension of the vector field which map to a single displayed vector (arrow or pixel). Each vector displayed is an actual vector in the vector field--the selection of vectors for display is a sampling process, not an averaging or interpolation process. The subsample rates for arrows and pixels may be set independently. A subsample rate of 0 is interpreted specially to display all data. (This is typically much quicker than subsampling at a small rate, e.g., 0.1.)

An arrow or pixel that represents a vector is by default displayed at a size that covers the portion of the vector field that that displayed vector is intended to represent, given the current subsample rate. Following this default, arrows do not significantly overlap each other, yet all portions of the vector field that are magnetically active have a representation in the display. The Magnification column allows the user to modify the size of the displayed arrows or pixels (independently). A Magnification of 1 is the default size. By changing to a larger or smaller Magnification value, the user may request arrows or pixels larger or smaller than the default size.

Lower in the Option|Configure... dialog box, the user may also select whether or not a bounding polygon is displayed, what margin (in pixels) should be maintained around the vector field, and what background color the display window should use.

None of the changes made by the user in the Options| Configure... dialog box affect the display window until either the Apply or OK button is selected. If the OK button is selected, the dialog box is also dismissed. The Cancel button dismisses the dialog without changing the display window.

The other item under the Options menu is a checkbutton that toggles the display of a control bar. The control bar offers alternative interfaces to some of the operations available from the Options|Configure... dialog box and the View menu. On the left end of the control bar is a display of the coordinate axes. These axes rotate along with the vector field in the display window to identify the coordinate system of the display, and are color coded to agree with the pixel (if active) or arrow coloring. A click of the left mouse button on the coordinate axes causes a counter-clockwise rotation. A click of the right mouse button on the coordinate axes causes a clockwise rotation.

To the right of the coordinate axes are two rows of controls. The top row allows the user to control the subsample rate and magnification of the arrow display. The subsample rate may be modified either by direct entry of a new rate, or by manipulation of the slider.

The lower row offers an alternative means to control the rescaling of the vector field in the display. The Zoom value roughly corresponds to the number of pixels per vector in the vector field. This value may be entered directly, or modified by manipulation of the slider. This alternative interface provides a more precise control over the rescaling of the vector field display than mouse operations provide.

Several keyboard shortcuts are available as alternatives to menu- or mouse-based operations. The effect of a key combination depends on which subwindow of mmDisp is active. The TAB key may be used to change the active subwindow. The SHIFT-TAB key combination also changes the active subwindow, in reverse order.

When the active subwindow is the display window, the following key combinations are active:

When the active subwindow is the control bar's coordinate axes display, the following key combinations are active:

When the active subwindow is any of the control bar's value entry windows - arrow subsample, magnification, or zoom, the following key combinations are active:

When the active subwindow is either of the control bar's sliders--arrow subsample or zoom--the following key combinations are active:

Of course the usual keyboard access to the menu items is also available.

The menu selection File|Clear clears the display window. The menu selection File|Exit terminates the mmDisp application. The menu Help provides the usual help facilities.

Details

The selection of vectors for display according to the Subsample Rate differs depending on whether or not the data lies on a regular grid. If so, the Subsample Rate takes integer values and determines the ratio of data points to displayed points. For example, a value of 5 means that every fifth vector on the grid is displayed. This means that the number of vectors displayed is 25 times fewer than the number of vectors on the grid.

For an irregular grid of vectors, an average cell size is computed, and the Subsample Rate takes values in units of 0.1 times the average cell size. A square grid of that size is overlaid on the irregular grid. For each cell in the square grid, the data vector from the irregular grid closest to the center of the square grid cell is selected for display. The vector is displayed at its true location in the irregular grid, not at the center of the square grid cell. As the subsample rate changes, the set of displayed vectors also changes, which can in some circumstances substantially change the appearance of the displayed vector field.

Using mmDisp as a WWW browser helper application

You may configure your web browser to automatically launch mmDisp when downloading an OVF file. The exact means to do this depends on your browser, but a couple of examples are presented below.

In Netscape Navigator 4.X, bring up the Edit|Preferences... dialog box, and select the Category Navigator|Applications subwindow. Create a New Type, with the following fields:

Description of type:
OOMMF Vector Field
MIME Type:
application/x-oommf-vf
Suffixes:
ovf omf ohf obf svf
Application:
wish oommfroot/app/oommf/oommf.tcl -nofork mmDisp `` arg''
On Windows platforms, the Suffixes field is labeled File Extension, and only one file extension may be entered. Files downloaded from a web server are handled according to their MIME Type, rather than their file extension, so that restriction isn't important when web browsing. If you wish to have files on the local disk with all the above file extensions recognized as OOMMF Vector Field files, you must repeat the New Type entry for each file extension. In the Application field, the values of wish, oommfroot, and arg vary with your platform configuration. The value of wish is the full path to the wish application on your platform (see Command Line Launching). On Unix systems, wish may be omitted, assuming that the oommf.tcl script is executable. If wish is not omitted on Unix systems, Netscape will issue a security warning each time it opens an OOMMF Vector Field file. The value of oommfroot should be the full path to the root directory of your OOMMF installation. The value of arg should be ``%1'' on Windows and ``%s'' on Unix. The MIME type ``application/x-oommf-vf'' must be configured on any HTTP server which provides OOMMF Vector Field files as well.

For Microsoft Internet Explorer 3.X, bring up the View|Options... dialog box, and select the Program tab. Hit the File Types... button, followed by the New Type... button. Fill the resulting dialog box with

Description of type:
OOMMF Vector Field
Associated extension:
ovf
Content type (MIME):
application/x-oommf-vf
You may also disable the Confirm open after download checkbutton if you want. Then hit the New... button below the Actions: window, and in the pop-up fill in
Action:
open
Application used to perform action:

wish oommfroot/app/oommf/oommf.tcl -nofork mmDisp ``%1''
Hit OK, Close, Close and OK. Replace wish and oommfroot with the appropriate paths on your system (cf. Command Line Launching). This will set up an association on files with the .ovf extension. Internet Explorer 3.X apparently ignores the HTML Content Type field, so you must repeat this process for each file extension (.ovf, .omf, .ohf, .obf and .svf) that you want to recognize. This means, however, that Internet Explorer will make the appropriate association even if the HTML server does not properly set the HTML Content Type field.

Microsoft Internet Explorer 4.X is integrated with the Windows operating system. Internet Explorer 4.X doesn't offer any means to set up associations between particular file types and the applications which should be used to open them. Instead, this association is configured within the Windows operating system. To set up associations for the OOMMF Vector Field file type on Windows 95 or Windows NT 4.0, select Settings|Control Panel from the Start menu. The Control Panel window appears. Select View|Options... to display a dialog box. A Windows 98 shortcut to the same dialog box is to select Settings|Folder Options... from the Start menu. Select the File Types tab and proceed as described above for Internet Explorer 3.X. Depending on the exact release/service patch of your Windows operating system, the exact instructions may vary.

With the 1.0 releases of OOMMF, you may use the alternate application line

oommfroot/app/mmdisp/ platformname/mmdisp.exe `` arg''
where oommfroot and arg are as in the discussion above and platformname is the name which OOMMF assigns to your platform type, as reported by the script platform.tcl. Also, the file extension .exe is for Windows platforms only. This alternative specification of the application for opening OOMMF Vector Field files should launch a little bit faster than the more generic command line given earlier.

Once you have your browser configured, you can test it on the muMag 1st Standard Problem report page,

http://www.ctcms.nist.gov/%7Erdm/std1/vectorcompare.html.

Known Bugs
Internally, mmDisp stores vector field data with 4 byte precision. While this should be accurate enough for display purposes, it also means that any file written out by mmDisp will only have 4 byte precision, even if an 8 byte output format is selected.


OOMMF Home next up previous Contents

OOMMF Documentation Team
February 23, 2000