-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRuCl3.m
133 lines (99 loc) · 4.16 KB
/
RuCl3.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
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
127
128
129
130
131
132
133
classdef RuCl3 < TmHl3
%https://materials.springer.com/isp/crystallographic/docs/sd_1300000
properties (SetAccess = public, GetAccess = public)
lambda_Ru
end
methods
function obj = RuCl3()
obj = obj@TmHl3(5.97900);
obj.setLambda(5.86);
obj.setLambda_tmhl(2.657/2);
obj.lambda = 5.7233;
obj.setTm(44);
obj.setHl(17);
obj.numLayer = 1;
obj.lambda_Ru = 0;
end
function [pos, mag] = calculate(self)
[~,hs,ks] = recip2DMeshGrid(self);
[pos, mag] = calculateHK(self,hs,ks);
mag = 4*pi^2/self.area*mag;
self.lambda = 17.17000/3;
end
function [pos, mag] = calculateHK_1L(self,hs,ks)
pos = hs*self.b1' + ks*self.b2';
kz = self.kzProvider(pos(:,1),pos(:,2));
pos(:,3) = kz;
% mag = ones(length(pos),1);
%
% magRu = mag.*(1+exp(-2i*pi/3*(2*hs+ks)));
% magClt = mag.*(...
% exp(-2i*pi/3*hs) +...
% exp(-2i*pi/3*ks) +...
% exp(-4i*pi/3*(hs+ks) ) );
% magClb = mag.*(...
% exp(-4i*pi/3*hs) +...
% exp(-4i*pi/3*ks) +...
% exp(-2i*pi/3*(hs+ks) ) );
%
%
%
% magRu = self.applyScat(pos,magRu,self.tm);
% magClt = self.applyScat(pos,magClt,self.hl);
% magClb = self.applyScat(pos,magClb,self.hl);
%
% mag = magRu + exp(-1i*self.lambda_tmhl*kz).*magClt...
% + exp(+1i*self.lambda_tmhl*kz).*magClb;
%
%Ver Simplified
magRu = ( exp(-1i*kz*self.lambda_Ru/2) + ...
exp( 1i*kz*self.lambda_Ru/2).*exp(-2i*pi/3*(2*hs+ks))...
);
%
magCl = exp(-1i*pi*hs).*( 2*cos(pi*hs/3-kz*self.lambda_tmhl)) + ...
exp(-1i*pi*ks).*( 2*cos(pi*ks/3-kz*self.lambda_tmhl)) + ...
exp(-1i*pi*(hs+ks)).*( 2*cos(pi*(hs+ks)/3+kz*self.lambda_tmhl));
mag = self.applyScat(pos,magRu,self.tm) + ...
self.applyScat(pos,magCl,self.hl);
end
function [pos, mag] = calculateHK_nL(self,hs,ks)
[pos,mag1L] = self.calculateHK_1L(hs,ks);
mag = zeros(size( mag1L ));
kz = pos(:,3);
for indLayer = 1:self.numLayer
if rem(indLayer,3) == 1
mag = mag+mag1L.*exp(-1i*kz*self.lambda*indLayer);
elseif rem(indLayer,3) == 2
mag = mag+...
mag1L.*exp(-1i*(2*pi/3*(2*hs+ks)+kz*self.lambda*indLayer));
elseif rem(indLayer,3) == 0
mag = mag+...
mag1L.*exp(-1i*(2*pi/3*(hs+2*ks)+kz*self.lambda*indLayer));
end
end
mag = mag.*exp(1i*kz*self.lambda*(self.numLayer+1)/2);
end
function [pos, mag] = calculateHK(self,hs,ks)
[pos, mag] = calculateHK_nL(self,hs,ks);
end
% setters
function setTm(self,val)
self.tm.Z = val;
self.tm.fparams = parseElements(val);
end
function setHl(self,val)
self.hl.Z = val;
self.hl.fparams = parseElements(val);
end
function setNumLayer(self,val)
self.numLayer = val;
end
%
function setLambda_tmhl(self, val)
self.lambda_tmhl = val;
end
function setName(self, val)
self.name = val;
end
end
end