# yerkoescalona/gromos-rs architecture

> Architecture diagram of the GitHub repository yerkoescalona/gromos-rs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yerkoescalona/gromos-rs
- Repository: https://github.com/yerkoescalona/gromos-rs

## Overview

gromos-rs is an educational Rust reimplementation of GROMOS molecular-dynamics functionality, with Python bindings. The principal workflow loads topology and coordinates, describes a run as a shared recipe, builds and validates an algorithm plan, then executes simulation steps and exposes results. Separate Rust tools prepare systems, while analysis programs cover trajectory, structural, energetic, and other GROMOS++-style tasks. The README documents the shared run-builder flow; source excerpts show provider orchestration and forcefield internals, but not every runtime connection.

Main entry points: [`crates/gromos-run/src/build.rs`](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-run/src/build.rs) (Run builder), [`crates/gromos-forces/src/orchestrator.rs`](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-forces/src/orchestrator.rs) (Provider orchestrator), [`crates/pyo3-gromos/src/lib.rs`](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/pyo3-gromos/src/lib.rs) (Python bindings), [`crates/gromos-run/src/recipe.rs`](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-run/src/recipe.rs) (Run recipe)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and models"]
  node_topology["Topology model<br/>[topology.rs]"]
  node_configuration["Configuration<br/>[configuration.rs]"]
  node_topology_io["Topology files<br/>[topology.rs]"]
  node_recipe["Run recipe<br/>[recipe.rs]"]
  node_io["GROMOS I/O<br/>[trajectory.rs]"]
end

subgraph group_execution["Run execution"]
  node_run_builder["Run builder<br/>[build.rs]"]
  node_run_plan["Plan and validation<br/>[plan.rs]"]
  node_md["MD entry points<br/>[md.rs]"]
  node_integrator["Integrator algorithms<br/>[integrator.rs]"]
end

subgraph group_physics["Simulation physics"]
  node_forcefield["Forcefield step<br/>[forcefield.rs]"]
  node_pairlist["Neighbor lists<br/>[pairlist.rs]"]
  node_potential["Force providers<br/>[provider.rs]"]
  node_provider_orchestrator["Provider orchestrator<br/>[orchestrator.rs]"]
  node_provider_algorithm["Provider algorithm"]
  node_classical_nonbonded["Classical nonbonded<br/>[interaction.rs]"]
  node_qm_embedding["QM electrostatic embedding<br/>[embedding.rs]"]
end

subgraph group_interfaces["User interfaces"]
  node_python_binding["Python bindings<br/>[lib.rs]"]
  node_python_recipe["Python recipe API<br/>[recipe.rs]"]
  node_python_simulation["Python simulation API<br/>[simulation.rs]"]
  node_python_package["Python package<br/>[__init__.py]"]
end

subgraph group_utilities["Tools and analysis"]
  node_tools["System preparation tools<br/>[build_box.rs]"]
  node_analysis["Analysis programs"]
end

node_user(("User"))

node_user -->|"provides files"| node_topology_io
node_topology_io -->|"parses topology"| node_topology
node_user -->|"defines run"| node_recipe
node_python_recipe -->|"creates recipe"| node_recipe
node_recipe -->|"prepares system"| node_run_builder
node_run_builder -->|"builds and validates"| node_run_plan
node_run_builder -->|"instantiates"| node_integrator
node_md -->|"uses shared builder"| node_run_builder
node_python_simulation -->|"uses shared builder"| node_run_builder
node_integrator -.->|"runs algorithms"| node_forcefield
node_forcefield -->|"updates neighbors"| node_pairlist
node_provider_algorithm -->|"evaluates"| node_provider_orchestrator
node_provider_orchestrator -->|"sums contributions"| node_potential
node_provider_orchestrator -->|"registers provider"| node_classical_nonbonded
node_potential -->|"implemented as"| node_qm_embedding
node_user -->|"uses API"| node_python_package
node_python_package -->|"wraps extension"| node_python_binding
node_python_binding -->|"registers API"| node_python_recipe
node_python_binding -->|"registers API"| node_python_simulation
node_user -.->|"prepares systems"| node_tools
node_user -.->|"analyzes results"| node_analysis
node_md -.->|"writes outputs"| node_io
node_analysis -.->|"reads simulation data"| node_io

