OOMMF Home next up previous contents index
Next: Vector Field File Format Up: Command Line Utilities Previous: Bitmap File Format Conversion:


Making Data Tables from Vector Fields: avf2odt

The avf2odt program converts rectangularly meshed vector field files in any of the recognized formats (OVF, VIO) into the ODT 1.0 data table format.

Launching
The avf2odt launch command is:

tclsh oommf.tcl avf2odt [standard options] \
   [-average <space|plane|line|point>] [-axis <x|y|z>] \
   [-filesort method] [-headers <full|collapse|none>] \
   [-index label units valexpr] [-ipat pattern] \
   [-normalize <0|1>] [-numfmt fmt] [-onefile outfile] \
   [-opatexp regexp] [-opatsub sub] \
   [-region xmin ymin zmin xmax ymax zmax] \
   [-rregion rxmin rymin rzmin rxmax rymax rzmax] \
   [-truncate <0|1>] [-v level] [infile ...]
where
-average <space|plane|line|point>
Specify type of averaging. Space outputs 1 data line consisting of the average vx , vy and vz field values in the selected region (see -region option below). For example, in magnetization files, vx , vy and vz correspond to Mx , My and Mz . If plane or line is selected, then the output data table consists of multiple lines with 4 or 5 columns respectively. The last 3 columns in both cases are the vx , vy and vz averaged over the specified axes-parallel affine subspace (i.e., plane or line). In the plane case, the first column specifies the averaging plane offset along the coordinate axis normal to the plane (see -axis option below). In the line case, the first 2 columns specify the offset of the averaging line in the coordinate plane perpendicular to the line. If -type is set to point, then no averaging is done, and the output consists of 6 column data lines, one line for each point in the selected region, where the first 3 columns are the point coordinates, and the last 3 are the vx , vy and vz values at the point. The default value is space.
-axis <x|y|z>
For the -type plane and -type line averaging types, selects which subset of affine subspaces the averaging will be performed over. In the plane case, the -axis represents the normal direction to the planes, while for line it is the direction parallel to the lines. This parameter is ignored if -type is space or point. Default is x.
-filesort method
Specifies the sorting order to apply to the input file list. This order is important when using the -onefile option, since it controls the order in which the rows from the various input files are concatenated. Method should be either the keyword ``none'', or else a valid option string for the Tcl command lsort, e.g., ``-ascii -decreasing''. Note that the lsort sort options all begin with a hyphen, ``-'', and that if you want to use multiple options they must be grouped as one element to filesort (by, for example, placing quotes around the list). The default value is ``-dictionary'' if the -ipat option is specified, or ``none'' otherwise.
-headers <full|collapse|none>
Determines the style of headers written to the output ODT file(s). The full style (default) provides the standard headers, as described in the ODT documentation. Specifying ``none'' produces raw data lines without any headers. The collapse style is used with multiple input files and the -onefile output option to concatenate output with no ODT header information between the segments.
-ipat pattern
Specify input files using a pattern with ``glob-style'' wildcards. Especially useful in DOS. Files must meet the infile requirements (see below).
-opatexp regexp
Specify the ``regular expression'' applied to input filenames to determine portion to be replaced in generation of output filenames. The default regular expression is: (\.[^.]?[^.]?[^.]?$|$)
-opatsub sub
The string with which to replace the portion of input filenames matched by the -opatexp regexp during output filename generation. The default is .odt.
-region xmin ymin zmin xmax ymax zmax
Axes-parallel rectangular box denoting region in the vector field file over which data is to be collected. The locations are in problem units (typically meters). A single hyphen, ``-'', may be specified for any of the box corner coordinates, in which case the corresponding extremal value from the input file is used. Optional; the default, -region - - - - - -, selects the entire input file.
-truncate <0|1>
When opening an existing file for output, the new output can either be appended to the file (-truncate 0), or else the existing data can be discarded (-truncate 1). The default is -truncate 0.
-v level
Verbosity (informational message) level, with 0 generating only error messages, and larger numbers generating additional information. The level value is an integer, defaulting to 1.
-onefile outfile
Generally a avf2odt writes its output to a collection of files with names generated using the -opatexp and -opatsub specifications. This option overrides that behavior and sends all output to one place. If outfile is ``-'', then the output is sent to standard output, otherwise outfile is the name of the output file.
infile ...
Input file list. Files must be one of the recognized formats, OVF 1.0 or VIO, in a rectangular mesh subformat.

Note: The mx , my and mz average magnetization values reported by mmSolve2D exclude points with 0 saturation magnetization. Such points are included by avf2odt, so the data table output from this program will probably not agree with that directly output by mmSolve2D if there are any such regions.

The file specification options require some explanation. Input files may be specified either by an explicit list (infile ...), or by giving a wildcard pattern, e.g., -ipat *.omf, which is expanded in the usual way by avf2odt (using the Tcl command glob). Unix shells (sh, csh, etc.) automatically expand wildcards before handing control over to the invoked application, so the -ipat option is not usually needed--although it is useful in case of a ``command-line too long'' error. DOS does not do this expansion, so you must use -ipat to get wildcard expansion in Windows. The resulting file list is sorted based on the -filesort specification as described above.

If -onefile is not requested, then as each input file is processed, a name for the corresponding output file is produced from the input filename by rules determined by handing the -opatexp and -opatsub expressions to the Tcl regsub command. Refer to the Tcl regsub documentation for details, but essentially whatever portion of the input filename is matched by the -opatexp expression is removed and replaced by the -opatsub string. The default -opatexp expression matches against any filename extension of up to 3 characters, and the default -opatsub string replaces this with the extension .odt.


OOMMF Home next up previous Contents index

OOMMF Documentation Team
May 24, 2006