Skip to content
/ MuSTEM Public
forked from HamishGBrown/MuSTEM

Open source version of the MuSTEM multislice electron microscopy simulation code, developed at the University of Melbourne.

License

Notifications You must be signed in to change notification settings

ju-bar/MuSTEM

 
 

Repository files navigation

μSTEM

μSTEM is a transmission electron microscopy (TEM) simulation suite, in particular for scanning transmission electron microscopy (STEM) images, that was developed mainly at the University of Melbourne. The computing suite is based on the multislice method. More detail can be found in the manual and the following scientific paper:

Modelling the inelastic scattering of fast electrons, L.J. Allen, A.J. D'Alfonso and S.D. Findlay, Ultramicroscopy, Vol. 151, pp. 11-22, (2015).

This is a fork of the original µSTEM repository.

Precompiled executables

Prerequisites

  • 64-bit Windows OS
  • A CUDA enabled GPU with compute class 3.0 up to 7.5, GPU compute classes >7.5 are only supported on Linux with the Nvidia HPC SDK.
  • Version 10.1 of the Nvidia CUDA toolkit, this installs the .dll files necessary to run the GPU versions of μSTEM.

Prerequisites

  • 64-bit Windows OS
  • The CPU version is linked against the Intel OpenMP libraries. It requires libiomp5md.dll, which is provided in the zip archive with the executable.

Executables archive

Executables of previous versions can be found in the Executables folder of the repository.

Version changes

Version 6.3

  • Double-channeling code has been revisited and improved. Some of the input keys have been changed and old runfiles may be invalid now.
  • There is now an option to calculate STEM EELS with transition potentials but single channeling (faster but less accurate for thick samples and small detectors). Single channeling transition potential STEM-EELS output files are labelled "single_channeling".
  • New filters to reduce transition potential computation costs have been implemented:
    • transition potentials can be filtered by strength, affecting EFTEM and STEM EELS calculations
    • inelastic wave functions can be filtered by strength, affecting only STEM EELS double-channeling calculations Both filters can be used together or separately. The filters are turned off by setting the filter strength to 0.
  • The old filter to calculate for a fraction of the supercell in STEM EELS is removed.
  • Parts of the code have been reformatted and commented to improve readability and maintainability.

Version 6.2

  • Added STEM secondary electron imaging based on ionization tables also used for STEM EELS simulations. An iosotropic model is used to estimate the secondary electron emission into a user specified detector acceptance angle, and a user specified inelastic mean free path is used to estimate the decay of the SE signal towards the detector placed in the backwards direction.
  • Several parts of the code were cleaned up to improve readability and maintainability.
  • Minor bug fixes in console output.
  • Added remaining calculation time estimate (ETA) to console output.
  • Fixed absorptive code on GPU for non-equidistant slicing.
  • Fixed g-vector grid for odd grid sizes.
  • Added an example run file for high-resolution STEM EDX mapping of SrTiO3.
  • Changed double-channeling transition order input logics. Improved the interactive text.
  • Fixed a missing scaling factor for STEM-EELS QEP double-channeling calculations.
  • Activated all-atom ionization for double-channeling calculations in STEM.
  • Fixed an instability in transition potential calculations caused by a racing condition with OpenMP threads.
  • Reduced compiler optimization level to -O2 in the makefile to avoid too aggressive optimizations.

Version 6.1

  • Enforced a limit of the energy-loss range for EELS simulation to start with 1 eV, to ensure interpolation and not run as extrapolation.
  • Modified the plasmon menu to input "0" for no plasmon scattering to make that consistent with the other input menus.
  • Added custom EELS to support simulations beyond the energy range of the default EELS tables. Custom EELS files can be generated by J. Barthel ([email protected]) on reasonable request.
  • Added options display when calling muSTEM.exe options.
  • Added option omp_num_threads={number} to allow OpenMP setup by users. By default the number of threads is set to half of the number of logical cores on the CPU. The maximum used threads is capped to number of (cores - 1).
  • Modified GPU code summing over the diffraction plane. This now uses proper reduction and is faster than the previous implementation. The new implementation compiles with the old PGI Fortran compilers and with the current Nvidia HPC SDK (nvfortran), it also resolves an instability that existed with the absorptive model code.
  • Added a Linux makefile supporting GPU and CPU versions using the Nvidia HPC SDK and the Intel oneAPI.

Version 6.0

  • Added Monte-Carlo code to simulate plasmon scattering, see [B. Mendis, Ultramic. 206 (2019) 112816, doi:10.1016/j.ultramic.2019.112816].
  • Updated the example run files distributed in the executable zip files. These also contain a STEM example now. Thanks to Duncan Alexander (EPFL, Lausanne, CH) for pointing out a problem with the distributed run files.

Tutorial

Click here to download the μSTEM tutorial calculations, powerpoint and activity sheet.

Compiling source code

Linux

A makefile is provided in the repository that can be used to compile the source code on Linux systems. The makefile supports both the CPU and GPU versions of μSTEM. To compile the code running on CPU only, run make in the terminal from the root directory of the repository. For compiling code running on GPU run make mode=GPU. It is recommended to clean previous object files using make clean and make MODE=GPU clean before compiling a new version. Adopt to your system / compiler installations. The distributed version assumes (CPU) the Intel oneAPI (ifx) and (GPU) the Nvidia HPC SDK (nvfortran).

Windows

A compile_gpu.bat is provided with the repository to produce a GPU version of μSTEM. This script assumes that the PGI Fortran compiler is installed. The repository also contains solution and project files for Microsoft Visual Studio 2022 set up to work with the Intel oneAPI for producing a CPU version of µSTEM.

Compiler and CUDA versions should be compatible and also support the hardware you are using.

Notes

  • Test parallelization success with compiler options: /Qopt-report=2 /Qopt-report-phase=vec /Qopt-report-file:stdout

Contributing

Please contact Dr. Hamish Brown with project suggestions and contributions.

Authors

License

This project is licensed under the GNU GPLv3.0 - see the LICENSE.txt file for details.

Acknowledgments

Les Allen, Adrian D'Alfonso and Scott Findlay originally took the initiative to make this code publicly available, with Adrian D'Alfonso taking on the considerable task of setting up the GPU code. Hamish Brown and Ben Forbes have subsequently made substantial refinements and extensions, with Ben Forbes responsible for several efficiency improvements. The code was developed mainly at the University of Melbourne. We would like to acknowledge the contributions of Mark Oxley and Chris Rossouw to the theoretical and numerical aspects of collaborative research that underpins μSTEM.

In particular, the code IONIZER, whose primary author has been Mark Oxley, was used to set up the parametrized atomic scattering factors for ionization used in μSTEM. Eireann Cosgriff, Torgny Josefsson, Nathan Lugg, Andrew Martin, Gary Ruben and Chris Witte have been members of the group at Melbourne University at various stages and all made contributions to our understanding of inelastic scattering and the simulation thereof.

About

Open source version of the MuSTEM multislice electron microscopy simulation code, developed at the University of Melbourne.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Fortran 92.4%
  • TeX 6.1%
  • Batchfile 0.5%
  • ImageJ Macro 0.5%
  • Makefile 0.3%
  • MATLAB 0.1%
  • Python 0.1%