Skip to content

Commit

Permalink
MULTEM 2.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivanlh20 committed Jul 6, 2020
1 parent 5dec0e7 commit ee95c8a
Show file tree
Hide file tree
Showing 191 changed files with 44,493 additions and 14,448 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*.wisdom
*.exe
*.dll
*.asv
*.7z
*Copy*.cuh
*Copy*.hpp
Expand Down
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The Matlab interface is the recommended way for researchers.

Remarks
=================================
In order to use the GPU capability of MULTEM, you need a Nvidia Graphic card with **compute capability greater than 2.0** and **CUDA 8.0** installed in your operating system. You can check the compute capability of your graphic card using the following nvidia website: https://developer.nvidia.com/cuda-gpus.
In order to use the GPU capability of MULTEM, you need a Nvidia Graphic card with **compute capability greater than 2.0** and **CUDA 10.0** installed in your operating system. You can check the compute capability of your graphic card using the following nvidia website: https://developer.nvidia.com/cuda-gpus.

Using precompile GUI interface
=================================
Expand All @@ -36,9 +36,9 @@ The precompile mexfiles are only available for Windows operating system.

Building MULTEM for Matlab
=================================
The following steps work using Matlab R2017a and CUDA 8.0. It assumes that Visual studio 2015 professional, g++4.9 or Clang(Xcode 8.x) compiler is installed in your operating system. Additionally, Multem also requires fftw3, blas and lapack libraries.
The following steps work using Matlab R2018a and CUDA 10.0. It assumes that Visual studio 2017 community, g++7.5 or Clang(Xcode 10.x) compiler is installed in your operating system. Additionally, Multem also requires fftw3, blas and lapack libraries.

- First of all, you have to set a C++ compiler to Matlab by executing the following comand: `mex -setup cpp`. Be aware that Matlab 2017a only support the above compilers.
- First of all, you have to set a C++ compiler to Matlab by executing the following comand: `mex -setup cpp`. Be aware that Matlab 2018a only support the above compilers.
- Then add to the Matlab path the following folders: crystalline_materials, matlab_functions and mex_bin.
- Run the `compile_mex_multem.m` script. This will create the required executable files to run the examples.
- Run the examples located in `mex_examples_multem`.
Expand All @@ -49,27 +49,25 @@ Troubleshooting

**for Windows:**

