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 oommf.tcl mmDisp [standard options] [-net <0|1>] [filename]
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, data scale, or 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 .bar 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}} {*.bar 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 format is system dependent.)
To produce bitmap output, save the file to disk in the OVF format, and use the avf2ppm utility to do the conversion.
Controls
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.
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 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, the vector magnitude, or the in-plane xy-angle of the vector from the positive x-axis 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 governs the use of potentially limited color resources, and can be used to achieve some special coloring effects. (Note: The xy-angle quantity is best viewed with a colormap that begins and ends with the same color, e.g., ``Red-Green-Blue-Red.'')
When there are many vectors in a vector field, a display of all of them may be more confusing than helpful. The Subsample column allows the user to request that only a sampling of vectors from the vector field be displayed. The Subsample 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.)
The length of an arrow represents the magnitude of the vector field. All arrows are drawn with a length between zero and ``full-scale.'' By default, the full-scale arrow length is computed so that it covers the region of the screen that one displayed vector is intended to represent, given the current subsample rate. Following this default, arrows do not significantly overlap each other, yet all non-zero portions of the vector field have a representation in the display. Similarly, pixels are drawn with a default size that fills an area equal to the region of the screen one pixel is intended to represent, given the pixel subsample rate. The Size column allows the user to (independently) override the default size of pixels and full-scale arrows. A value of 1 represents the default size. By changing to a larger or smaller Size value, the user may request arrows or pixels larger or smaller than the default size.
Below the Arrow and Pixel Controls are several additional controls. The Data Scale entry affects the data value scaling. As described above, all arrows are displayed with length between zero and full-scale. The full-scale arrow length corresponds to some scalar value of the magnitude of the vector field. The Data Scale entry allows the user to set the value at which the drawn arrow length goes full-scale. Any vectors in the vector field with magnitude equal to or greater than the data scale value will be represented by arrows drawn at full scale. Other vectors will be represented by shorter arrows with length determined by a linear scale between zero and the data scale value. Similarly, the data scale value controls the range of values spanned by the colormap used to color pixels. The usual use of the Data Scale entry is to reduce the data scale value so that more detail can be seen in those portions of the vector field which have magnitude less than other parts of the vector field. If the data scale value is increased, then the length of the arrows in the plot is reduced accordingly. If the data scale value is decreased, then the length of the arrows is increased, until they reach full-scale. An arrow representing a vector with magnitude larger than the data scale value may be thought of as being truncated to the data scale value. The initial (default) data scale value is usually the maximum vector magnitude in the field, so at this setting no arrows are truncated. Entering 0 into the data scale box will cause the data scale to be reset to the default value. (For OVF files, the default data scale value is set from the ValueRangeMaxMag header line. This is typically set to the maximum vector magnitude, but this is not guaranteed.) The data scale control is intended primarily for use with vector fields of varying magnitude (e.g., H-fields), but may also be used to adjust the pixel display contrast for any field type.
The Zoom entry controls the spatial scaling of the display. The value roughly corresponds to the number of pixels per vector in the fully-sampled vector field. (This value is not affected by the subsampling rate.)
To the right of the Data Scale and Zoom entries are controls to specify what margin (in pixels) should be maintained around the vector field, whether or not a bounding polygon is displayed, and what background color the display window should use.
No 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 Close 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 size of displayed arrows. The subsample rate may be modified either by direct entry of a new rate, or by manipulation of the slider. The second row controls the current data scale value. A vertical bar in the slider area marks the default data scale value. Specifying 0 for the data scale value will reset the data scale to the default value. At the bottom of the control bar is a zoom (spatial magnification) control.
The zoom value may also be changed by using the mouse inside the display window. 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.
When the zoom value is large enough that 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.
mmDisp remembers the previous zoom value and data scale values. To revert to the previous settings, the user may hit the ESC key. This is a limited ``Undo'' feature.
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, size, data scale or zoom, the following key combinations are active:
When the active subwindow is either of the control bar's sliders--arrow subsample, data scale or zoom--the following key combinations are active:
Of course the usual keyboard access to the menu items is also available.
Details
The selection of vectors for display according to the Subsample differs depending on whether or not the data lies on a regular grid. If so, the Subsample 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 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:
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 may 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
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.
Once you have your browser configured, you can test it on the muMAG 1st Standard Problem report page,