Skip to content

Commit

Permalink
Fix 'sym', 0 behaviour and tutorial 4 #205
Browse files Browse the repository at this point in the history
  • Loading branch information
mducle committed Oct 22, 2024
1 parent e41f848 commit 5942e20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions swfiles/@spinw/genlattice.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,14 @@
' instead']);
if ~isempty(param.sym)
error('spinw:genlattice:WrongInput', ...
'Both sym and spgr provided - note sym will be used.');
'Both sym and spgr provided - please only use sym.');
else
param.sym = param.spgr;
end
end
if isnumeric(param.sym) && param.sym == 0
param.sym = [];
end
if any(strcmp('angled', varargin(1:2:end))) && ...
any(strcmp('angle', varargin(1:2:end)))
warning('spinw:genlattice:WrongInput', ...
Expand Down Expand Up @@ -293,4 +296,4 @@

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

end
end
2 changes: 1 addition & 1 deletion tutorials/publish/tutorial4.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
% We define a square lattice in the ab plane, with Cu+ ions with S=1 spin.

AFsq = spinw;
AFsq.genlattice('lat_const',[3 3 6],'angled',[90 90 90],'sym',0)
AFsq.genlattice('lat_const',[3 3 6],'angled',[90 90 90])
AFsq.addatom('r',[0 0 0],'S', 1,'label','Cu1','color','b')
AFsq.table('atom')
plot(AFsq)
Expand Down

0 comments on commit 5942e20

Please sign in to comment.