Skip to content

Add development features to main branch and increment version number #237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 68 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
5a4f6bb
Add assertions to prevent angles of incidence >90 in reflection_coeff…
May 19, 2023
752690a
Updated RustBCA.h and RustBCA.c with new rotation functions. Cleaned …
drobnyjt May 22, 2023
0b38174
Add rotate functions to Fortran wrapper.
drobnyjt May 22, 2023
4540407
Add tests of python rotation functions to test_rustbca.py
drobnyjt May 22, 2023
2f40d26
Add assertions to rotate function.
drobnyjt May 22, 2023
e2578cb
Fix assertions.
drobnyjt May 22, 2023
1fa053c
Update rustbca_compile_check.yml
drobnyjt May 22, 2023
9c6a2b4
First draft of displacement damage; for now, it just adds Ed input fu…
drobnyjt May 23, 2023
2834366
Add example using displacement damage.
drobnyjt May 23, 2023
d154c3a
Fixes to python interface involving Ed.
drobnyjt May 23, 2023
a374f48
Fixes to python interface involving Ed.
drobnyjt May 23, 2023
96724f5
Added homogeneous 2D mesh; added tests of 1D and homogeneous 2D geome…
drobnyjt May 24, 2023
81556e6
Added example and tests of homogeneous 2D mesh to workflow
drobnyjt May 24, 2023
dfe7096
Update rustbca_compile_check.yml
drobnyjt May 24, 2023
02321e1
Update rustbca_compile_check.yml
drobnyjt May 24, 2023
35e8b7f
Update rustbca_compile_check.yml
drobnyjt May 24, 2023
b5739c5
Update rustbca_compile_check.yml
drobnyjt May 24, 2023
50015f2
Add intersection check.
drobnyjt May 24, 2023
42f2651
Merge branch 'add_homogeneous_2d_mesh' of https://github.com/lcpp-org…
drobnyjt May 24, 2023
b3efe98
Forgot to add updated 5 keV version of BN wire example.
drobnyjt May 24, 2023
4d26e3d
Merge pull request #211 from lcpp-org/add_homogeneous_2d_mesh
drobnyjt May 24, 2023
8ead6c2
Pure rust version of rcpr.
drobnyjt Jun 6, 2023
655b61f
Fix to tests and use statements.
drobnyjt Jun 6, 2023
33d8f03
Updates for pure rust rcpr.
drobnyjt Jun 6, 2023
de96d61
Fix to typo in tests.
drobnyjt Jun 6, 2023
e428bbe
Fix to tests.
drobnyjt Jun 6, 2023
f3421d1
Working version with Morse potential.
drobnyjt Jun 6, 2023
32c4cf1
Fixes to workflow.
drobnyjt Jun 6, 2023
432a5f8
Updates to Cargo.toml
drobnyjt Jun 6, 2023
e693d2b
Updates to Cargo.toml
drobnyjt Jun 6, 2023
8d6f7cb
Updates to Cargo.toml
drobnyjt Jun 6, 2023
b9942b2
Revert breaking update to hdf5
drobnyjt Jun 6, 2023
fe66206
Updates to Morse example.
drobnyjt Jun 6, 2023
5d6902e
Merge pull request #214 from lcpp-org/pure_rust_rcpr
drobnyjt Jun 6, 2023
15d153a
Update Cargo.toml to remove branch specificity for rcpr
drobnyjt Jun 6, 2023
63a032b
Update setup.py version number
drobnyjt Jun 7, 2023
3ec4174
Updated function names in particle.rs for clarity.
Jun 30, 2023
ba1c9cf
Rearranged weak collision loop - separated electronic and nuclear ene…
Jun 30, 2023
699481b
Merge pull request #219 from lcpp-org/weak_collision_loop_3
drobnyjt Jul 3, 2023
70007c3
Merge branch 'dev' into merge_main_into_dev
drobnyjt Jul 3, 2023
c3be62a
Merge pull request #220 from lcpp-org/merge_main_into_dev
drobnyjt Jul 3, 2023
b6821a9
Fix version numbers after main merge into dev.
Jul 3, 2023
46ec785
In progress work on 4-8 potential for hydrogen interactions with tran…
Aug 3, 2023
7741b8d
Initial version including 4-8 potential.
Aug 4, 2023
f94681a
Added chromium.
Aug 8, 2023
a0e49dd
Working 4-8 potential version.
Aug 8, 2023
54acecd
Added carbon to materials.py.
Aug 9, 2023
9c2a3b0
Update README.md
drobnyjt Oct 3, 2023
db84526
Test memory management - leak introduced by RustBCA.
drobnyjt Nov 17, 2023
8cbb9b5
Memory leak fixed.
drobnyjt Nov 17, 2023
d768581
Removed erroneous declaration in RustBCA.c
drobnyjt Nov 17, 2023
0b5ff72
Merge pull request #227 from lcpp-org/memory_management
drobnyjt Nov 17, 2023
7267384
Added check to make sure length of output structs is not zero when dr…
drobnyjt Nov 22, 2023
faa0343
Fixed memory leak in Fortran coupling by correctly deallocating varia…
drobnyjt Dec 11, 2023
901d687
Fixed memory leak in Fortran coupling by correctly deallocating varia…
drobnyjt Dec 11, 2023
48d4c45
Fixed memory leak in Fortran coupling by correctly deallocating varia…
drobnyjt Dec 11, 2023
5880420
Added single ion reflection function to Python bindings.
drobnyjt Dec 12, 2023
e96a09d
Add compound_reflection_coefficient to Python bindings.
drobnyjt Dec 13, 2023
7574e03
Update example to use compound reflection coefficient in Python bindi…
drobnyjt Dec 13, 2023
7efecb5
Added single ion reflection function to test_rustbca.py.
drobnyjt Dec 13, 2023
4422ceb
Fixes #228.
drobnyjt Dec 13, 2023
2361e97
Change test to use secant rootfinder.
Jan 15, 2024
06aa267
Merge pull request #233 from lcpp-org/4_8_potential
drobnyjt Jan 15, 2024
2c21fd5
Fixes to polynomial coefficients in LJ rootfinders.
Jan 15, 2024
87179f7
Fix polynomial rootfinder test.
Jan 15, 2024
d4393f8
Update README.md
drobnyjt Jan 16, 2024
16f95dd
Increment version number in Cargo.toml
drobnyjt Feb 13, 2024
98c657a
Increment version number in setup.py
drobnyjt Feb 13, 2024
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
10 changes: 6 additions & 4 deletions .github/workflows/rustbca_compile_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
sudo apt-get install curl
- name: Install rust
run: |
curl --proto '=https' --tlsv1.2 -sSf -y https://sh.rustup.rs | sh
curl --proto '=https' --tlsv1.2 -sSf -y https://sh.rustup.rs | sh
sudo apt-get install rustc cargo
- name: Install pip for Python-3
run: |
Expand All @@ -48,7 +48,7 @@ jobs:
python3 examples/test_rustbca.py
- name: Test Fortran and C bindings
run : |
cargo build --release
cargo build --release --lib --features parry3d
cp examples/test_rustbca.f90 .
gfortran -c rustbca.f90 target/release/liblibRustBCA.so
gfortran test_rustbca.f90 rustbca.f90 target/release/liblibRustBCA.so
Expand All @@ -58,7 +58,7 @@ jobs:
./a.out
- name: Test RustBCA
run: |
cargo test --features cpr_rootfinder_netlib,hdf5_input,distributions,parry3d
cargo test --features cpr_rootfinder,hdf5_input,distributions,parry3d
- name: Run Examples
run: |
cargo run --release 0D examples/boron_nitride_0D.toml
Expand All @@ -70,4 +70,6 @@ jobs:
./target/release/RustBCA SPHERE examples/boron_nitride_sphere.toml
cargo run --release --features parry3d TRIMESH examples/tungsten_twist_trimesh.toml
./target/release/RustBCA examples/boron_nitride_wire.toml

