How priyanshuiitghy2006/opentrim works
OpenTRIM is a Monte Carlo ion-transport and radiation-damage simulator, exposed as a command-line program, a GUI, and a C++ library. The central workflow configures and validates a run, creates a simulation driver, transports ions and recoil cascades through a material target, tallies results, and saves output. The README documents the CLI and GUI capabilities; source excerpts and the SOURCE INDEX support the driver/core relationships and identify the physics modules. Several GUI and persistence details are documented but their implementation was not sampled, so those links are limited to documented behavior.
Main entry points: mccore.cpp Monte Carlo core · main.cpp CLI application · gui GUI application · tabularview.cpp GUI results
Components 23
User interfaces
- CLI application
source/cli/main.cpp - GUI application
source/gui - GUI configuration
source/gui/simulationoptionsview.cpp - Target editor
source/gui/materialsdefview.cpp - GUI results
source/gui/tabularview.cpp
Run control
- Simulation config
source/include/mcdriver.h - JSON parsing
source/lib/parse_json.cpp - Simulation driver
source/lib/mcdriver.cpp
Transport physics
- Monte Carlo core
source/lib/mccore.cpp - Ion state
source/lib/ion.cpp - Ion beam
source/lib/ion_beam.cpp - Target materials
source/lib/target.cpp - Geometry
source/include/geometry.h - Scattering
source/include/scattering.h - Stopping and straggling
source/lib/dedx.cpp - Recoil cascades
source/lib/cascade.cpp - Flight paths
source/lib/flight_path.cpp
Results and storage
- Damage tallies
source/lib/tally.cpp - Custom tallies
source/lib/user_tally.cpp - Event stream
source/lib/event_stream.cpp - HDF5 archive
source/lib/h5serialize.cpp
Other components
- User
- HDF5 file
Connections 23
- User → CLI application: runs batch
README.md - User → GUI application: configures and runs
README.md - GUI application → GUI configuration: configures through
- GUI application → Target editor: edits target
source/gui/materialsdefview.cpp - GUI application → GUI results: evaluates results
README.md - CLI application → Simulation driver: executes
source/cli/main.cpp - CLI application → Simulation config: sets run options
source/cli/main.cpp - CLI application → HDF5 archive: saves results
README.md - Simulation config → JSON parsing: parses configuration
source/lib/parse_json.cpp - Simulation driver → Monte Carlo core: creates and runs
- Monte Carlo core → Scattering: uses scattering
source/lib/mccore.cpp - Monte Carlo core → Target materials: transports through
- Monte Carlo core → Stopping and straggling: calculates energy loss
- Monte Carlo core → Ion beam: generates ions from
- Monte Carlo core → Ion state: transports ions
- Monte Carlo core → Flight paths: calculates flight paths
- Monte Carlo core → Recoil cascades: processes recoils
source/lib/mccore.cpp - Monte Carlo core → Damage tallies: updates tallies
- Monte Carlo core → Custom tallies: supports tallies
- Monte Carlo core → Event stream: records events
- Target materials → Geometry: defines spatial layout
- HDF5 archive → HDF5 file: writes
README.md - GUI results → Damage tallies: displays tally data
source/gui/tabularview.cpp