- Verify the installation of Visual studio 2015 professional.
- Verify the installation of Cuda 8.0 (https://developer.nvidia.com/cuda-downloads).
- Verify the installation of Visual studio 2017 community.
- Verify the installation of Cuda 10.0 (https://developer.nvidia.com/cuda-downloads).

**for Linux:**

- Verify that gcc-4.9 and g++4.9 are the default compilers installed in your operating system. In Ubuntu, it can be installed by executing the following commands:
- Verify that gcc-7.5 and g++7.5 are the default compilers installed in your operating system. In Ubuntu, it can be installed by executing the following commands:

* `sudo add-apt-repository ppa:ubuntu-toolchain-r/test`
* `sudo apt-get update`
* `sudo apt-get install gcc-4.9 g++-4.9`
* `sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9`
* `sudo apt-get install gcc-7.5 g++-7.5`

- Verify the correct installation of Cuda 8.0 (https://developer.nvidia.com/cuda-downloads).
- Verify the correct installation of Cuda 10.0 (https://developer.nvidia.com/cuda-downloads).

- Verify the installation of fftw3 libraries. In Ubuntu, it can be installed by executing the following command:
* `sudo apt-get install libfftw3-dev libfftw3-doc`

- Verify the installation of blas and lapack libraries. In Ubuntu, it can be installed by executing the following command:
* `sudo apt-get install libblas-dev liblapack-dev`

- Verify the installation path of cuda 8.0, fftw3, blas and lapack. Their installation paths should be specified in the `MEX.m` file located at `matlab_functions`.
- Verify the installation path of cuda 10.0, fftw3, blas and lapack. Their installation paths should be specified in the `MEX.m` file located at `matlab_functions`.

**Please cite MULTEM in your publications if it helps your research:**

Expand Down
18 changes: 9 additions & 9 deletions compile_mex_multem.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
files = {'mex_lambda',...
'mex_sigma',...
'mex_gamma',...
'mex_fxeg_tabulated_data',...
'mex_fxeg_data',...
'mex_feg',...
'mex_fxg',...
'mex_Pr',...
'mex_Vz',...
'mex_Vr',...
'mex_Vp',...
'mex_pr',...
'mex_vz',...
'mex_vr',...
'mex_vp',...
'mex_gmax',...
'mex_min_spl',...
'mex_mrad_2_rAngs',...
'mex_mrad_2_rAng',...
'mex_mrad_2_sigma',...
'mex_fwhm_2_sigma',...
'mex_hwhm_2_sigma',...
Expand All @@ -31,9 +31,9 @@
'mex_microscope_aberrations',...
'mex_projected_potential',...
'mex_transmission_function',...
'mex_wave_function',...
'mex_MULTEM'};
'mex_multem',...
'mex_wave_function'};

for file=files
disp(['Compiling ' file{1}])
run(['mex_files_multem/',file{1}])
Expand Down
23 changes: 23 additions & 0 deletions crystalline_materials/Ag001_xtl.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
function [atoms, lx, ly, lz, a, b, c, dz] = Ag001_xtl(na, nb, nc, ncu, rms3d)
xtl_parm.na = na;
xtl_parm.nb = nb;
xtl_parm.nc = nc;
a = 4.0853;
b = 4.0853;
c = 4.0853;
xtl_parm.a = a;
xtl_parm.b = b;
xtl_parm.c = c;
xtl_parm.nuLayer = 2;
occ = 1;
region = 0;
charge = 0;
% Ag = 47
% Z charge x y z rms3d occupancy region charge
xtl_parm.uLayer(1).atoms = [47, 0.0, 0.0, 0.0, rms3d, occ, region, charge; 47, 0.5, 0.5, 0.0, rms3d, occ, region, charge];
xtl_parm.uLayer(2).atoms = [47, 0.0, 0.5, 0.5, rms3d, occ, region, charge; 47, 0.5, 0.0, 0.5, rms3d, occ, region, charge];
atoms = il_crystal_by_lays(xtl_parm);

dz = xtl_parm.c/ncu;
lx = na*xtl_parm.a; ly = nb*xtl_parm.b; lz = nc*xtl_parm.c;
end
23 changes: 23 additions & 0 deletions crystalline_materials/Al001_xtl.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
function [atoms, lx, ly, lz, a, b, c, dz] = Al001_xtl(na, nb, nc, ncu, rms3d)
xtl_parm.na = na;
xtl_parm.nb = nb;
xtl_parm.nc = nc;
a = 4.0493;
b = 4.0493;
c = 4.0493;
xtl_parm.a = a;
xtl_parm.b = b;
xtl_parm.c = c;
xtl_parm.nuLayer = 2;
occ = 1;
region = 0;
charge = 0;
% Al = 13
% Z charge x y z rms3d occupancy region charge
xtl_parm.uLayer(1).atoms = [13, 0.0, 0.0, 0.0, rms3d, occ, region, charge; 13, 0.5, 0.5, 0.0, rms3d, occ, region, charge];
xtl_parm.uLayer(2).atoms = [13, 0.0, 0.5, 0.5, rms3d, occ, region, charge; 13, 0.5, 0.0, 0.5, rms3d, occ, region, charge];
atoms = il_crystal_by_lays(xtl_parm);

dz = xtl_parm.c/ncu;
lx = na*xtl_parm.a; ly = nb*xtl_parm.b; lz = nc*xtl_parm.c;
end
26 changes: 26 additions & 0 deletions crystalline_materials/Au001_xtl.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function [atoms, lx, ly, lz, a, b, c, dz] = Au001_xtl(na, nb, nc, ncu, rms3d)
xtl_parm.na = na;
xtl_parm.nb = nb;
xtl_parm.nc = nc;
a = 4.0780;
b = 4.0780;
c = 4.0780;
% a = 4.07003925431053;
% b = a;
% c = a;
xtl_parm.a = a;
xtl_parm.b = b;
xtl_parm.c = c;
xtl_parm.nuLayer = 2;
occ = 1;
region = 0;
charge = 0;
% Au = 79
% Z x y z rms3d occupancy charge
xtl_parm.uLayer(1).atoms = [79, 0.0, 0.0, 0.0, rms3d, occ, region, charge; 79, 0.5, 0.5, 0.0, rms3d, occ, region, charge];
xtl_parm.uLayer(2).atoms = [79, 0.0, 0.5, 0.5, rms3d, occ, region, charge; 79, 0.5, 0.0, 0.5, rms3d, occ, region, charge];
atoms = il_crystal_by_lays(xtl_parm);

dz = xtl_parm.c/ncu;
lx = na*xtl_parm.a; ly = nb*xtl_parm.b; lz = nc*xtl_parm.c;
end
23 changes: 23 additions & 0 deletions crystalline_materials/Au110_xtl.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
function [atoms, lx, ly, lz, a, b, c, dz] = Au110_xtl(na, nb, nc, ncu, rms3d)
xtl_parm.na = na;
xtl_parm.nb = nb;
xtl_parm.nc = nc;
a = 4.0780/sqrt(2);
b = 4.0780;
c = 4.0780/sqrt(2);
xtl_parm.a = a;
xtl_parm.b = b;
xtl_parm.c = c;
xtl_parm.nuLayer = 2;
occ = 1;
region = 0;
charge = 0;
% Au = 79
% Z charge x y z rms3d occupancy region charge
xtl_parm.uLayer(1).atoms = [79, 0.00, 0.00, 0.00, rms3d, 1.0];
xtl_parm.uLayer(2).atoms = [79, 0.50, 0.50, 0.50, rms3d, 1.0];
atoms = il_crystal_by_lays(xtl_parm);

dz = xtl_parm.c/ncu;
lx = na*xtl_parm.a; ly = nb*xtl_parm.b; lz = nc*xtl_parm.c;
end
23 changes: 23 additions & 0 deletions crystalline_materials/Cu001_xtl.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
function [atoms, lx, ly, lz, a, b, c, dz] = Cu001_xtl(na, nb, nc, ncu, rms3d)
xtl_parm.na = na;
xtl_parm.nb = nb;
xtl_parm.nc = nc;
a = 3.6150;
b = 3.6150;
c = 3.6150;
xtl_parm.a = a;
xtl_parm.b = b;
xtl_parm.c = c;
xtl_parm.nuLayer = 2;
occ = 1;
region = 0;
charge = 0;
% Cu = 29
% Z charge x y z rms3d occupancy region charge
xtl_parm.uLayer(1).atoms = [29, 0.0, 0.0, 0.0, rms3d, occ, region, charge; 29, 0.5, 0.5, 0.0, rms3d, occ, region, charge];
xtl_parm.uLayer(2).atoms = [29, 0.0, 0.5, 0.5, rms3d, occ, region, charge; 29, 0.5, 0.0, 0.5, rms3d, occ, region, charge];
atoms = il_crystal_by_lays(xtl_parm);

dz = xtl_parm.c/ncu;
lx = na*xtl_parm.a; ly = nb*xtl_parm.b; lz = nc*xtl_parm.c;
end
23 changes: 23 additions & 0 deletions crystalline_materials/Diamond110_xtl.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
function [atoms, lx, ly, lz, a, b, c, dz] = Diamond110_xtl(na, nb, nc, ncu, rms3d)
xtl_parm.na = na;
xtl_parm.nb = nb;
xtl_parm.nc = nc;
a = 3.56/sqrt(2);
b = 3.56;
c = sqrt(2)*3.56/2;
xtl_parm.a = a;
xtl_parm.b = b;
xtl_parm.c = c;
xtl_parm.nuLayer = 2;
occ = 1;
region = 0;
charge = 0;
% C = 6
% Z x y z rms3d occupancy charge
xtl_parm.uLayer(1).atoms = [6, 0.00, 0.00, 0.00, rms3d, occ, region, charge; 6, 0.50, 0.75, 0.00, rms3d, occ, region, charge];
xtl_parm.uLayer(2).atoms = [6, 0.00, 0.25, 0.50, rms3d, occ, region, charge; 6, 0.50, 0.50, 0.50, rms3d, occ, region, charge];
atoms = il_crystal_by_lays(xtl_parm);

dz = xtl_parm.c/ncu;
lx = na*xtl_parm.a; ly = nb*xtl_parm.b; lz = nc*xtl_parm.c;
end
26 changes: 26 additions & 0 deletions crystalline_materials/GaAs001_xtl.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function [atoms, lx, ly, lz, a, b, c, dz] = GaAs001_xtl(na, nb, nc, ncu, rms3d)
xtl_parm.na = na;
xtl_parm.nb = nb;
xtl_parm.nc = nc;
a = 5.6537;
b = 5.6537;
c = 5.6537;
xtl_parm.a = a;
xtl_parm.b = b;
xtl_parm.c = c;
xtl_parm.nuLayer = 4;
occ = 1;
region = 0;
charge = 0;
% Ga = 31, As = 33;
% Z charge x y z rms3d occupancy region charge
xtl_parm.uLayer(1).atoms = [31, 0.00, 0.00, 0.00, rms3d, occ, region, charge; 31, 0.50, 0.50, 0.00, rms3d, occ, region, charge]; %Ga
xtl_parm.uLayer(2).atoms = [33, 0.25, 0.25, 0.25, rms3d, occ, region, charge; 33, 0.75, 0.75, 0.25, rms3d, occ, region, charge]; %As
xtl_parm.uLayer(3).atoms = [31, 0.00, 0.50, 0.50, rms3d, occ, region, charge; 31, 0.50, 0.00, 0.50, rms3d, occ, region, charge]; %Ga
xtl_parm.uLayer(4).atoms = [33, 0.75, 0.25, 0.75, rms3d, occ, region, charge; 33, 0.25, 0.75, 0.75, rms3d, occ, region, charge]; %As

atoms = il_crystal_by_lays(xtl_parm);

dz = xtl_parm.c/ncu;
lx = na*xtl_parm.a; ly = nb*xtl_parm.b; lz = nc*xtl_parm.c;
end
24 changes: 24 additions & 0 deletions crystalline_materials/LaAlO3001_xtl.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
function [atoms, lx, ly, lz, a, b, c, dz] = LaAlO3001_xtl(na, nb, nc, ncu, rms3d)
xtl_parm.na = na;
xtl_parm.nb = nb;
xtl_parm.nc = nc;
a = 3.7900;
b = 3.79;
c = 3.79;
xtl_parm.a = a;
xtl_parm.b = b;
xtl_parm.c = c;
xtl_parm.nuLayer = 2;
occ = 1;
region = 0;
charge = 0;
% Sr = 38, Ti = 22; O = 8
% La = 57, Al = 13; O = 8
% Z charge x y z rms3d occupancy region charge
xtl_parm.uLayer(1).atoms = [57, 0.0, 0.0, 0.0, rms3d, occ, region, charge; 8, 0.5, 0.5, 0.0, rms3d, occ, region, charge];
xtl_parm.uLayer(2).atoms = [8, 0.0, 0.5, 0.5, rms3d, occ, region, charge; 8, 0.5, 0.0, 0.5, rms3d, occ, region, charge; 13, 0.5, 0.5, 0.5, rms3d, occ, region, charge];
atoms = il_crystal_by_lays(xtl_parm);

dz = xtl_parm.c/ncu;
lx = na*xtl_parm.a; ly = nb*xtl_parm.b; lz = nc*xtl_parm.c;
end
23 changes: 23 additions & 0 deletions crystalline_materials/Mo001_xtl.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
function [atoms, lx, ly, lz, a, b, c, dz] = Mo001_xtl(na, nb, nc, ncu, rms3d)
xtl_parm.na = na;
xtl_parm.nb = nb;
xtl_parm.nc = nc;
a = 3.1470;
b = 3.1470;
c = 3.1470;
xtl_parm.a = a;
xtl_parm.b = b;
xtl_parm.c = c;
xtl_parm.nuLayer = 2;
occ = 1;
region = 0;
charge = 0;
% Mo = 42
% Z charge x y z rms3d occupancy region charge
xtl_parm.uLayer(1).atoms = [42, 0.0, 0.0, 0.0, rms3d, occ, region, charge];
xtl_parm.uLayer(2).atoms = [42, 0.5, 0.5, 0.5, rms3d, occ, region, charge];
atoms = il_crystal_by_lays(xtl_parm);

dz = xtl_parm.c/ncu;
lx = na*xtl_parm.a; ly = nb*xtl_parm.b; lz = nc*xtl_parm.c;
end
25 changes: 25 additions & 0 deletions crystalline_materials/PdH001_xtl.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
function [atoms, lx, ly, lz, a, b, c, dz] = PdH001_xtl(na, nb, nc, ncu, rms3d)
xtl_parm.na = na;
xtl_parm.nb = nb;
xtl_parm.nc = nc;
a = 4.025;
b = 4.025;
c = 4.025;
xtl_parm.a = a;
xtl_parm.b = b;
xtl_parm.c = c;
xtl_parm.nuLayer = 2;
occ = 1;
region = 0;
charge = 0;
% Pd = 46, H = 1
% Z charge x y z rms3d occupancy region charge
xtl_parm.uLayer(1).atoms = [46, 0.0, 0.0, 0.0, rms3d, occ, region, charge; 46, 0.5, 0.5, 0.0, rms3d, occ, region, charge;...
1, 0.5, 0.0, 0.0, rms3d, occ, region, charge; 1, 0.0, 0.5, 0.0, rms3d, occ, region, charge];
xtl_parm.uLayer(2).atoms = [46, 0.0, 0.5, 0.5, rms3d, occ, region, charge; 46, 0.5, 0.0, 0.5, rms3d, occ, region, charge;...
1, 0.0, 0.0, 0.5, rms3d, occ, region, charge; 1, 0.5, 0.5, 0.5, rms3d, occ, region, charge];
atoms = il_crystal_by_lays(xtl_parm);

dz = xtl_parm.c/ncu;
lx = na*xtl_parm.a; ly = nb*xtl_parm.b; lz = nc*xtl_parm.c;
end
24 changes: 24 additions & 0 deletions crystalline_materials/Primitive_xtl.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
function [atoms, lx, ly, lz, a, b, c, dz] = Primitive_xtl(na, nb, nc, ncu, rms3d)
xtl_parm.na = na;
xtl_parm.nb = nb;
xtl_parm.nc = nc;
a = 4.0780;
b = 4.0780;
c = 4.0780;
a = 6.50;
b = 6.50;
xtl_parm.a = a;
xtl_parm.b = b;
xtl_parm.c = c;
xtl_parm.nuLayer = 1;
occ = 1;
region = 0;
charge = 0;
% Au = 79
% Z charge x y z rms3d occupancy region charge
xtl_parm.uLayer(1).atoms = [79, 0.5, 0.5, 0.0, rms3d, occ, region, charge];
atoms = il_crystal_by_lays(xtl_parm);

dz = xtl_parm.c/ncu;
lx = na*xtl_parm.a; ly = nb*xtl_parm.b; lz = nc*xtl_parm.c;
end
Loading

0 comments on commit ee95c8a

Please sign in to comment.