# MIF 2.1
# MIF Example File: sliding.mif
# Description: A sequence of input files defines a stage varying
#     applied field.  Compare to the slidingproc.mif, which uses
#     a Tcl procedure to achieve the same effect.

set pi [expr {4*atan(1.0)}]
set mu0 [expr {4*$pi*1e-7}]

RandomSeed 1

Parameter Happ 100  ;# Applied field strength, in mT
Parameter cellsize 5e-9

# Convert Happ from mT to A/m
set Happ [expr {$Happ*0.001/$mu0}]

Specify Oxs_BoxAtlas:atlas {
  xrange {0 200e-9}
  yrange {0 100e-9}
  zrange {0  20e-9}
}

Specify Oxs_RectangularMesh:mesh [subst {
  cellsize {$cellsize $cellsize $cellsize}
  atlas :atlas
}]

Specify Oxs_UniaxialAnisotropy {
  K1  5e3
  axis {0 1 0}
}

Specify Oxs_UniformExchange {
  A  12e-12
}

Specify Oxs_StageZeeman [subst {
  files { sliding_field0.ovf
          sliding_field1.ovf
          sliding_field2.ovf
          sliding_field3.ovf }
  multiplier $Happ
}]

Specify Oxs_Demag {}

Specify Oxs_CGEvolve:evolve {}

Specify Oxs_MinDriver [subst {
 basename sliding
 evolver :evolve
 stopping_mxHxm 0.1
 mesh :mesh
 Ms 800e3
 m0 { 1 0.02 0.01 }
}]
