# phyzan/odecraft architecture

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

- Interactive diagram: https://gitdiagram.com/phyzan/odecraft
- Repository: https://github.com/phyzan/odecraft

## Overview

OdeCraft is a templated C++20 ODE-solving library. The main workflow is to provide an ODE system and initial state, select an integration method, advance it through the ODE interface, and collect trajectory or event results. The architecture also includes event-aware rich solvers, dense and multidimensional interpolation, and variational solvers for dynamical-systems analysis. The graph uses README statements and indexed or excerpted source references; links to unsampled interpolation and result internals are limited to documented capabilities.

Main entry points: [`include/odecraft/Steppers/Steppers_impl.hpp`](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Steppers/Steppers_impl.hpp) (Stepper collection), [`include/odecraft/DenseOde/OdeInt_impl.hpp`](https://github.com/phyzan/odecraft/blob/main/include/odecraft/DenseOde/OdeInt_impl.hpp) (ODE interface), [`include/odecraft/Core/BaseSolver/BaseSolver_impl.hpp`](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Core/BaseSolver/BaseSolver_impl.hpp) (Solver base), [`include/odecraft/Core/SolverFactory.hpp`](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Core/SolverFactory.hpp) (Solver factory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Integration runtime"]
  node_ode_api["ODE interface<br/>[OdeInt_impl.hpp]"]
  node_solver_base["Solver base"]
  node_rich_solver["Rich solver<br/>[RichBase_impl.hpp]"]
  node_solver_factory["Solver factory<br/>[SolverFactory.hpp]"]
  node_events["Event detection<br/>[Events_impl.hpp]"]
  node_results["ODE results<br/>[OdeResult_impl.hpp]"]
end

subgraph group_methods["Solver methods"]
  node_steppers["Stepper collection<br/>[Steppers_impl.hpp]"]
  node_bdf["BDF method<br/>[BDF_impl.hpp]"]
  node_dopri["DOPRI methods<br/>[DOPRI_impl.hpp]"]
  node_dop853["DOP853 method<br/>[DOP853_impl.hpp]"]
  node_basic_methods["Basic methods<br/>[Euler_impl.hpp]"]
end

subgraph group_analysis["Analysis and interpolation"]
  node_variational["Variational solvers"]
  node_interpolation["Interpolation"]
  node_nd_interpolation["Multidimensional interpolation"]
  node_vector_fields["Interpolated vector fields"]
end

subgraph group_support["Runtime support"]
  node_toolkit["Numerical toolkit<br/>[Tools.hpp]"]
  node_cache["Scratch caching<br/>[Cache.hpp]"]
end

node_user(("ODE user"))
node_system["ODE system"]

node_user -->|"configures and integrates"| node_ode_api
node_user -->|"defines"| node_system
node_ode_api -->|"advances solver"| node_solver_base
node_ode_api -->|"detects events"| node_events
node_ode_api -->|"records trajectory"| node_results
node_solver_factory -->|"selects method"| node_steppers
node_solver_base -->|"uses numerical helpers"| node_toolkit
node_bdf -->|"uses scratch cache"| node_cache
node_cache -->|"uses cache helpers"| node_toolkit
node_rich_solver -->|"detects between steps"| node_events
node_steppers -.->|"includes method"| node_bdf
node_steppers -.->|"includes methods"| node_dopri
node_steppers -.->|"includes method"| node_dop853
node_steppers -.->|"includes methods"| node_basic_methods
node_variational -->|"uses solver factory"| node_solver_factory
node_user -->|"uses dense output"| node_interpolation
node_user -->|"uses interpolation"| node_nd_interpolation
node_user -->|"analyzes dynamics"| node_variational
node_vector_fields -.->|"uses interpolation"| node_nd_interpolation

click node_ode_api "https://github.com/phyzan/odecraft/blob/main/include/odecraft/DenseOde/OdeInt_impl.hpp"
click node_solver_base "https://github.com/phyzan/odecraft/blob/main/include/odecraft/Core/BaseSolver/BaseSolver_impl.hpp"
click node_rich_solver "https://github.com/phyzan/odecraft/blob/main/include/odecraft/Core/RichSolver/RichBase_impl.hpp"
click node_solver_factory "https://github.com/phyzan/odecraft/blob/main/include/odecraft/Core/SolverFactory.hpp"
click node_events "https://github.com/phyzan/odecraft/blob/main/include/odecraft/Events/Events_impl.hpp"
click node_results "https://github.com/phyzan/odecraft/blob/main/include/odecraft/OdeResult/OdeResult_impl.hpp"
click node_steppers "https://github.com/phyzan/odecraft/blob/main/include/odecraft/Steppers/Steppers_impl.hpp"
click node_bdf "https://github.com/phyzan/odecraft/blob/main/include/odecraft/Steppers/BDF_impl.hpp"
click node_dopri "https://github.com/phyzan/odecraft/blob/main/include/odecraft/Steppers/DOPRI_impl.hpp"
click node_dop853 "https://github.com/phyzan/odecraft/blob/main/include/odecraft/Steppers/DOP853_impl.hpp"
click node_basic_methods "https://github.com/phyzan/odecraft/blob/main/include/odecraft/Steppers/Euler_impl.hpp"
click node_variational "https://github.com/phyzan/odecraft/blob/main/include/odecraft/Chaos/VariationalSolvers_impl.hpp"
click node_interpolation "https://github.com/phyzan/odecraft/blob/main/include/odecraft/Interpolation/Univariate/StateInterp_impl.hpp"
click node_nd_interpolation "https://github.com/phyzan/odecraft/blob/main/include/odecraft/Interpolation/Regular/RegularGridInterpolator_impl.hpp"
click node_vector_fields "https://github.com/phyzan/odecraft/blob/main/include/odecraft/Interpolation/VectorFields_impl.hpp"
click node_toolkit "https://github.com/phyzan/odecraft/blob/main/include/odecraft/Toolkit/Tools.hpp"
click node_cache "https://github.com/phyzan/odecraft/blob/main/include/odecraft/Toolkit/Cache.hpp"

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_ode_api,node_solver_base,node_rich_solver,node_solver_factory,node_events,node_results,node_user toneBlue
class node_steppers,node_bdf,node_dopri,node_dop853,node_basic_methods toneAmber
class node_variational,node_interpolation,node_nd_interpolation,node_vector_fields toneMint
class node_toolkit,node_cache toneRose
class node_system toneIndigo
```

## Components

### Integration runtime

- [ODE interface](https://github.com/phyzan/odecraft/blob/main/include/odecraft/DenseOde/OdeInt_impl.hpp): `include/odecraft/DenseOde/OdeInt_impl.hpp`
- [Solver base](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Core/BaseSolver/BaseSolver_impl.hpp): `include/odecraft/Core/BaseSolver/BaseSolver_impl.hpp`
- [Rich solver](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Core/RichSolver/RichBase_impl.hpp): `include/odecraft/Core/RichSolver/RichBase_impl.hpp`
- [Solver factory](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Core/SolverFactory.hpp): `include/odecraft/Core/SolverFactory.hpp`
- [Event detection](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Events/Events_impl.hpp): `include/odecraft/Events/Events_impl.hpp`
- [ODE results](https://github.com/phyzan/odecraft/blob/main/include/odecraft/OdeResult/OdeResult_impl.hpp): `include/odecraft/OdeResult/OdeResult_impl.hpp`

### Solver methods

- [Stepper collection](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Steppers/Steppers_impl.hpp): `include/odecraft/Steppers/Steppers_impl.hpp`
- [BDF method](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Steppers/BDF_impl.hpp): `include/odecraft/Steppers/BDF_impl.hpp`
- [DOPRI methods](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Steppers/DOPRI_impl.hpp): `include/odecraft/Steppers/DOPRI_impl.hpp`
- [DOP853 method](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Steppers/DOP853_impl.hpp): `include/odecraft/Steppers/DOP853_impl.hpp`
- [Basic methods](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Steppers/Euler_impl.hpp): `include/odecraft/Steppers/Euler_impl.hpp`

### Analysis and interpolation

- [Variational solvers](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Chaos/VariationalSolvers_impl.hpp): `include/odecraft/Chaos/VariationalSolvers_impl.hpp`
- [Interpolation](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Interpolation/Univariate/StateInterp_impl.hpp): `include/odecraft/Interpolation/Univariate/StateInterp_impl.hpp`
- [Multidimensional interpolation](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Interpolation/Regular/RegularGridInterpolator_impl.hpp): `include/odecraft/Interpolation/Regular/RegularGridInterpolator_impl.hpp`
- [Interpolated vector fields](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Interpolation/VectorFields_impl.hpp): `include/odecraft/Interpolation/VectorFields_impl.hpp`

### Runtime support

- [Numerical toolkit](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Toolkit/Tools.hpp): `include/odecraft/Toolkit/Tools.hpp`
- [Scratch caching](https://github.com/phyzan/odecraft/blob/main/include/odecraft/Toolkit/Cache.hpp): `include/odecraft/Toolkit/Cache.hpp`

### Other components

- **ODE user**
- **ODE system**

## Connections

- ODE user → ODE interface: configures and integrates (evidence: `README.md`)
- ODE user → ODE system: defines (evidence: `README.md`)
- ODE interface → Solver base: advances solver (evidence: `include/odecraft/DenseOde/OdeInt_impl.hpp`)
- ODE interface → Event detection: detects events (evidence: `include/odecraft/DenseOde/OdeInt_impl.hpp`)
- ODE interface → ODE results: records trajectory (evidence: `README.md`)
- Solver factory → Stepper collection: selects method (evidence: `include/odecraft/Core/SolverFactory.hpp`)
- Solver base → Numerical toolkit: uses numerical helpers (evidence: `include/odecraft/Core/BaseSolver/BaseSolver_impl.hpp`)
- BDF method → Scratch caching: uses scratch cache (evidence: `include/odecraft/Steppers/BDF_impl.hpp`)
- Scratch caching → Numerical toolkit: uses cache helpers (evidence: `include/odecraft/Toolkit/Cache.hpp`)
- Rich solver → Event detection: detects between steps (evidence: `include/odecraft/Core/RichSolver/RichBase_impl.hpp`)
- Stepper collection → BDF method: includes method
- Stepper collection → DOPRI methods: includes methods
- Stepper collection → DOP853 method: includes method
- Stepper collection → Basic methods: includes methods
- Variational solvers → Solver factory: uses solver factory
- ODE user → Interpolation: uses dense output (evidence: `README.md`)
- ODE user → Multidimensional interpolation: uses interpolation (evidence: `README.md`)
- ODE user → Variational solvers: analyzes dynamics (evidence: `README.md`)
- Interpolated vector fields → Multidimensional interpolation: uses interpolation
