Skip to content

Commit 1a9732d

Browse files
authored
Merge pull request #237 from lcpp-org/dev
Add development features to main branch and increment minor and patch version numbers.
2 parents 9cbede6 + 98c657a commit 1a9732d

26 files changed

+1277
-445
lines changed

.github/workflows/rustbca_compile_check.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
sudo apt-get install curl
2424
- name: Install rust
2525
run: |
26-
curl --proto '=https' --tlsv1.2 -sSf -y https://sh.rustup.rs | sh
26+
curl --proto '=https' --tlsv1.2 -sSf -y https://sh.rustup.rs | sh
2727
sudo apt-get install rustc cargo
2828
- name: Install pip for Python-3
2929
run: |
@@ -43,7 +43,7 @@ jobs:
4343
python3 examples/test_rustbca.py
4444
- name: Test Fortran and C bindings
4545
run : |
46-
cargo build --release
46+
cargo build --release --lib --features parry3d
4747
cp examples/test_rustbca.f90 .
4848
gfortran -c rustbca.f90 target/release/liblibRustBCA.so
4949
gfortran test_rustbca.f90 rustbca.f90 target/release/liblibRustBCA.so
@@ -53,7 +53,7 @@ jobs:
5353
./a.out
5454
- name: Test RustBCA
5555
run: |
56-
cargo test --features cpr_rootfinder_netlib,hdf5_input,distributions,parry3d
56+
cargo test --features cpr_rootfinder,hdf5_input,distributions,parry3d
5757
- name: Run Examples
5858
run: |
5959
cargo run --release 0D examples/boron_nitride_0D.toml
@@ -65,4 +65,6 @@ jobs:
6565
./target/release/RustBCA SPHERE examples/boron_nitride_sphere.toml
6666
cargo run --release --features parry3d TRIMESH examples/tungsten_twist_trimesh.toml
6767
./target/release/RustBCA examples/boron_nitride_wire.toml
68-
68+
cat boron_nitride_summary.output
69+
./target/release/RustBCA HOMOGENEOUS2D examples/boron_nitride_wire_homogeneous.toml
70+
cat boron_nitride_h_summary.output

Cargo.toml

+12-18
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[package]
22
name = "RustBCA"
3-
version = "2.0.1"
3+
version = "2.8.4"
44
default-run = "RustBCA"
55
authors = ["Jon Drobny <drobny2@illinois.edu>", "Jon Drobny <jdrobny@tae.com>"]
6-
edition = "2018"
6+
edition = "2021"
77

88
[[bin]]
99
name = "RustBCA"
@@ -15,26 +15,22 @@ path = "src/lib.rs"
1515
crate-type = ["cdylib", "lib"]
1616

1717
[dependencies]
18-
rand = "0.8.3"
19-
rand_distr = "0.4.2"
20-
toml = "0.5.8"
21-
anyhow = "1.0.38"
22-
itertools = "0.10.0"
23-
rayon = "1.5.0"
24-
geo = {version = "0.17.1", optional = false}
18+
rand = "0.8.5"
19+
rand_distr = "0.4.3"
20+
toml = "0.7.4"
21+
anyhow = "1.0.71"
22+
itertools = "0.10.5"
23+
rayon = "1.7.0"
24+
geo = {version = "0.25", optional = false}
2525
indicatif = {version = "0.15.0", features=["rayon"]}
26-
serde = { version = "1.0.123", features = ["derive"] }
26+
serde = { version = "1.0.163", features = ["derive"] }
2727
hdf5 = {version = "0.7.1", optional = true}
28-
openblas-src = {version = "0.9", optional = true}
29-
netlib-src = {version = "0.8", optional = true}
30-
intel-mkl-src = {version = "0.6.0", optional = true}
3128
rcpr = { git = "https://github.com/drobnyjt/rcpr", optional = true}
3229
ndarray = {version = "0.14.0", features = ["serde"], optional = true}
3330
parry3d-f64 = {optional = true, version="0.2.0"}
34-
egui = {version = "0.15.0", optional = true}
3531

3632
[dependencies.pyo3]
37-
version = "0.13.2"
33+
version = "0.19.0"
3834
features = ["extension-module"]
3935
optional = true
4036

@@ -49,9 +45,7 @@ debug = false
4945

5046
[features]
5147
hdf5_input = ["hdf5"]
52-
cpr_rootfinder_openblas = ["rcpr", "openblas-src"]
53-
cpr_rootfinder_netlib = ["rcpr", "netlib-src"]
54-
cpr_rootfinder_intel_mkl = ["rcpr", "intel-mkl-src"]
48+
cpr_rootfinder = ["rcpr"]
5549
distributions = ["ndarray"]
5650
no_list_output = []
5751
parry3d = ["parry3d-f64"]

README.md

+19-20
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
`RustBCA` is a general-purpose, high-performance code for simulating
44
ion-material interactions including sputtering, reflection, and implantation
55
using the binary collision approximation ([BCA]), written in [Rust]!
6-
RustBCA consists of a standalone code and libraries for including
6+
RustBCA includes a standalone version and libraries for including
77
ion-material interactions in simulations written in C/C++, Python,
88
and Fortran.
99

