Skip to content

Commit 5942e20

Browse files
committed
Fix 'sym', 0 behaviour and tutorial 4 #205
1 parent e41f848 commit 5942e20

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

swfiles/@spinw/genlattice.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,14 @@
129129
' instead']);
130130
if ~isempty(param.sym)
131131
error('spinw:genlattice:WrongInput', ...
132-
'Both sym and spgr provided - note sym will be used.');
132+
'Both sym and spgr provided - please only use sym.');
133133
else
134134
param.sym = param.spgr;
135135
end
136136
end
137+
if isnumeric(param.sym) && param.sym == 0
138+
param.sym = [];
139+
end
137140
if any(strcmp('angled', varargin(1:2:end))) && ...
138141
any(strcmp('angle', varargin(1:2:end)))
139142
warning('spinw:genlattice:WrongInput', ...
@@ -293,4 +296,4 @@
293296

294297
obj.unit.nformula = int32(param.nformula);
295298

296-
end
299+
end

tutorials/publish/tutorial4.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
% We define a square lattice in the ab plane, with Cu+ ions with S=1 spin.
33

44
AFsq = spinw;
5-
AFsq.genlattice('lat_const',[3 3 6],'angled',[90 90 90],'sym',0)
5+
AFsq.genlattice('lat_const',[3 3 6],'angled',[90 90 90])
66
AFsq.addatom('r',[0 0 0],'S', 1,'label','Cu1','color','b')
77
AFsq.table('atom')
88
plot(AFsq)

0 commit comments

Comments
 (0)