lcpp-org / RustBCA

A free, open-source Binary Collision Approximation (BCA) code for ion-material interactions including sputtering, implantation, and reflection
https://github.com/lcpp-org/RustBCA/wiki
GNU General Public License v3.0
41 stars 14 forks source link

First commit of geometry rewrite. Mesh and MeshElement traits have be… #89

Closed drobnyjt closed 3 years ago

drobnyjt commented 3 years ago

…en created. First steps towards geometry agnosticism.

Fixes #75 #77 #80

Description

This is a major rewrite of all the geometry routines. The plan is as follows;

  1. write traits Mesh and MeshElement that do not explicitly have a dimensionality.
  2. make Material use the generic Mesh and MeshElement traits to separate the kind of geometry from the Material declaration
  3. Add either feature flags or input options to change the geometry. The first version should have 0D (Tridyn/SRIM with homogeneous target), 1D layers, 2D triangles, and one 3D geometry, likely spherical
  4. Write documentation and instructions for adding new geometries or potentially FFIs to call geometry routines from, say, a C library

Tests

cargo test and layered_geometry.toml have been run on this first commit.

drobnyjt commented 3 years ago

This feature is now complete. Changes from last commit:

  1. Added new examples that use the 0D geometry
  2. Switched 0D geometry from a compile flag to a command-line argument (e.g., cargo run --release 0D examples/boron_nitride_0D.toml)
  3. abstracted out the entire physics loop from main() so that all main does is look at input arguments and then immediate go into a match to choose which geometry to run.