Typically SetOptions is declared near the top of the MIF file, before any Specify blocks, so that the options apply to all Oxs_Ext objects. However, multiple SetOptions blocks are allowed. Values specified in one SetOption block will be superseded if reset by later SetOption blocks. Values not specified in a SetOption block retain the previous setting. Judicious placement of SetOptions blocks allows formats and filenames to be varied across different outputs in one MIF file.
For outputs associated with a Destination tag in the MIF file, any options appended onto the Destination command take precedence. Otherwise, the options used are those active at the point of the Destination command, except for options specified as an empty string — those instead inherit the options active at the point of the Specify command for the output owner.
Any outputs not associated with a Destination command operate with the options active at the bottom of the MIF file.
The filename for DataTable output written through mmArchive has the form
<basename>.odtFor the field outputs, the default filename format is
<basename>-<outputname>-<stage>-<iteration>.<ext>where the stage and iteration are two and seven digit integers, with leading zeros as needed. (If the total number of stages in a simulation is larger than 99, then the stage format width is expanded to fit.) The extension is determined by the type of output: .omf for magnetization, .ohf for H fields, .obf for B fields, .oef for energy density fields, and .ovf for everything else. The filename format can be altered using a filename script. This script should be a Tcl proc that takes one argument and returns the desired filename. The import argument is a Tcl dict structure that includes the following fields:
Inside the filename proc use the Tcl dict get command to retrieve items from the params dict as needed. You can also call
DefaultFieldFilename $paramsto get the default scalar or vector field filename as described above.
The following MIF fragment illustrates SetOptions usage including a vector field filename script that truncates the iteration count on stage events:
proc ShortStageVF { params } { set filename [DefaultFieldFilename $params] set event [dict get $params event] if {[string compare Stage $event] == 0} { # Strip trailing iteration count (but retaining extension) regsub -- {-[0-9]+(\.[a-zA-Z]+)$} $filename {\1} filename } return $filename } SetOptions { basename fubar scalar_output_format %.12g scalar_field_output_format {text %.4g} scalar_field_output_meshtype irregular vector_field_output_format {binary 4} vector_field_output_filename_script ShortStageVF }
The four arguments to EvalScalarField are a reference to the scalar field (here :Ms), and the three coordinates of the point where you want the field evaluated. The coordinates are in the problem coordinate space, i.e., in meters.Oxs_AtlasScalarField:Ms { atlas :atlas default_value 0 values { Adisks 520e3 Bdisks 520e3 } }} set Ms_a [EvalScalarField :Ms 50e-9 20e-9 2e-9]
lassign [GetAtlasExtent :atlas] xmin ymin zmin xmax ymax zmax Report "Region oct000 extents: [GetAtlasExtent :atlas oct000]"
set regions_list [GetAtlasRegions :atlas]
set rogue [GetAtlasRegionByPosition :atlas 350e-9 57e-9 8e-9]