# MIF 2.1
# MIF Example File: randexch.mif
# Description: Example illustrating use of the Oxs_RandomSiteExchange
#  class.
#
set pi [expr {4*atan(1.0)}]
set mu0 [expr {4*$pi*1e-7}]

Parameter linkprob  0.95
Parameter Amin      9e-12
Parameter Amax     13e-12

Parameter seed {}
Parameter cellsize  5e-9

eval RandomSeed $seed  ;# Initialize seed to {} to get a seed
## value from the system clock.

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_CubicAnisotropy {
  K1  -4.5e3
  axis1 {1 0 0}
  axis2 {0 1 0}
}

Specify Oxs_RandomSiteExchange [subst {
  linkprob $linkprob
  Amin  $Amin
  Amax  $Amax
}]

Specify Oxs_UZeeman [subst {
  multiplier [expr {0.001/$mu0}]
  Hrange {
     {   0    0   0   100   5   0   50 }
     { 100    5   0  -100  -5   0  100 }
  }
}]

Specify Oxs_Demag {}

Specify Oxs_CGEvolve {}

Specify Oxs_MinDriver {
 basename randexch
 evolver Oxs_CGEvolve
 stopping_mxHxm 1
 mesh :mesh
 Ms 8e5
 m0 { Oxs_RandomVectorField {
   min_norm 1.0
   max_norm 1.0
 }}
}
