-
Notifications
You must be signed in to change notification settings - Fork 0
/
overlying_ovf.m
71 lines (57 loc) · 2.02 KB
/
overlying_ovf.m
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
clc
clear all %#ok<CLALL>
close all
xcell=input('Please input the x-dimension cell size > ', 's');
ycell=input('Please input the y-dimension cell size > ', 's');
zcell=input('Please input the z-dimension cell size > ', 's');
xdim=input('Please input the number of cells in the x-direction > ', 's');
ydim=input('Please input the number of cells in the y-direction > ', 's');
zdim=input('Please input the number of cells in the z-direction > ', 's');
while 1
dww=input('Please input the desired DW width, in cells > ');
if (mod(dww,2)~=0)||(dww<=0)
disp('Please enter an even and positive value for the DW width.')
else
break;
end
end
input1=logical(input('Please enter the value of the first input > '));
input2=logical(input('Please enter the value of the second input > '));
input3=logical(input('Please enter the value of the third input > '));
input4=logical(input('Please enter the value of the fourth input > '));
input1=~input1;
input2=~input2;
input3=~input3;
input4=~input4;
disp('Please enter the initial magnetization state of the output:')
disp('1. +x')
disp('2. -x')
disp('3. +z')
disp('4. -z')
magstate=input('> ');
if magstate==1
leftmag=('-1.0 0.0 0.0\n');
rightmag=('1.0 0.0 0.0\n');
elseif magstate==2
leftmag=('1.0 0.0 0.0\n');
rightmag=('-1.0 0.0 0.0\n');
elseif magstate==3
leftmag=('0.0 0.0 -1.0\n');
rightmag=('0.0 0.0 1.0\n');
elseif magstate==4
leftmag=('0.0 0.0 1.0\n');
rightmag=('0.0 0.0 -1.0\n');
end
dwmag=('0.0 1.0 0.0\n');
cdfile=input('Please enter the file name for the current densities > ', 's');
cd=load(cdfile);
mdfile=input('Please enter the file name for the magnetic domains > ', 's');
md=load(mdfile);
xmax=sprintf('%e',str2double(xdim)*str2double(xcell));
xmax=strrep(xmax,'e-0','e-');
ymax=sprintf('%e',str2double(ydim)*str2double(ycell));
ymax=strrep(ymax,'e-0','e-');
zmax=sprintf('%e',str2double(zdim)*str2double(zcell));
zmax=strrep(zmax,'e-0','e-');
cdmod
mdmod