@@ -13,7 +13,9 @@ between an energetic ion and a target material. This includes reflection,
1313
implantation, and transmission of the incident ion, as well as sputtering
1414
and displacement damage of the target. Generally, [BCA] codes can be
1515
valid for incident ion energies between approximately ~1 eV/nucleon
16-
to <1 GeV/nucleon.
16+
to <1 GeV/nucleon. Improvements to RustBCA have expanded the regime
17+
of validity for some quantities, such as reflection coefficients, below
18+
1 eV/nucleon.
1719

1820
Check out the `RustBCA` [Wiki] for detailed information, installation
1921
instructions, use cases, examples, and more. See the RustBCA paper at the
@@ -27,6 +29,7 @@ Selected citations of RustBCA as of 5/24/23:
2729
* [hPIC2: A hardware-accelerated, hybrid particle-in-cell code for dynamic plasma-material interactions](https://doi.org/10.1016/j.cpc.2022.108569), LT Meredith et al. (2023)
2830
* [Global sensitivity analysis of a coupled multiphysics model to predict surface evolution in fusion plasma–surface interactions](https://doi.org/10.1016/j.commatsci.2023.112229), P. Robbe et al. (2023)
2931
* [Modeling the effect of nitrogen recycling on the erosion and leakage of tungsten impurities from the SAS-VW divertor in DIII-D during nitrogen gas injection](https://doi.org/10.1016/j.nme.2022.101254), MS Parsons et al. (2023)
32+
* [Enabling attractive-repulsive potentials in binary-collision-approximation monte-carlo codes for ion-surface interactions](https://doi.org/10.1088/2053-1591/ad1262), J Drobny and D Curreli (2023)
3033

3134
## Getting started
3235

@@ -53,7 +56,7 @@ Type "help", "copyright", "credits" or "license" for more information.
5356

5457
For those eager to get started with the standalone code, try running one of the examples in the
5558
`RustBCA/examples` directory. Note that to automatically manipulate input files and reproduce
56-
the plots located on the [Wiki], these require several optional, but common,
59+
the plots located on the [Wiki], these may require some optional
5760
[Python] packages (`matplotlib`, `numpy`, `scipy`, `shapely`, and `toml`).
5861

5962
### H trajectories and collision cascades in a boron nitride dust grain
@@ -103,32 +106,33 @@ plt.show()
103106
The following features are implemented in `RustBCA`:
104107

105108
* Ion-material interactions for all combinations of incident ion and target species.
106-
* Infinite, homogeneous targets (Mesh0D), Layered, finite-depth inhomogeneous targets (Mesh1D), arbitrary 2D composition through a triangular mesh (Mesh2D), homogeneous spherical geometry (Sphere) and homogeneous 3D triangular mesh geometry (TriMesh).
109+
* Infinite, homogeneous targets (Mesh0D), Layered, finite-depth inhomogeneous targets (Mesh1D), arbitrary 2D composition through a triangular mesh (Mesh2D), fast homogeneous 2D geometry (Homogeneous2D), homogeneous spherical geometry (Sphere), and homogeneous 3D triangular mesh geometry (TriMesh).
107110
* Amorphous Solid/Liquid targets, Gaseous targets, and targets with both solid/liquid and gaseous elements
108111
* Low energy (< 25 keV/nucleon) electronic stopping modes including:
109112
* local (Oen-Robinson),
110113
* nonlocal (Lindhard-Scharff),
111114
* and equipartition
112-
* Biersack-Varelas interpolation is also included for electronic stopping up to ~1 GeV/nucleon. Note that high energy physics beyond electronic stopping are not included.
113-
* Optionally, the Biersack-Haggmark treatment of high-energy free-flight paths between collisions can be included to greatly speed up high-energy simulations (i.e., by neglecting very small angle scattering).
115+
* Biersack-Varelas interpolation is also included for electronic stopping up to ~1 GeV/nucleon. Note that high energy physics beyond electronic stopping are not included, and that Biersack-Varelas may not be as accurate as other methods.
116+
* Biersack-Haggmark treatment of high-energy free-flight paths between collisions can be included to greatly speed up high-energy simulations (i.e., by neglecting very small angle scattering).
114117
* A wide range of interaction potentials are provided, including:
115118
* the Kr-C, ZBL, Lenz-Jensen, and Moliere universal, screened-Coulomb potentials.
116119
* the Lennard-Jones 12-6 and Morse attractive-repulsive potentials.
117120
* Solving the distance-of-closest-approach problem is achieved using:
118-
* the Newton-Raphson method for simple root-finding,
119-
* or, for attractive-repulsive potentials, an Adaptive Chebyshev Proxy Rootfinder with Automatic Subdivision algorithm and a Polynomial root-finding algorithm are provided through the [rcpr] crate.
121+
* the Newton-Raphson method for purely repulsive potentials,
122+
* or, for attractive-repulsive potentials, an Adaptive Chebyshev Proxy Rootfinder with Automatic Subdivision algorithm and a polynomial root-finding algorithm are provided through [rcpr].
120123
* Multiple interaction potentials can be used in a single simulation for any number of potentials/species.
121124
* For example, the He-W interaction can be specified using a Lennard-Jones 12-6 potential, while the W-W interaction can be defined using a Kr-C potential.
122125
* The scattering integral can be calculated using:
123126
* Gauss-Mehler quadrature,
124127
* Gauss-Legendre quadrature,
125128
* Mendenall-Weller quadrature,
126-
* or the MAGIC algorithm.
129+
* or the MAGIC algorithm (for certain screened Coulomb potentials only).
127130
* Input files use the [TOML] format, making them both human-readable and easily parsable.
128131
* RustBCA generates user-friendly, context-providing error messages, which help pinpoint the cause of errors and provide suggested fixes to the user.
129132
* The simulation results are comma-delimited (`csv` format) and include:
130133
* the energies and directions of emitted particles (reflected ions and sputtered atoms),
131134
* the final positions of implanted ions,
135+
* displacements,
132136
* full trajectory tracking for both the incident ions and target atoms,
133137
* and many other parameters such as position of origin of sputtered particles and energy loss along trajectories.
134138
* Optionally, the code can produce energy-angle and implantation distributions when built with the `--features distributions` flag and disable space-intensive particle list output with `--features no_list_output`.
@@ -140,11 +144,6 @@ Without optional features, `RustBCA` should compile with `cargo` alone on
140144
Windows, MacOS, and Linux systems.
141145

142146
[HDF5] for particle list input has been tested on Windows, but version 1.10.6 must be used.
143-
[rcpr], the adaptive Chebyshev Proxy Rootfinder with automatic subdivision and
144-
polynomial rootfinder package for [Rust], has not yet been successfully compiled
145-
on Windows.
146-
However, it can be compiled on the Windows Subsystem for Linux (WSL) and, likely,
147-
on Ubuntu for Windows or Cygwin.
148147

149148
#### Manual Dependences
150149

@@ -157,7 +156,7 @@ on Ubuntu for Windows or Cygwin.
157156
#### Optional Dependencies
158157

159158
* [HDF5] libraries
160-
* [rcpr], a CPR and polynomial rootfinder, required for using attractive-repulsive interaction potentials such as Lennard-Jones or Morse. It may require additional software (see below).
159+
* [rcpr], a CPR and polynomial rootfinder, required for using attractive-repulsive interaction potentials such as Lennard-Jones or Morse.
161160
* For manipulating input files and running associated scripts, the following are required:
162161
* [Python] 3.6+
163162
* The [Python] libraries: `numpy`, `matplotlib`, `toml` (must build from source), `shapely`, and `scipy`.
@@ -191,17 +190,17 @@ python3 setup.py install
191190
```bash
192191
sudo apt-get install gcc gfortran build-essential cmake liblapack-dev libblas-dev liblapacke-dev
193192
```
194-
8. Install `cargo`:
193+
8. (Optional - should come with rustup) Install `cargo`:
195194
```bash
196195
sudo apt-get install cargo
197196
```
198197
9. Build `RustBCA`:
199198
```bash
200199
git clone https://github.com/lcpp-org/rustBCA
201-
cd rustBCA
200+
cd RustBCA
202201
cargo build --release
203202
```
204-
10. (Optional) Build `rustBCA` with optional dependencies, `hdf5` and/or `rcpr` (with your choice of backend: `openblas`, `netlib`, or `intel-mkl`):
203+
10. (Optional) Build `RustBCA` with optional dependencies, `hdf5` and/or `rcpr` (with your choice of backend: `openblas`, `netlib`, or `intel-mkl`):
205204
```bash
206205
cargo build --release --features cpr_rootfinder_netlib,hdf5_input
207206
cargo build --release --features cpr_rootfinder_openblas,hdf5_input
@@ -221,7 +220,7 @@ cargo test --features cpr_rootfinder_intel_mkl
221220

222221
### Detailed instructions for Fedora 33
223222

224-
Most of the ingredients for building `rustBCA` and running the [Python] helper
223+
Most of the ingredients for building `RustBCA` and running the [Python] helper
225224
scripts are available natively in the Fedora software repository, so the setup
226225
is relatively painless.
227226

@@ -282,7 +281,7 @@ Additionally, `RustBCA` accepts an input file type (one of: `0D`, `1D`, `2D`, `T
282281

283282
For further details, have a look at
284283
[Usage](https://github.com/lcpp-org/RustBCA/wiki/Usage,-Input-File,-and-Output-Files)
285-
on the `rustBCA` [Wiki] for usage instructions.
284+
on the `RustBCA` [Wiki] for usage instructions.
286285
Also have a look at the examples on the [Wiki] for writing `.toml` input files.
287286

288287
[BCA]: https://en.wikipedia.org/wiki/Binary_collision_approximation

0 commit comments

Comments
 (0)