How rodyherrera/trybo works
Project type and purpose
• Trybo is a domain-specific simulation and analysis tool built around LAMMPS.
• It generates LAMMPS input scripts, runs simulations with GPU-accelerated LAMMPS, parses output data, performs multiple tribological analyses, and produces visualizations.
File structure
• Top‐level directories
• src/core: core engine (CLI entrypoint, configuration parser, simulation runner, helpers)
• src/templates: LAMMPS input templates grouped by analysis type
• src/analyzers: plugin analyzers (energy, debris, hotspots, CNA, PTM, etc.)
• src/visualizers: matching visualizers for each analyzer
• src/utilities: shared utilities
• toolchain: scripts to build custom LAMMPS executable
• examples, potentials: data inputs
• Patterns
• Plugin architecture: analyzers and visualizers implement common interfaces (analyzer.py, visualizer.py)
• Template‐based code generation for LAMMPS inputs
• CLI → configuration → runner → external simulation → post-processing
README insights
• Emphasizes need for custom GPU-enabled LAMMPS
• Lists 14 analysis modules (each maps to one analyzer + visualizer pair)
• Outputs: dump files, text logs (wear_data.txt, friction_data.txt, etc.), screenshots
Main components and interactions
a. Components
1. User/CLI (use_trybo.sh or python -m src.main)
2. Configuration Loader (yaml_config)
3. Template Engine (src/templates)
4. Simulation Runner (invokes custom LAMMPS executable)
5. LAMMPS Engine (external GPU build from toolchain)
6. Analyzer Plugins (src/analyzers/*_analyzer.py)
7. Visualizer Plugins (src/visualizers/*_visualizer.py)
8. Data Stores
– Input data: potentials/*.eam, examples/*.yml
– Simulation outputs: dump files, thermo logs
– Analysis outputs: txt, dump files
– Plots/screenshots
b. Relationships & data flow
– CLI → reads YAML config → Template Engine to generate LAMMPS input
– Simulation Runner → calls LAMMPS executable → LAMMPS reads templates & potentials → writes output dumps & logs
– Analyzer Plugins → ingest LAMMPS outputs → compute metrics → write analysis files
– Visualizer Plugins → read analysis files → generate plots/screenshots
c. Architectural patterns
– Plugin pattern for analyzers/visualizers
– Separation of concerns: core, templates, analysis, visualization
– Factory or registry for dynamically loading analyzers/visualizers
d. Key technologies
– Python 3 (pyproject.toml)
– LAMMPS with GPU & additional packages (built via build_lammps_gpu.sh)
– YAML config parsing
– File‐based I/O (dumps, text logs)