# MIF 2.1
# This file converted from MIF 1.1 format by MIF Conversion utility 1.2.0.1
# Original file: E:/oommf1.2a.3/oommf/anj126.mif

set PI [expr {4*atan(1.)}]
set MU0 [expr {4*$PI*1e-7}]

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

Specify Oxs_RectangularMesh:mesh {
  cellsize {1e-9 2e-9 2e-9}
  atlas :atlas
}

Specify Oxs_UniaxialAnisotropy {
        K1  0
        axis { Oxs_UniformVectorField {
    norm 1
    vector {1 0 0}
  }  }
}

Specify Oxs_UniformExchange {
  A  13e-12
}

Specify Oxs_Demag {}

Specify Oxs_StageZeeman {
  script LocalFieldSpec
  stage_count 4000
}

proc LocalFieldSpec { stage } {
  set spec Oxs_ScriptVectorField
  set time [expr {$stage*1.0e-12}]
  set f [expr {490.0e9}]
  set PI [expr {4*atan(1.)}]
  set x [expr {2.0*$PI*$f*($time - 59.999e-12)}]
  set coeff [expr {0.0005}]
  set Hx [expr {$coeff*sin($x)/$x}]
  
  lappend spec [subst {
    atlas :atlas
    script {LocalField $Hx}
  }]
  return $spec
}

proc LocalField { Hx xrel yrel zrel } {
  set PI [expr {4*atan(1.)}]
  set MU0 [expr {4*$PI*1e-7}]
  set valz [expr {1.01/$MU0}]

  if {$yrel > 0.5} { return [list 0.0 0.0 $valz]}
  set z [expr {$zrel*2e-6 - 1.0000001e-6}]
  set kz [expr {0.5e9}]
  set sincParam [expr {$kz*$z}]
  set valx [expr {$Hx*(sin($sincParam)/($sincParam))/$MU0}]
  return [list $valx 0.0 $valz]
}

Specify Oxs_RungeKuttaEvolve {
  do_precess 1
  gamma_LL 2.21e5
  method rk4
  alpha 0.008
}

Specify Oxs_TimeDriver {
 basename PyStripHorzAntiSymmetric1NonPbcDynamic
 vector_field_output_format "text %.17g"
 evolver Oxs_RungeKuttaEvolve
 mesh :mesh
 stopping_time 1e-12
 stage_count 4000
 Ms 800e3
 m0 { Oxs_FileVectorField {
   atlas :atlas
   norm  1
   file PlainWaveguideNonPbcStatic.omf
} }
}