-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathME1_2DPBC_initM.mif
126 lines (104 loc) · 3.54 KB
/
ME1_2DPBC_initM.mif
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# MIF 2.2
# Khokhlov NE
# Description: The code calculates initial magnetization state of the sample
# with uniaxial anisotropy only and 2D PBC
# External field is along x-axis
# All units are SI
# UserGuide p.197 (202):
#After the first line ('# MIF 2.2'), there is considerable
#flexibility in the layout of the file. Generally near
#the top of the file one places any
#OOMMFRootDir, Parameter, and RandomSeed statements,
#as desired.
# Initialize random number generators with seed=1
RandomSeed 1
#RandomSeed Initializes both the Tcl and the C-library random number generators. If no
#parameter is given, then a seed is drawn from the system clock. Otherwise, one integer
#parameter may be specified to be used as the seed.
set pi [expr {4*atan(1.0)}]
set mu0 [expr {4*$pi*1e-7}]
# parameters to be changed from command line
# Angle between Hext and crystallografic direction (100), in degrees.
# Hext will be horizontal, parallel to the x-axis in calcualtions
Parameter phi_angle [ expr { 0 * $pi/180 } ]
Parameter Ms0 1.0e3 ;# Ms in A/m
Parameter Kuni 300 ;# in J/m^3
Parameter Hext 0 ;# external field in mT
Parameter cellsize 50.0e-9 ;# cell size in calcualtions
Parameter cellscount 2048
#set Ms0 [expr {$muMs0/$mu0}]
Parameter basename [ format { ./Initial_states/init_phiKu_%03.1f_deg } \ [ expr { $phi_angle *180/$pi } ] ] ;# set basename - Lecture 3, slide 37
# basename "demagtensor-column${tensor_column}"
#Options are nedded for correct save for MatLab postprocessing
#How to comvert the data from OOMMF to MatLab
#https://thebrickinthesky.wordpress.com/2013/11/06/oommf-2/
SetOptions [subst {
basename $basename
scalar_output_format %.12g
scalar_field_output_format {text %.4g}
scalar_field_output_meshtype regular
vector_field_output_format {text %.12g}
}]
set xsize [expr {$cellscount*$cellsize}]
set ysize [expr {$cellscount*$cellsize}]
set zsize {1e-6}
set xcell [subst {$cellsize}]
set ycell [subst {$cellsize}]
set zcell {1e-6}
set ex [expr {cos($phi_angle)}] ;# unity vector along x-axis rotated by phi_angle
set ey [expr {sin($phi_angle)}] ;# unity vector along y-axis rotated by phi_angle
# Geometry of the problem: simulation volume
Specify Oxs_BoxAtlas:atlas [subst {
xrange {0 $xsize}
yrange {0 $ysize}
zrange {0 $zsize}
}]
# Use the Tcl "subst" command to enable
# variable and command substitution inside a Specify block.
# ------------Grid---------------------
Specify Oxs_RectangularMesh:mesh [subst {
cellsize { $xcell $ycell $zcell }
atlas :atlas
}]
# ------------------------------------
#Exhange Energy
Specify PBC_Exchange_2D {
A 13e-12
}
# ---Uniaxial Anisotropy---
Specify Oxs_UniaxialAnisotropy [subst {
K1 $Kuni
axis {0.1 0.1 1}
}]
# ---------------------------
set Hz [expr {0.0*$Hext}]
#External Field in mT due to multiplier
Specify Oxs_UZeeman [subst {
multiplier [expr {0.001/$mu0}]
Hrange {
{ $Hext 0 $Hz $Hext 0 $Hz 0 }
}
}]
# ----------------------
#Demagnitization
Specify PBC_Demag_2D { }
#Main solution
# Energy minimization as it's faster for static initial state
Specify Oxs_CGEvolve:evolve {}
Specify Oxs_MinDriver [subst {
evolver evolve
mesh :mesh
stopping_mxHxm 1e-8
Ms $Ms0
m0 { 1 0 0.01 }
}]
# Create destinations
#Destination my_graph mmGraph
Destination my_archive mmArchive
Destination my_display mmDisp
# Specify what should be saved.
# Options: Stage 1 Step 5 done
#Schedule DataTable my_graph Step 1
Schedule Oxs_MinDriver::Magnetization my_display Step 100
#Schedule Oxs_MinDriver::Magnetization my_display Done
Schedule Oxs_MinDriver::Magnetization my_archive Done