cat boron_nitride_summary.output
./target/release/RustBCA HOMOGENEOUS2D examples/boron_nitride_wire_homogeneous.toml
cat boron_nitride_h_summary.output
30 changes: 12 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "RustBCA"
version = "2.0.1"
version = "2.8.4"
default-run = "RustBCA"
authors = ["Jon Drobny <drobny2@illinois.edu>", "Jon Drobny <jdrobny@tae.com>"]
edition = "2018"
edition = "2021"

[[bin]]
name = "RustBCA"
Expand All @@ -15,26 +15,22 @@ path = "src/lib.rs"
crate-type = ["cdylib", "lib"]

[dependencies]
rand = "0.8.3"
rand_distr = "0.4.2"
toml = "0.5.8"
anyhow = "1.0.38"
itertools = "0.10.0"
rayon = "1.5.0"
geo = {version = "0.17.1", optional = false}
rand = "0.8.5"
rand_distr = "0.4.3"
toml = "0.7.4"
anyhow = "1.0.71"
itertools = "0.10.5"
rayon = "1.7.0"
geo = {version = "0.25", optional = false}
indicatif = {version = "0.15.0", features=["rayon"]}
serde = { version = "1.0.123", features = ["derive"] }
serde = { version = "1.0.163", features = ["derive"] }
hdf5 = {version = "0.7.1", optional = true}
openblas-src = {version = "0.9", optional = true}
netlib-src = {version = "0.8", optional = true}
intel-mkl-src = {version = "0.6.0", optional = true}
rcpr = { git = "https://github.com/drobnyjt/rcpr", optional = true}
ndarray = {version = "0.14.0", features = ["serde"], optional = true}
parry3d-f64 = {optional = true, version="0.2.0"}
egui = {version = "0.15.0", optional = true}

[dependencies.pyo3]
version = "0.13.2"
version = "0.19.0"
features = ["extension-module"]
optional = true

