177 lines
4.9 KiB
Markdown
177 lines
4.9 KiB
Markdown
# Trim.SP - TRIM simulation #
|
|
|
|
### Contents ###
|
|
|
|
This repository contains the [Fortran] source code and an accompanying
|
|
graphical user interface ([GUI]) for TrimSP -
|
|
an application for performing [Monte Carlo] simulations of ion implantation.
|
|
|
|
* This code is specifically tuned to simulate implantation of low-energy projectiles in materials.
|
|
* The code is maintained by the Low Energy Muons ([LEM]) group at the Paul Scherrer Institute ([PSI]).
|
|
* The [GUI] is written in [Node.js], [JavaScript] and [Electron].
|
|
* The binary (statically linked) from the [Fortran] code is also included.
|
|
* Linux packages can be generated locally from the current source tree.
|
|
|
|
Further information can be found in the following publications:
|
|
|
|
- J. P. Biersack and W. Eckstein,
|
|
<i>Sputtering studies with the Monte Carlo program TRIM.SP</i>,
|
|
Appl. Phys. A <b>34</b> (2), 73-94 (1984).
|
|
<https://doi.org/10.1007/BF00614759>
|
|
- W. Eckstein,
|
|
<i>Computer Simulation of Ion-Solid Interactions</i>,
|
|
Springer Series in Materials Science Vol. 10
|
|
(Springer-Verlag, Berlin, Heidelberg, 1991).
|
|
<https://doi.org/10.1007/978-3-642-73513-4>
|
|
- W. Eckstein,
|
|
<i>Backscattering and sputtering with the Monte-Carlo program TRIM.SP</i>,
|
|
Radiat. Eff. Defects Solids <b>130-131</b> (1), 239-250 (1994).
|
|
<https://doi.org/10.1080/10420159408219787>
|
|
- E. Morenzoni et al.,
|
|
<i>Implantation studies of keV positive muons in thin metallic layers</i>,
|
|
Nucl. Instrum. Methods Phys. Res., Sect. B <b>192</b> (3), 245-266 (2002).
|
|
<https://doi.org/10.1016/S0168-583X(01)01166-1>
|
|
|
|
### Supported platforms ###
|
|
|
|
* [Linux]
|
|
* Online at: http://musruser.psi.ch/TrimSP/
|
|
|
|
### Installation ###
|
|
|
|
Packages are not stored in this repository. You can either run the application
|
|
directly from source or build Linux packages locally as described below.
|
|
|
|
###### Fortran code compilation ######
|
|
|
|
Install the `gfortran` compiler, then:
|
|
|
|
```bash
|
|
cd trimsp/fortran
|
|
make
|
|
```
|
|
|
|
This creates the `trimspNL` binary in the repository root. For packaged
|
|
Electron builds, copy or rebuild it into:
|
|
|
|
```text
|
|
resources/bin/trimspNL
|
|
```
|
|
|
|
The application will prefer that bundled copy when running from a packaged
|
|
install. During development it can still use a local checkout copy or a
|
|
`trimspNL` binary found in the configured path or in `PATH`.
|
|
|
|
###### Running the GUI ######
|
|
|
|
Install [Node.js] (`nodejs`, `nodejs-libs` and `npm`),
|
|
then run:
|
|
|
|
```bash
|
|
cd trimsp
|
|
npm install
|
|
npm start
|
|
```
|
|
|
|
Note: you do not need to run `npm install` every time.
|
|
Next time you can simply run `npm start` only.
|
|
|
|
###### Building RPM and DEB packages ######
|
|
|
|
Install [Node.js] (`nodejs`, `nodejs-libs` and `npm`), then run:
|
|
|
|
```bash
|
|
cd trimsp
|
|
cp trimspNL resources/bin/trimspNL
|
|
npm install
|
|
npm run make
|
|
```
|
|
|
|
This uses Electron Forge to build Linux packages from the current checkout.
|
|
The packaged application bundles `resources/bin/trimspNL` inside the app
|
|
resources, so make sure that file exists and is up to date before packaging.
|
|
|
|
The generated files are written under:
|
|
|
|
```text
|
|
out/make/deb/x64/
|
|
out/make/rpm/x64/
|
|
```
|
|
|
|
Typical output files are:
|
|
|
|
```text
|
|
out/make/deb/x64/trimsp_<version>_amd64.deb
|
|
out/make/rpm/x64/TrimSP-<version>-1.x86_64.rpm
|
|
```
|
|
|
|
Depending on the host system, additional packaging tools may be required for
|
|
the RPM/DEB build chain.
|
|
|
|
###### Building a Flatpak ######
|
|
|
|
Install the Flatpak build tools in addition to [Node.js]:
|
|
|
|
```bash
|
|
flatpak
|
|
flatpak-builder
|
|
eu-strip
|
|
```
|
|
|
|
Then run:
|
|
|
|
```bash
|
|
cd trimsp
|
|
cp trimspNL resources/bin/trimspNL
|
|
npm install
|
|
npm run make:flatpak
|
|
```
|
|
|
|
This uses Electron Forge's Flatpak maker and writes the resulting `.flatpak`
|
|
under:
|
|
|
|
```text
|
|
out/make/flatpak/x86_64/
|
|
```
|
|
|
|
The current Flatpak config grants access to the home directory and `/tmp`,
|
|
which matches how the packaged app currently handles simulation input/output.
|
|
|
|
###### Deploying on a web server ######
|
|
|
|
The browser version requires a server-side setup in addition to the static
|
|
HTML/JavaScript files.
|
|
|
|
In particular:
|
|
|
|
* the browser build uses `TrimSPweb.js` rather than the Electron-specific
|
|
`TrimSPelec.js`
|
|
* the simulation backend must be available on the server
|
|
* a web-exposed helper/CGI layer is required to create input files, run the
|
|
backend, and return the generated output
|
|
|
|
Notes:
|
|
|
|
* this repository does not currently include the CGI/backend helper used by
|
|
the online deployment
|
|
* a plain static web server is therefore not sufficient for running web
|
|
simulations from this checkout
|
|
* static hosting can still be used to test page loading only
|
|
|
|
### Contact ###
|
|
|
|
Zaher Salman <zaher.salman@psi.ch>
|
|
|
|
|
|
[Fortran]: https://fortran-lang.org/
|
|
[Node.js]: https://nodejs.org/en/
|
|
[JavaScript]: https://www.javascript.com/
|
|
[Electron]: https://www.electronjs.org/
|
|
[PSI]: https://www.psi.ch/en
|
|
[LEM]: https://www.psi.ch/en/low-energy-muons
|
|
[RPM]: https://rpm.org/
|
|
[DEB]: https://en.wikipedia.org/wiki/Deb_(file_format)
|
|
[Linux]: https://en.wikipedia.org/wiki/Linux
|
|
[Monte Carlo]: https://en.wikipedia.org/wiki/Monte_Carlo_method
|
|
[GUI]: https://en.wikipedia.org/wiki/Graphical_user_interface
|