# lenhanpham/openthermo architecture

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

- Interactive diagram: https://gitdiagram.com/lenhanpham/openthermo
- Repository: https://github.com/lenhanpham/openthermo

## Overview

OpenThermo is a C++ command-line tool that turns quantum-chemistry outputs or native .otm files into molecular thermochemistry results. The main workflow configures options and masses, loads molecular data, analyzes inertia and symmetry, then computes and presents thermodynamic properties; batch ensembles and temperature/pressure scans are documented capabilities. The graph reflects the README and supplied excerpts; details of unsampled orchestration and output routines are represented only where the available evidence supports them.

Main entry points: [`src/calc.cpp`](https://github.com/lenhanpham/openthermo/blob/main/src/calc.cpp) (Calculation workflow), [`src/main.cpp`](https://github.com/lenhanpham/openthermo/blob/main/src/main.cpp) (Workflow entry), [`src/loadfile.cpp`](https://github.com/lenhanpham/openthermo/blob/main/src/loadfile.cpp) (Format loaders), [`src/chemsys.h`](https://github.com/lenhanpham/openthermo/blob/main/src/chemsys.h) (Molecular data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Command interface"]
  node_program["Workflow entry<br/>[main.cpp]"]
  node_options["Options and settings<br/>[util.cpp]"]
  node_presentation["Results output<br/>[main.cpp]"]
end

subgraph group_inputs["Molecular inputs"]
  node_loader["Format loaders<br/>[loadfile.cpp]"]
  node_systemdata["Molecular data<br/>[chemsys.h]"]
  node_massdata["Isotope masses<br/>[atommass.cpp]"]
  node_massadjust["Mass adjustments<br/>[util.cpp]"]
end

subgraph group_analysis["Molecular analysis"]
  node_analysisflow["Calculation workflow<br/>[calc.cpp]"]
  node_inertia["Inertia analysis<br/>[calc.cpp]"]
  node_symmetry["Point-group analysis<br/>[symmetry.cpp]"]
end

subgraph group_thermo["Thermochemistry"]
  node_thermocalc["Thermo calculations<br/>[calc.cpp]"]
  node_ensemble["Ensemble averaging<br/>[calc.cpp]"]
  node_results["Thermo results<br/>[calc.h]"]
end

node_user(("CLI user"))
node_inputfiles["QC output files"]
node_resultfiles["Text and OTM output"]

node_user -->|"invokes"| node_program
node_program -->|"loads options"| node_options
node_program -->|"initializes masses"| node_massdata
node_program -->|"starts calculations"| node_analysisflow
node_inputfiles -->|"provides input"| node_loader
node_analysisflow -->|"dispatches loading"| node_loader
node_loader -->|"populates"| node_systemdata
node_massdata -->|"supplies masses"| node_systemdata
node_options -->|"configures"| node_massadjust
node_massadjust -->|"adjusts masses"| node_systemdata
node_analysisflow -->|"calculates"| node_inertia
node_analysisflow -->|"detects symmetry"| node_symmetry
node_analysisflow -->|"computes properties"| node_thermocalc
node_thermocalc -->|"returns"| node_results
node_analysisflow -->|"averages ensembles"| node_ensemble
node_ensemble -->|"evaluates members"| node_thermocalc
node_program -->|"reports results"| node_presentation
node_presentation -->|"presents"| node_results
node_presentation -->|"writes formats"| node_resultfiles

click node_program "https://github.com/lenhanpham/openthermo/blob/main/src/main.cpp"
click node_options "https://github.com/lenhanpham/openthermo/blob/main/src/util.cpp"
click node_loader "https://github.com/lenhanpham/openthermo/blob/main/src/loadfile.cpp"
click node_systemdata "https://github.com/lenhanpham/openthermo/blob/main/src/chemsys.h"
click node_massdata "https://github.com/lenhanpham/openthermo/blob/main/src/atommass.cpp"
click node_massadjust "https://github.com/lenhanpham/openthermo/blob/main/src/util.cpp"
click node_analysisflow "https://github.com/lenhanpham/openthermo/blob/main/src/calc.cpp"
click node_inertia "https://github.com/lenhanpham/openthermo/blob/main/src/calc.cpp"
click node_symmetry "https://github.com/lenhanpham/openthermo/blob/main/src/symmetry.cpp"
click node_thermocalc "https://github.com/lenhanpham/openthermo/blob/main/src/calc.cpp"
click node_ensemble "https://github.com/lenhanpham/openthermo/blob/main/src/calc.cpp"
click node_results "https://github.com/lenhanpham/openthermo/blob/main/src/calc.h"
click node_presentation "https://github.com/lenhanpham/openthermo/blob/main/src/main.cpp"

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_program,node_options,node_presentation,node_user toneBlue
class node_loader,node_systemdata,node_massdata,node_massadjust toneAmber
class node_analysisflow,node_inertia,node_symmetry toneMint
class node_thermocalc,node_ensemble,node_results toneRose
class node_inputfiles,node_resultfiles toneIndigo
```

## Components

### Command interface

- [Workflow entry](https://github.com/lenhanpham/openthermo/blob/main/src/main.cpp): `src/main.cpp`
- [Options and settings](https://github.com/lenhanpham/openthermo/blob/main/src/util.cpp): `src/util.cpp`
- [Results output](https://github.com/lenhanpham/openthermo/blob/main/src/main.cpp): `src/main.cpp`

### Molecular inputs

- [Format loaders](https://github.com/lenhanpham/openthermo/blob/main/src/loadfile.cpp): `src/loadfile.cpp`
- [Molecular data](https://github.com/lenhanpham/openthermo/blob/main/src/chemsys.h): `src/chemsys.h`
- [Isotope masses](https://github.com/lenhanpham/openthermo/blob/main/src/atommass.cpp): `src/atommass.cpp`
- [Mass adjustments](https://github.com/lenhanpham/openthermo/blob/main/src/util.cpp): `src/util.cpp`

### Molecular analysis

- [Calculation workflow](https://github.com/lenhanpham/openthermo/blob/main/src/calc.cpp): `src/calc.cpp`
- [Inertia analysis](https://github.com/lenhanpham/openthermo/blob/main/src/calc.cpp): `src/calc.cpp`
- [Point-group analysis](https://github.com/lenhanpham/openthermo/blob/main/src/symmetry.cpp): `src/symmetry.cpp`

### Thermochemistry

- [Thermo calculations](https://github.com/lenhanpham/openthermo/blob/main/src/calc.cpp): `src/calc.cpp`
- [Ensemble averaging](https://github.com/lenhanpham/openthermo/blob/main/src/calc.cpp): `src/calc.cpp`
- [Thermo results](https://github.com/lenhanpham/openthermo/blob/main/src/calc.h): `src/calc.h`

### Other components

- **CLI user**
- **QC output files**
- **Text and OTM output**

## Connections

- CLI user → Workflow entry: invokes
- Workflow entry → Options and settings: loads options
- Workflow entry → Isotope masses: initializes masses
- Workflow entry → Calculation workflow: starts calculations
- QC output files → Format loaders: provides input
- Calculation workflow → Format loaders: dispatches loading
- Format loaders → Molecular data: populates
- Isotope masses → Molecular data: supplies masses
- Options and settings → Mass adjustments: configures
- Mass adjustments → Molecular data: adjusts masses
- Calculation workflow → Inertia analysis: calculates
- Calculation workflow → Point-group analysis: detects symmetry
- Calculation workflow → Thermo calculations: computes properties
- Thermo calculations → Thermo results: returns
- Calculation workflow → Ensemble averaging: averages ensembles
- Ensemble averaging → Thermo calculations: evaluates members
- Workflow entry → Results output: reports results
- Results output → Thermo results: presents
- Results output → Text and OTM output: writes formats
