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

RandomSeed 1

Specify Oxs_ImageAtlas:atlas {
  xrange {0 320e-9}
  yrange {0 320e-9}
  zrange {0  20e-9}
  viewplane xy
  image vortex.bmp
  colormap {
     magenta  region_1
     cyan     region_2
     yellow   region_3
     red      region_4
     blue     region_5
     green    region_6
     white    vacuum
  }
}

Specify Oxs_RectangularMesh:mesh {
  cellsize {5e-9 5e-9 5e-9}
  atlas :atlas
}

Specify Oxs_UniformExchange {
  A  30e-12
}

Specify Oxs_UniaxialAnisotropy {
 K1 { Oxs_AtlasScalarField {
   atlas :atlas
   default_value 50e3
   values {
      region_2  -10e3
      region_4  -10e3
      region_6  -10e3
      vacuum      0 
   }
 }}
 axis { Oxs_AtlasVectorField {
   atlas :atlas
   values {
      region_1  {-1.0   0.7  0}
      region_2  {-1.0  -0.2  0}
      region_3  {-0.7  -1.0  0}
      region_4  { 1.0  -0.5  0}
      region_5  { 1.0   0.2  0}
      region_6  { 0.6   1.0  0}
      vacuum    { 0     0    1}
   }
   norm 1.0
 }}
}

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

Specify Oxs_Demag {}

Specify Oxs_CGEvolve {}

Specify Oxs_MinDriver {
 basename imageatlas
 evolver Oxs_CGEvolve
 stopping_mxHxm 0.1
 mesh :mesh
 Ms { Oxs_AtlasScalarField {
   atlas :atlas
   default_value 8e5
   values {
      vacuum 0
   }
 }}
 m0 { Oxs_AtlasVectorField {
   atlas :atlas
   values {
      region_1  {-1.0   0.7  0}
      region_2  {-1.0  -0.2  0}
      region_3  {-0.7  -1.0  0}
      region_4  { 1.0  -0.5  0}
      region_5  { 1.0   0.2  0}
      region_6  { 0.6   1.0  0}
      vacuum    { 0     0    1}
   }
   norm 1.0
 }}
}