Expand All @@ -49,9 +45,7 @@ debug = false

[features]
hdf5_input = ["hdf5"]
cpr_rootfinder_openblas = ["rcpr", "openblas-src"]
cpr_rootfinder_netlib = ["rcpr", "netlib-src"]
cpr_rootfinder_intel_mkl = ["rcpr", "intel-mkl-src"]
cpr_rootfinder = ["rcpr"]
distributions = ["ndarray"]
no_list_output = []
parry3d = ["parry3d-f64"]
Expand Down
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
`RustBCA` is a general-purpose, high-performance code for simulating
ion-material interactions including sputtering, reflection, and implantation
using the binary collision approximation ([BCA]), written in [Rust]!
RustBCA consists of a standalone code and libraries for including
RustBCA includes a standalone version and libraries for including
ion-material interactions in simulations written in C/C++, Python,
and Fortran.

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

Check out the `RustBCA` [Wiki] for detailed information, installation
instructions, use cases, examples, and more. See the RustBCA paper at the
Expand All @@ -27,6 +29,7 @@ Selected citations of RustBCA as of 5/24/23:
* [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)
* [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)
* [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)
* [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)

## Getting started

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

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

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

* Ion-material interactions for all combinations of incident ion and target species.
* 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).
* 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).
* Amorphous Solid/Liquid targets, Gaseous targets, and targets with both solid/liquid and gaseous elements
* Low energy (< 25 keV/nucleon) electronic stopping modes including:
* local (Oen-Robinson),
* nonlocal (Lindhard-Scharff),
* and equipartition
* 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.
* 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).
* 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.
* 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).
* A wide range of interaction potentials are provided, including:
* the Kr-C, ZBL, Lenz-Jensen, and Moliere universal, screened-Coulomb potentials.
* the Lennard-Jones 12-6 and Morse attractive-repulsive potentials.
* Solving the distance-of-closest-approach problem is achieved using:
* the Newton-Raphson method for simple root-finding,
* 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.
* the Newton-Raphson method for purely repulsive potentials,
* or, for attractive-repulsive potentials, an Adaptive Chebyshev Proxy Rootfinder with Automatic Subdivision algorithm and a polynomial root-finding algorithm are provided through [rcpr].
* Multiple interaction potentials can be used in a single simulation for any number of potentials/species.
* 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.
* The scattering integral can be calculated using:
* Gauss-Mehler quadrature,
* Gauss-Legendre quadrature,
* Mendenall-Weller quadrature,
* or the MAGIC algorithm.
* or the MAGIC algorithm (for certain screened Coulomb potentials only).
* Input files use the [TOML] format, making them both human-readable and easily parsable.
* RustBCA generates user-friendly, context-providing error messages, which help pinpoint the cause of errors and provide suggested fixes to the user.
* The simulation results are comma-delimited (`csv` format) and include:
* the energies and directions of emitted particles (reflected ions and sputtered atoms),
* the final positions of implanted ions,
* displacements,
* full trajectory tracking for both the incident ions and target atoms,
* and many other parameters such as position of origin of sputtered particles and energy loss along trajectories.
* 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`.
Expand All @@ -140,11 +144,6 @@ Without optional features, `RustBCA` should compile with `cargo` alone on
Windows, MacOS, and Linux systems.

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

#### Manual Dependences

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

* [HDF5] libraries
* [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).
* [rcpr], a CPR and polynomial rootfinder, required for using attractive-repulsive interaction potentials such as Lennard-Jones or Morse.
* For manipulating input files and running associated scripts, the following are required:
* [Python] 3.6+
* The [Python] libraries: `numpy`, `matplotlib`, `toml` (must build from source), `shapely`, and `scipy`.
Expand Down Expand Up @@ -191,17 +190,17 @@ python3 setup.py install
```bash
sudo apt-get install gcc gfortran build-essential cmake liblapack-dev libblas-dev liblapacke-dev
```
8. Install `cargo`:
8. (Optional - should come with rustup) Install `cargo`:
```bash
sudo apt-get install cargo
```
9. Build `RustBCA`:
```bash
git clone https://github.com/lcpp-org/rustBCA
cd rustBCA
cd RustBCA
cargo build --release
```
10. (Optional) Build `rustBCA` with optional dependencies, `hdf5` and/or `rcpr` (with your choice of backend: `openblas`, `netlib`, or `intel-mkl`):
10. (Optional) Build `RustBCA` with optional dependencies, `hdf5` and/or `rcpr` (with your choice of backend: `openblas`, `netlib`, or `intel-mkl`):
```bash
cargo build --release --features cpr_rootfinder_netlib,hdf5_input
cargo build --release --features cpr_rootfinder_openblas,hdf5_input
Expand All @@ -221,7 +220,7 @@ cargo test --features cpr_rootfinder_intel_mkl

### Detailed instructions for Fedora 33

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

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

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

[BCA]: https://en.wikipedia.org/wiki/Binary_collision_approximation
Expand Down
Loading