click node_topology "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-core/src/topology.rs"
click node_configuration "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-core/src/configuration.rs"
click node_topology_io "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-io/src/topology.rs"
click node_recipe "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-run/src/recipe.rs"
click node_run_builder "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-run/src/build.rs"
click node_run_plan "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-run/src/plan.rs"
click node_md "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-md/src/bin/md.rs"
click node_integrator "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-integrators/src/integrator.rs"
click node_forcefield "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-integrators/src/algorithms/forcefield.rs"
click node_pairlist "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-core/src/pairlist.rs"
click node_potential "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-forces/src/provider.rs"
click node_provider_orchestrator "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-forces/src/orchestrator.rs"
click node_provider_algorithm "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-forces/src/orchestrator_algorithm.rs"
click node_classical_nonbonded "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-forces/src/nonbonded/interaction.rs"
click node_qm_embedding "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-forces/src/nonbonded/embedding.rs"
click node_io "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-io/src/trajectory.rs"
click node_python_binding "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/pyo3-gromos/src/lib.rs"
click node_python_recipe "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/pyo3-gromos/src/recipe.rs"
click node_python_simulation "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/pyo3-gromos/src/simulation.rs"
click node_python_package "https://github.com/yerkoescalona/gromos-rs/blob/main/py-gromos/python/gromos/__init__.py"
click node_tools "https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-tools/src/bin/box/build_box.rs"
click node_analysis "https://github.com/yerkoescalona/gromos-rs/tree/main/crates/gromos-analysis/src/bin"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_topology,node_configuration,node_topology_io,node_recipe,node_io,node_user toneBlue
class node_run_builder,node_run_plan,node_md,node_integrator toneAmber
class node_forcefield,node_pairlist,node_potential,node_provider_orchestrator,node_provider_algorithm,node_classical_nonbonded,node_qm_embedding toneMint
class node_python_binding,node_python_recipe,node_python_simulation,node_python_package toneRose
class node_tools,node_analysis toneIndigo
```

## Components

### Inputs and models

- [Topology model](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-core/src/topology.rs): `crates/gromos-core/src/topology.rs`
- [Configuration](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-core/src/configuration.rs): `crates/gromos-core/src/configuration.rs`
- [Topology files](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-io/src/topology.rs): `crates/gromos-io/src/topology.rs`
- [Run recipe](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-run/src/recipe.rs): `crates/gromos-run/src/recipe.rs`
- [GROMOS I/O](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-io/src/trajectory.rs): `crates/gromos-io/src/trajectory.rs`

### Run execution

- [Run builder](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-run/src/build.rs): `crates/gromos-run/src/build.rs`
- [Plan and validation](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-run/src/plan.rs): `crates/gromos-run/src/plan.rs`
- [MD entry points](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-md/src/bin/md.rs): `crates/gromos-md/src/bin/md.rs`
- [Integrator algorithms](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-integrators/src/integrator.rs): `crates/gromos-integrators/src/integrator.rs`

### Simulation physics

- [Forcefield step](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-integrators/src/algorithms/forcefield.rs): `crates/gromos-integrators/src/algorithms/forcefield.rs`
- [Neighbor lists](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-core/src/pairlist.rs): `crates/gromos-core/src/pairlist.rs`
- [Force providers](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-forces/src/provider.rs): `crates/gromos-forces/src/provider.rs`
- [Provider orchestrator](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-forces/src/orchestrator.rs): `crates/gromos-forces/src/orchestrator.rs`
- [Provider algorithm](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-forces/src/orchestrator_algorithm.rs): `crates/gromos-forces/src/orchestrator_algorithm.rs`
- [Classical nonbonded](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-forces/src/nonbonded/interaction.rs): `crates/gromos-forces/src/nonbonded/interaction.rs`
- [QM electrostatic embedding](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-forces/src/nonbonded/embedding.rs): `crates/gromos-forces/src/nonbonded/embedding.rs`

### User interfaces

- [Python bindings](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/pyo3-gromos/src/lib.rs): `crates/pyo3-gromos/src/lib.rs`
- [Python recipe API](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/pyo3-gromos/src/recipe.rs): `crates/pyo3-gromos/src/recipe.rs`
- [Python simulation API](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/pyo3-gromos/src/simulation.rs): `crates/pyo3-gromos/src/simulation.rs`
- [Python package](https://github.com/yerkoescalona/gromos-rs/blob/main/py-gromos/python/gromos/__init__.py): `py-gromos/python/gromos/__init__.py`

### Tools and analysis

- [System preparation tools](https://github.com/yerkoescalona/gromos-rs/blob/main/crates/gromos-tools/src/bin/box/build_box.rs): `crates/gromos-tools/src/bin/box/build_box.rs`
- [Analysis programs](https://github.com/yerkoescalona/gromos-rs/tree/main/crates/gromos-analysis/src/bin): `crates/gromos-analysis/src/bin`

### Other components

- **User**

## Connections

- User → Topology files: provides files (evidence: `README.md`)
- Topology files → Topology model: parses topology (evidence: `crates/gromos-io/src/topology.rs`)
- User → Run recipe: defines run (evidence: `README.md`)
- Python recipe API → Run recipe: creates recipe (evidence: `crates/pyo3-gromos/src/recipe.rs`)
- Run recipe → Run builder: prepares system (evidence: `README.md`)
- Run builder → Plan and validation: builds and validates (evidence: `README.md`)
- Run builder → Integrator algorithms: instantiates (evidence: `README.md`)
- MD entry points → Run builder: uses shared builder (evidence: `README.md`)
- Python simulation API → Run builder: uses shared builder (evidence: `README.md`)
- Integrator algorithms → Forcefield step: runs algorithms
- Forcefield step → Neighbor lists: updates neighbors (evidence: `crates/gromos-integrators/src/algorithms/forcefield.rs`)
- Provider algorithm → Provider orchestrator: evaluates (evidence: `crates/gromos-forces/src/orchestrator_algorithm.rs`)
- Provider orchestrator → Force providers: sums contributions (evidence: `crates/gromos-forces/src/orchestrator.rs`)
- Provider orchestrator → Classical nonbonded: registers provider (evidence: `crates/gromos-forces/src/orchestrator.rs`)
- Force providers → QM electrostatic embedding: implemented as (evidence: `crates/gromos-forces/src/nonbonded/embedding.rs`)
- User → Python package: uses API (evidence: `README.md`)
- Python package → Python bindings: wraps extension (evidence: `crates/pyo3-gromos/src/lib.rs`)
- Python bindings → Python recipe API: registers API (evidence: `crates/pyo3-gromos/src/lib.rs`)
- Python bindings → Python simulation API: registers API (evidence: `crates/pyo3-gromos/src/lib.rs`)
- User → System preparation tools: prepares systems
- User → Analysis programs: analyzes results
- MD entry points → GROMOS I/O: writes outputs
- Analysis programs → GROMOS I/O: reads simulation data
