Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
373e48a
Changed interface with Horace
mducle Feb 2, 2017
ea3f067
Merge branch 'master' into horace-dev
mducle Feb 2, 2017
607c837
Merge branch 'master' into horace-dev
mducle Feb 4, 2017
95822db
Fixed bug in sigma/fwhm definition in horace_sqw.m
mducle Feb 4, 2017
e2774ea
Renamed mtimesx to sw_mtimesx. Changed Sab calculation to use sw_mtim…
mducle Feb 5, 2017
507b791
Fixed sw_mex - checked on Matlab 2015b on Windows 7 and Linux.
mducle Feb 5, 2017
07de967
Changed hermitian inverse V transf code to use bsxfun.
mducle Feb 5, 2017
c0fb015
stupid directory rename mfiles->swfiles
mducle Feb 6, 2017
ec480c3
Merge branch 'master' into horace-dev
mducle Feb 6, 2017
8f22678
First try: Combined spinwave+sw_neutron in slice loop to save memory.…
mducle Feb 8, 2017
7c7e382
Combined spinwave+sw_neutron - works with helical structure.
mducle Feb 10, 2017
70e97dc
spinwave+sw_neutron: clean up code.
mducle Feb 10, 2017
31bbbf4
Merge branch 'master' into horace-dev
mducle Feb 10, 2017
d12dbe9
Changed mmat for incomm to sw_mtimesx if useMex
mducle Feb 10, 2017
33f6b85
Changed spinwave.m routines to use positive eigenvalues only
mducle Feb 11, 2017
4b7e6fd
Merge branch 'master' into horace-dev
mducle Feb 12, 2017
dcbccea
Renamed spinwavefast.m, restored original spinwave.m
mducle Feb 13, 2017
18b6d05
Merge branch 'master' into horace-dev
mducle Feb 13, 2017
2209c01
Fixed bug in spinwave.m for mex hermitian solver.
mducle Feb 13, 2017
54755cd
testing mex on OSX
tsdev Feb 13, 2017
785bbf2
Merge remote-tracking branch 'origin/horace-dev' into horace-dev
tsdev Feb 13, 2017
3eb2e95
fixing the negative energy eigenvalue problem
tsdev Feb 13, 2017
911136a
Fixed sort indexing bug in spinwavefast.m for nonhermitian.
mducle Feb 14, 2017
9507014
Fixed uninitialised variable bug in eig_omp.cpp.
mducle Feb 14, 2017
308c5ff
Changed hamiltonian construction to avoid repmat / concatenation
mducle Feb 28, 2017
535ac7f
Removed sorting from nonhermitian solver. Use sorting in eigorth/mex …
mducle Feb 28, 2017
20ecac6
Reverted accidental commit of other hacks...
mducle Feb 28, 2017
5dc3687
Convert horace_disp to unix line endings.
mducle Feb 28, 2017
727909d
Merge branch 'master' into horace-dev
tsdev Mar 28, 2017
9e7827b
added spinw.horace
tsdev Oct 11, 2017
02941ca
Merge branch 'master' into horace-dev
tsdev Oct 11, 2017
f197738
Merge branch 'master' into horace-dev
tsdev Oct 11, 2017
146b98a
moved class definition into folder
tsdev Oct 11, 2017
0e582eb
removing twins from spinw.spinwavefast
tsdev Oct 11, 2017
c6a158f
allocate memory for Sperp in spinwavefast
tsdev Oct 11, 2017
e75b13c
Fixed typos and missing check in addatom
mducle Jan 16, 2019
d843e9c
Merge pull request #5 from mducle/addatom_fix
Jan 16, 2019
31dada9
Remove warnings for optmagk
Jan 16, 2019
d9e096e
Modify sw_version information
Jan 16, 2019
888c18b
Change doc reference string
Jan 16, 2019
dc52627
Merge branch 'master' into horace-dev
mducle Jan 18, 2019
aa035b7
Small fixes for typos; rename files
mducle Jan 18, 2019
4a28be4
Modified eig_omp.cpp to handle single-precision floats too (Horace us…
mducle Jan 20, 2019
79c9406
Modified chol_omp.cpp to handle singles
mducle Jan 20, 2019
5d94149
Cleanup code, updated spinwavefast
mducle Jan 20, 2019
2abd95a
Cleanup. Added Linux mex. Removed horace_disp.m
mducle Jan 22, 2019
6f9838a
Merge pull request #6 from mducle/horace-dev
Jan 22, 2019
7b0e3dc
More fixes for symbolic
Jan 22, 2019
6012cc3
Fixed bugs in eig_omp again (stupid pointers!)
mducle Jan 23, 2019
3d24fea
Added damped harmonic (bcc-Fe) and coord transform (pcsmo) to horace_sqw
mducle Jan 23, 2019
2cba061
Added linux compiled eig_omp.mexa64
mducle Jan 23, 2019
c33a842
Merge pull request #7 from mducle/horace-dev
Jan 23, 2019
15a3ae1
Updated sw_release to ignore git files
mducle Jan 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions dev/sw_release.m
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,21 @@ function sw_release(verNum, tempDir)
% files with '~' and 'sw_release.m' file
fList = rdir('**/*');
fListZip = {};
if ispc
sp = '\';
else
sp = '/';
end
dirname = [pwd sp];

for ii = 1:numel(fList)
if (~any(strfind(fList(ii).name,[filesep '.']))) && (~any(strfind(fList(ii).name,'~'))) ...
&& (~any(strfind(fList(ii).name,[filesep 'dev' filesep]))) ...
&& (~any(strfind(fList(ii).name,[filesep 'docs' filesep]))) ...
&& (~any(strfind(fList(ii).name,[filesep 'test' filesep]))) ...
&& (~any(strfind(fList(ii).name,[filesep 'tutorials' filesep])))
fListZip{end+1} = fList(ii).name;
&& (~any(strfind(fList(ii).name,[filesep 'tutorials' filesep]))) ...
&& (~any(strfind(fList(ii).folder,'git')))
fListZip{end+1} = [replace(fList(ii).folder, dirname, '') sp fList(ii).name];
end
end

Expand Down
218 changes: 139 additions & 79 deletions external/chol_omp/chol_omp.cpp

Large diffs are not rendered by default.

Binary file modified external/chol_omp/chol_omp.mexa64
Binary file not shown.
Binary file modified external/chol_omp/chol_omp.mexw64
Binary file not shown.
499 changes: 310 additions & 189 deletions external/eig_omp/eig_omp.cpp

Large diffs are not rendered by default.

Binary file modified external/eig_omp/eig_omp.mexa64
Binary file not shown.
Binary file modified external/eig_omp/eig_omp.mexw64
Binary file not shown.
2 changes: 1 addition & 1 deletion external/eigorth.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
% Use OpenMP parallelised mex file if it exists
if nStack>1 && useMex
% eigenvalues are already orthogonalised by eig_omp
[V, D] = eig_omp(M,'orth');
[V, D] = eig_omp(M,'orth','sort','descend');
return
end

Expand Down
Binary file removed external/mtimesx/mtimesx.mexw64
Binary file not shown.
File renamed without changes.
2 changes: 2 additions & 0 deletions external/mtimesx/mtimesx.m → external/mtimesx/sw_mtimesx.m
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
%
% ---------------------------------------------------------------------------------------------------------------------------------

%{
function varargout = mtimesx(varargin)

%\
Expand All @@ -277,3 +278,4 @@
[varargout{1:nargout}] = mtimesx(varargin{:});

end
%}
File renamed without changes.
Binary file added external/mtimesx/sw_mtimesx.mexw64
Binary file not shown.
12 changes: 8 additions & 4 deletions swfiles/@spinw/addatom.m
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function addatom(obj, varargin)

inpForm.fname = [inpForm.fname {'bx' 'formfactn' 'formfactx' 'b' 'formfact' 'A' 'Z' }];
inpForm.defval = [inpForm.defval {[] [] [] [] [] [] [] }];
inpForm.size = [inpForm.size {[1 -7] [-8 -9] [-8 -9] [1 -7] [-8 -9] [1 -7] [1 -7]}];
inpForm.size = [inpForm.size {[1 -7] [-1 -9] [-1 -10] [1 -7] [-8 -9] [1 -7] [1 -7]}];
inpForm.soft = [inpForm.soft {true true true true true true true }];

newAtom = sw_readparam(inpForm, varargin{:});
Expand Down Expand Up @@ -324,7 +324,7 @@ function addatom(obj, varargin)
newAtom.formfactx = {newAtom.formfactx};
end
if iscell(newAtom.formfactx)
[~,newAtom.ffx] = sw_cff(newAtom.fromfactx);
[~,newAtom.ffx] = sw_cff(newAtom.formfactx);
%newAtom.ffx = permute(newAtom.ffx,[3 2 1]);
elseif ~isempty(newAtom.formfactx)
newAtom.ffx = newAtom.formfactx;
Expand All @@ -339,7 +339,11 @@ function addatom(obj, varargin)
newAtom.b = ones(2,nNewAtom);

% get neutron scattering length
newAtom.b(1,:) = sw_nb(newAtom.label);
if isempty(newAtom.bn)
newAtom.b(1,:) = sw_nb(newAtom.label);
else
newAtom.b(1,:) = newAtom.bn;
end


newAtom.Z = int32(newAtom.Z);
Expand Down Expand Up @@ -409,4 +413,4 @@ function addatom(obj, varargin)
warning('spinw:addatom:WrongInput','Occupancy on some site is larger than 1!')
end

end
end
2 changes: 1 addition & 1 deletion swfiles/@spinw/genmagstr.m
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ function genmagstr(obj, varargin)
% default value
param.n = repmat([0 0 1],[nK 1]);
end
n = bsxfun(@rdivide,param.n,sqrt(sum(param.n.^2,2)));
n = bsxfunsym(@rdivide,param.n,sqrt(sum(param.n.^2,2)));

if size(param.n,1) ~= nK
error('spinw:genmagstr:WrongInput',['The number of normal vectors has'...
Expand Down
100 changes: 74 additions & 26 deletions swfiles/@spinw/horace.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@
% * `fid` File ID provided by the `fopen` command, the output is written
% into the opened file stream.
%
% `'useFast'`
% : whether to use the spinw.spinwavefast method or not. This method
% is similar to spinw.spinwave but calculates only the unpolarised
% neutron cross-section and ignores all negative energy branches
% as well as using other shortcuts. In general it should produce
% the same spectra as spinw.spinwave, with some rounding errors,
% but can be 2-3 times faster and uses less memory.
%
% ### Output Arguments
%
% `w`
Expand All @@ -122,13 +130,25 @@
return
end

inpForm.fname = {'component' 'norm' 'dE' 'parfunc' 'param' 'func' 'fid'};
inpForm.defval = {'Sperp' false 0 @obj.matparser [] [] -1 };
inpForm.size = {[1 -1] [1 1] [1 1] [1 1] [1 -2] [1 1] [1 1]};
inpForm.soft = {false false false false true true false};
inpForm.fname = {'component' 'norm' 'dE' 'parfunc' 'param' 'func' 'fid' 'useFast'};
inpForm.defval = {'Sperp' false 0 @obj.matparser [] [] -1 1};
inpForm.size = {[1 -1] [1 1] [1 1] [1 1] [1 -2] [1 1] [1 1] [1 1]};
inpForm.soft = {false false false false true true false false};

warnState = warning('off','sw_readparam:UnreadInput');
param = sw_readparam(inpForm, varargin{:});
% To handle matlab fitting syntax, which may set the first argument to the
% fittable parameter (without keyword).
if ~ischar(varargin{1})
param = sw_readparam(inpForm, varargin{2:end});
if isempty(param.param)
varargin = [varargin {'param'} varargin(1)];
end
% always override keyword specified parameters
param.param = varargin{1};
varargin(1) = [];
else
param = sw_readparam(inpForm, varargin{:});
end
pref = swpref;

if ~isempty(param.param)
Expand Down Expand Up @@ -158,24 +178,6 @@
param.func(obj);
end

% calculate spin wave spectrum
if nargin > 5
% include the fitmode option to speed up calculation
if numel(varargin) == 1
varargin{1}.fitmode = 2;
spectra = obj.spinwave([qh(:) qk(:) ql(:)]',varargin{1});
else
spectra = obj.spinwave([qh(:) qk(:) ql(:)]',varargin{:},'fitmode',true);
end
else
spectra = obj.spinwave([qh(:) qk(:) ql(:)]','fitmode',true);
end
warning(warnState);

% calculate Sperp
spectra = sw_neutron(spectra,'pol',false);


% parse the component string
if iscell(param.component)
nConv = numel(param.component);
Expand All @@ -193,17 +195,63 @@
param.component = {param.component};
end

needSab = false;
for ii = 1:numel(parsed)
par0 = parsed{ii};
for jj = 1:length(par0.type)
if par0.type{jj}(1) ~= 1
needSab = true;
break;
end
end
end

% calculate spin wave spectrum
if nargin > 5
% include the fitmode option to speed up calculation
if numel(varargin) == 1
varargin{1}.fitmode = 2;
if needSab || ~param.useFast
spectra = obj.spinwave([qh(:) qk(:) ql(:)]',varargin{1});
else
spectra = obj.spinwavefast([qh(:) qk(:) ql(:)]',varargin{1});
end
else
if needSab || ~param.useFast
spectra = obj.spinwave([qh(:) qk(:) ql(:)]',varargin{:},'fitmode',true);
else
spectra = obj.spinwavefast([qh(:) qk(:) ql(:)]',varargin{:},'fitmode',true);
end
end
else
if needSab || ~param.useFast
spectra = obj.spinwave([qh(:) qk(:) ql(:)]','fitmode',true);
else
spectra = obj.spinwavefast([qh(:) qk(:) ql(:)]','fitmode',true);
end
end
warning(warnState);

% calculate Sperp
if needSab || ~param.useFast
spectra = sw_neutron(spectra,'pol',false);
end

% pack all cross section into a cell for easier looping
if iscell(spectra.omega)
nTwin = numel(spectra.omega);
omega = spectra.omega;
Sab = spectra.Sab;
if needSab
Sab = spectra.Sab;
end
Sperp = spectra.Sperp;

else
nTwin = 1;
omega = {spectra.omega};
Sab = {spectra.Sab};
if needSab
Sab = {spectra.Sab};
end
Sperp = {spectra.Sperp};
end

Expand Down Expand Up @@ -278,4 +326,4 @@
% intensity in cell
s = mat2cell(DSF' ,nHkl,ones(nMode*nTwin,1));

end
end
Loading