# MIF 2.1
# MIF Example File: stdprob1.mif
# Description: Sample problem description for muMAG Standard Problem #1

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

Parameter cellsize 10 ;# Cell size in nm
set cellsize [expr {$cellsize*1e-9}] ;# Convert to meters

Parameter RandomAnisotropy 0.0 ;# Scaling for random anisotropy
## term.  If set to 0, then uniform 0.5 kJ/m anisotropy as
## specified in muMAG Standard Problem #1 is applied.

Specify Oxs_BoxAtlas:atlas {
  xrange {0 2e-6}
  yrange {0 1e-6}
  zrange {0 20e-9}
}

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

Specify Oxs_UniformExchange {
  A  13e-12
}

if {$RandomAnisotropy>0.0} {
  Specify Oxs_UniaxialAnisotropy [subst {
    K1 { Oxs_RandomScalarField {
        range_min [expr {$RandomAnisotropy*0.5e3}]
        range_max [expr {$RandomAnisotropy*5.0e3}]
    }}
    axis { Oxs_RandomVectorField {
        min_norm 1.0
        max_norm 1.0
    }}
  }]
} else {
  Specify Oxs_UniaxialAnisotropy {
    K1 0.5e3
    axis {1 0 0}
  }
}

Specify Oxs_Demag {}

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

Specify Oxs_CGEvolve:evolve {}

Specify Oxs_MinDriver {
 basename stdprob1
 evolver :evolve
 stopping_mxHxm 0.01
 mesh :mesh
 Ms 8.6e5
 m0 {10 1 0}
}

Destination table   mmDataTable
Schedule DataTable table Step 5

Destination archive mmArchive
Schedule DataTable archive Stage 1
