Scalar field objects are documented first. Vector field objects are considered farther below.
Specify Oxs_TimeDriver {
...
Ms { Oxs_UniformScalarField {
value 8e5
}}
...
}
As discussed in
the section on Oxs_Ext
referencing in the MIF
2 documentation,
when embedding Oxs_UniformScalarField
or Oxs_UniformVectorField
objects, a notational shorthand is allowed that lists only the value.
The previous example is exactly equivalent to
Specify Oxs_TimeDriver {
...
Ms 8e5
...
}
where an implicit Oxs_UniformScalarField object is
created with value set to 8e5.
- Specify Oxs_AtlasScalarField {
- atlas atlas_spec
- multiplier mult
- default_value scalar_field_spec
- values {
}
- region1_label scalar_field_spec1
- region2_label scalar_field_spec2
- ...
- }
- Specify Oxs_LinearScalarField {
- norm value
- vector { vx vy vz }
- offset off
- }
If optional value norm is specified, then the given
vector is first scaled to the requested size. The
offset entry is optional, with default value 0. For any
given point , the scalar value returned by this
object will be
.
- Specify Oxs_RandomScalarField {
- range_min minvalue
- range_max maxvalue
- cache_grid mesh_spec
- }
The value at each position is drawn uniformly from the range declared by the two required parameters, range_min and range_max. There is also an optional parameter, cache_grid, that takes a mesh specification describing the grid used for spatial discretization. If cache_grid is not specified, then each call to Oxs_RandomScalarField generates a different field. If you want to use the same random scalar field in two places (as a base for setting, say anisotropy coefficients and saturation magnetization), then specify cache_grid with the appropriate (usually the base problem) mesh.
- Specify Oxs_ScriptScalarField:name {
- script Tcl_script
- script_args { args_request }
- scalar_fields { scalar_field_spec ...}
- vector_fields { vector_field_spec ...}
- atlas atlas_spec
- xrange { xmin xmax }
- yrange { ymin ymax }
- zrange { zmin zmax }
- }
For each point of interest, the specified script is called with the arguments requested by script_args appended to the command, as explained in the User Defined Support Procedures section of the MIF 2 file format documentation. The value for script_args should be a subset of {rawpt relpt minpt maxpt span scalars vectors}.
proc Ellipsoid { xrel yrel zrel } {
set xrad [expr {$xrel - 0.5}]
set yrad [expr {$yrel - 0.5}]
set zrad [expr {$zrel - 0.5}]
set test [expr {$xrad*$xrad+$yrad*$yrad+$zrad*$zrad}]
if {$test>0.25} {return 0}
return 8.6e5
}
Specify Oxs_ScriptScalarField {
script Ellipsoid
xrange { 0 1e-6 }
yrange { 0 250e-9 }
zrange { 0 50e-9 }
}
proc DotProduct { x1 y1 z1 x2 y2 z2 } {
return [expr {$x1*$x2+$y1*$y2+$z1*$z2}]
}
Specify Oxs_FileVectorField:file1 {
atlas :atlas
file file1.omf
}
Specify Oxs_UniformVectorField:dir111 {
norm 1
vector {1 1 1}
}
Specify Oxs_ScriptScalarField:project {
script DotProduct
script_args vectors
vector_fields {:file1 :dir111}
}
- Specify Oxs_VecMagScalarField {
- field vector_field_spec
- multiplier mult
- offset off
- }
The multiplier and offset entries are applied
after the vector norm, i.e., the resulting scalar field is
. The default values
for mult and off are 1 and 0, respectively.
Specify Oxs_FileVectorField:file1 {
atlas :atlas
file file1.omf
}
Specify Oxs_TimeDriver {
basename test
evolver :evolve
stopping_dm_dt 0.01
mesh :mesh
m0 :file1
Ms { Oxs_VecMagScalarField {
field :file1
}}
}
- Specify Oxs_ScriptOrientScalarField:name {
- field scalar_field_spec
- script Tcl_script
- script_args { args_request }
- atlas atlas_spec
- xrange { xmin xmax }
- yrange { ymin ymax }
- zrange { zmin zmax }
- }
The field argument should refer to a scalar field object. The script is a Tcl script that should return a position vector that will be sent on the field object to ultimately produce a scalar value. The arguments to the Tcl_script are determined by script_args, which should be a subset of {relpt rawpt minpt maxpt span}. If any arguments other than rawpt are requested, then the bounding box must be specified by either the atlas option, or else through the three xrange, yrange, zrange entries. The default value for script_args is relpt.
Specify Oxs_FileVectorField:file1 {
atlas :atlas
file file1.omf
}
Specify Oxs_VecMagScalarField:file1mag {
field :file1
}
proc Reflect { x y z xmin ymin zmin xmax ymax zmax} {
return [list [expr {($xmax+$xmin-$x)}] $y $z]
}
Specify Oxs_ScriptOrientScalarField:reflect {
field :file1mag
script Reflect
script_args {rawpt minpt maxpt}
atlas :atlas
}
- Specify Oxs_AffineOrientScalarField {
- field scalar_field_spec
- M { matrix_entries ... }
- offset { offx offy offz }
- inverse invert_flag
- inverse_slack slack
- }
If
represents the scalar field specified by the
field value, then the resulting transformed scalar field is
. Here M is a
3x3 matrix, which may be specified by a list
of 1, 3, 6 or 9 entries. If the matrix_entries list consists of a
single value, then
is taken to be that value times the identity
matrix, i.e.,
is a homogeneous scaling transformation. If
matrix_entries consists of 3 values, then
is taken to be the
diagonal matrix with those three values along the diagonal.
If matrix_entries is 6 elements long, then
is assumed to be a
symmetric matrix, where the 6 elements specified correspond to
,
,
,
,
, and
. Finally, if
matrix_entries is 9 elements long, then the elements specify the
entire matrix, in the order
,
,
,
,
...,
. If
is not specified, then it is taken to be
the identity matrix.
Specify Oxs_BoxAtlas:atlas {
xrange {-250e-9 250e-9}
yrange {-250e-9 250e-9}
zrange { -15e-9 15e-9}
}
Specify Oxs_FileVectorField:file1 {
atlas :atlas
file file1.omf
}
Specify Oxs_VecMagScalarField:file1mag {
field :file1
}
Specify Oxs_AffineOrientScalarField:reflect {
field :file1mag
M { 0 1 0
-1 0 0
0 0 1 }
}
- Specify Oxs_AffineTransformScalarField {
- field scalar_field_spec
- multiplier mult
- offset off
- inverse invert_flag
- }
If
represents the scalar field specified by the
field value, then the resulting scalar field is
. Since the output
from
is a scalar, both multiplier and offset
are scalars. If inverse is 1, then the transform is changed
to
,
provided mult is non-zero.
- Specify Oxs_ImageScalarField:name {
- image pic
- invert invert_flag
- multiplier mult
- offset off
- viewplane view
- atlas atlas_spec
- xrange { xmin xmax }
- yrange { ymin ymax }
- zrange { zmin zmax }
- exterior ext_flag
- }
The image is interpreted as a monochromatic map, yielding a
scalar field with black corresponding to zero and white to one if
invert is 0 (the default), or with black corresponding to 1
and white to 0 if invert is 1. Color images are converted to
grayscale by simply summing the red, green, and blue components. A
multiplier option is available to change the range of values
from to
mult
, after which the
offset value, if any, is added.
The available vector field objects are:
- Specify Oxs_UniformVectorField {
- norm 1
- vector {1 1 1}
- }
This object returns the unit vector , where
a=1/sqrt(3), regardless of the import
position.
This class is frequently embedded inline to specify spatially uniform quantities. For example, inside a driver Specify block we may have
Specify Oxs_TimeDriver {
...
m0 { Oxs_UniformVectorField {
vector {1 0 0}
}}
...
}
As discussed in
the section on Oxs_Ext
referencing in the MIF
2 documentation,
when embedding Oxs_UniformVectorField
or Oxs_UniformScalarField
objects, a notational shorthand is allowed that lists only the required
value. The previous example is exactly equivalent to
Specify Oxs_TimeDriver {
...
m0 {1 0 0}
...
}
where an implicit Oxs_UniformVectorField object is
created with the value of vector set to {1 0 0}.
- Specify Oxs_AtlasVectorField {
- atlas atlas_spec
- norm magval
- multiplier mult
- default_value vector_field_spec
- values {
}
- region1_label vector_field_spec1
- region2_label vector_field_spec2
- ...
- }
Interpretation is analogous to the Oxs_AtlasScalarField specify block, except here the output values are 3 dimensional vectors rather than scalars. Thus the values associated with each region are vector fields rather than scalar fields. Any of the vector field types described in this (Field Objects) section may be used. As usual, one may provided a braced list of three numeric values to request a uniform (spatially homogeneous) vector field with the indicated value.
proc Vortex { xrel yrel zrel } {
set xrad [expr {$xrel-0.5}]
set yrad [expr {$yrel-0.5}]
set normsq [expr {$xrad*$xrad+$yrad*$yrad}]
if {$normsq <= 0.025} {return "0 0 1"}
return [list [expr {-1*$yrad}] $xrad 0]
}
Specify Oxs_ScriptVectorField {
script Vortex
norm 1
atlas :atlas
}
- Specify Oxs_FileVectorField {
- file filename
- atlas atlas_spec
- xrange { xmin xmax }
- yrange { ymin ymax }
- zrange { zmin zmax }
- spatial_scaling { xscale yscale zscale }
- spatial_offset { xoff yoff zoff }
- exterior ext_flag
- norm magnitude
- multiplier mult
- }
Required values in the Specify block are the name of the input vector field file and the desired scaling parameters. The filename is specified via the file entry, which names a file containing a vector field in one of the formats recognized by avf2ovf. If atlas or xrange/yrange/zrange are specified, then the file will be scaled and translated as necessary to fit that scaling region, in the same manner as done, for example, by the Oxs_ScriptScalarField and Oxs_ScriptVectorField classes. Alternatively, one may specify spatial_scaling and spatial_offset directly. In this case the vector spatial positions are taken as specified in the file, multiplied component-wise by (xscale,yscale,zscale), and then translated by (xoff,yoff,zoff). If you want to use the spatial coordinates as directly specified in the file, use (1,1,1) for spatial_scaling and (0,0,0) for spatial_offset.
- Specify Oxs_RandomVectorField {
- min_norm minvalue
- max_norm maxvalue
- base_field vector_field_spec
- cache_grid mesh_spec
- }
The Specify block takes two required parameters, min_norm and max_norm. The vectors produced will have magnitude between these two specified values. If min_norm = max_norm, then the samples are uniformly distributed on the sphere of that radius. Otherwise, the samples are uniformly distributed in the hollow spherical volume with inner radius min_norm and outer radius max_norm.
- Specify Oxs_RandomVectorField {
- plane_normal vector_field_spec
- min_norm minvalue
- max_norm maxvalue
- base_field vector_field_spec
- cache_grid mesh_spec
- }
The min_norm, max_norm, base_field and cache_grid parameters have the same meaning as for the Oxs_RandomVectorField class. The additional parameter, plane_normal, specifies a vector field that at each point provides a vector that is orthogonal to the plane from which the random vector at that point is to be drawn. If the vector field is specified explicitly as three real values, then a spatially uniform vector field is produced and all the random vectors will lie in the same plane. More generally, however, the normal vectors (and associated planes) may vary from point to point. As a special case, if a normal vector at a point is the zero vector, then no planar restriction is made and the resulting random vector is drawn uniformly from a hollow ball in three space satisfying the minimum/maximum norm constraints.
- Specify Oxs_ScriptOrientVectorField:name {
- field vector_field_spec
- script Tcl_script
- script_args { args_request }
- atlas atlas_spec
- xrange { xmin xmax }
- yrange { ymin ymax }
- zrange { zmin zmax }
- }
The interpretation of the specify block and the operation of the Tcl script is exactly the same as for the Oxs_ScriptOrientScalarField class, except the input field and the resulting field are vector fields instead of scalar fields.
- Specify Oxs_AffineOrientVectorField {
- field vector_field_spec
- M { matrix_entries ... }
- offset { offx offy offz }
- inverse invert_flag
- inverse_slack slack
- }
The interpretation of the specify block and the affine transformation is exactly the same as for the Oxs_AffineOrientScalarField class, except the input field and the resulting field are vector fields instead of scalar fields.
- Specify Oxs_AffineTransformVectorField {
- field vector_field_spec
- M { matrix_entries ... }
- offset { offx offy offz }
- inverse invert_flag
- inverse_slack slack
- }
Because the output from field is a 3-vector, the transform
defined by M and offset requires M to be a
3x3 matrix and offset to be a 3-vector.
Thus, if
represents the
vector field specified by the field value, then the resulting
vector field is
.
Specify Oxs_BoxAtlas:atlas {
xrange {-80e-9 80e-9}
yrange {-80e-9 80e-9}
zrange {0 40e-9}
}
proc Trap { x y z } {
if {$y<=$x && $y<=0.5} {return [list 0 1 0]}
return [list 0 0 0]
}
Specify Oxs_ScriptVectorField:trap {
script Trap
atlas :atlas
}
Specify Oxs_AffineOrientVectorField:orient {
field :trap
M { 0 -1 0
1 0 0
0 0 1 }
offset { -20e-9 0 0 }
inverse 1
}
Specify Oxs_AffineTransformVectorField:rot {
field :orient
M { 0 -1 0
1 0 0
0 0 1 }
}
proc Threshold { vx vy vz } {
set magsq [expr {$vx*$vx+$vy*$vy+$vz*$vz}]
if {$magsq>0} {return 8e5}
return 0.0
}
Specify Oxs_ScriptScalarField:Ms {
vector_fields :rot
script Threshold
script_args vectors
}
Specify Oxs_TimeDriver {
m0 :rot
Ms :Ms
stopping_dm_dt 0.01
evolver :evolve
mesh :mesh
}
- Specify Oxs_MaskVectorField {
- mask scalar_field_spec
- field vector_field_spec
- }
This functionality can be achieved, if in a somewhat more complicated fashion, with the Oxs_ScriptVectorField class. For example, given a scalar field :mask and a vector field :vfield, this example using the Oxs_MaskVectorField class
Specify Oxs_MaskVectorField {
mask :mask
field :vfield
}
proc MaskField { m vx vy vz } {
return [list [expr {$m*$vx}] [expr {$m*$vy}] [expr {$m*$vz}]]
}
Specify Oxs_ScriptVectorField {
script MaskField
script_args {scalars vectors}
scalar_fields { :mask }
vector_fields { :vfield }
}
- Specify Oxs_ImageVectorField:name {
- image pic
- multiplier mult
- vx_multiplier xmult
- vy_multiplier ymult
- vz_multiplier zmult
- vx_offset xoff
- vy_offset yoff
- vz_offset zoff
- norm norm_magnitude
- viewplane view
- atlas atlas_spec
- xrange { xmin xmax }
- yrange { ymin ymax }
- zrange { zmin zmax }
- exterior ext_flag
- }
The image is interpreted as a three-color map, yielding a vector field where each (x,y,z) component is determined by the red, green, and blue color components, respectively....