# pele-suite/pelec architecture

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

- Interactive diagram: https://gitdiagram.com/pele-suite/pelec
- Repository: https://github.com/pele-suite/pelec

## Overview

PeleC is an adaptive-mesh-refinement solver for compressible reacting flows. Users provide a case input and problem setup; the executable initializes an AMR run, advances the flow state, adapts the mesh, and writes plotfiles and checkpoints. The implementation spans problem-specific initialization and boundary conditions, hydro reconstruction and fluxes, reacting-flow physics, embedded boundaries, and diagnostics/output. The README documents these capabilities, while sampled source confirms the executable loop, level responsibilities, and selected numerical layers; links to unsampled subsystems are therefore limited or marked unverified.

Main entry points: [`Source/PeleC.cpp`](https://github.com/pele-suite/pelec/blob/development/Source/PeleC.cpp) (PeleC level), [`Source/main.cpp`](https://github.com/pele-suite/pelec/blob/development/Source/main.cpp) (Executable driver), [`Source/Godunov.cpp`](https://github.com/pele-suite/pelec/blob/development/Source/Godunov.cpp) (Hydro update), [`Source/PeleCAmr.cpp`](https://github.com/pele-suite/pelec/blob/development/Source/PeleCAmr.cpp) (AMR orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Run control"]
  node_main["Executable driver<br/>[main.cpp]"]
  node_amr["AMR orchestration<br/>[PeleCAmr.cpp]"]
  node_level["PeleC level<br/>[PeleC.cpp]"]
  node_problem["Problem setup<br/>[prob.H]"]
end

subgraph group_mesh["AMR and geometry"]
  node_tagging["Refinement tagging<br/>[Tagging.H]"]
  node_geometry["EB geometry<br/>[Geometry.H]"]
end

subgraph group_numerics["Flow numerics"]
  node_hydro["Hydro update<br/>[Godunov.cpp]"]
  node_reconstruction["State reconstruction<br/>[PLM.H]"]
  node_riemann["Riemann solver<br/>[Riemann.H]"]
  node_diffusion["Diffusion<br/>[Diffusion.cpp]"]
end

subgraph group_physics["Reacting physics"]
  node_chemistry["Chemistry and EOS<br/>[React.cpp]"]
  node_particles["Spray particles<br/>[Particle.cpp]"]
  node_soot["Soot model<br/>[Soot.cpp]"]
end

subgraph group_results["Diagnostics and output"]
  node_derive["Derived quantities<br/>[Derive.cpp]"]
  node_diagnostics["Diagnostics<br/>[PeleC.cpp]"]
  node_io["Plot and checkpoint IO<br/>[IO.cpp]"]
end

node_user(("Case user"))
node_input["Case inputs"]
node_plotfiles[("Plotfiles and checkpoints")]
node_amrex["AMReX and PelePhysics"]

node_user -->|"configures"| node_input
node_input -->|"provides inputs"| node_main
node_main -.->|"runs AMR"| node_amr
node_amr -.->|"advances levels"| node_level
node_level -.->|"uses problem hooks"| node_problem
node_level -->|"tags refinement"| node_tagging
node_level -.->|"uses geometry"| node_geometry
node_level -.->|"computes hydro"| node_hydro
node_hydro -->|"reconstructs states"| node_reconstruction
node_hydro -->|"solves interfaces"| node_riemann
node_level -.->|"computes diffusion"| node_diffusion
node_level -.->|"advances reactions"| node_chemistry
node_level -.->|"updates particles"| node_particles
node_level -.->|"updates soot"| node_soot
node_level -->|"registers derives"| node_derive
node_level -->|"builds diagnostics"| node_diagnostics
node_main -->|"writes results"| node_io
node_io -.->|"writes files"| node_plotfiles
node_level -->|"uses framework"| node_amrex
node_problem -->|"uses framework"| node_amrex

click node_main "https://github.com/pele-suite/pelec/blob/development/Source/main.cpp"
click node_amr "https://github.com/pele-suite/pelec/blob/development/Source/PeleCAmr.cpp"
click node_level "https://github.com/pele-suite/pelec/blob/development/Source/PeleC.cpp"
click node_problem "https://github.com/pele-suite/pelec/blob/development/Exec/Production/ChallengeProblem/prob.H"
click node_tagging "https://github.com/pele-suite/pelec/blob/development/Source/Tagging.H"
click node_geometry "https://github.com/pele-suite/pelec/blob/development/Source/Geometry.H"
click node_hydro "https://github.com/pele-suite/pelec/blob/development/Source/Godunov.cpp"
click node_reconstruction "https://github.com/pele-suite/pelec/blob/development/Source/PLM.H"
click node_riemann "https://github.com/pele-suite/pelec/blob/development/Source/Riemann.H"
click node_diffusion "https://github.com/pele-suite/pelec/blob/development/Source/Diffusion.cpp"
click node_derive "https://github.com/pele-suite/pelec/blob/development/Source/Derive.cpp"
click node_diagnostics "https://github.com/pele-suite/pelec/blob/development/Source/PeleC.cpp"
click node_io "https://github.com/pele-suite/pelec/blob/development/Source/IO.cpp"
click node_chemistry "https://github.com/pele-suite/pelec/blob/development/Source/React.cpp"
click node_particles "https://github.com/pele-suite/pelec/blob/development/Source/Particle.cpp"
click node_soot "https://github.com/pele-suite/pelec/blob/development/Source/Soot.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_main,node_amr,node_level,node_problem,node_user toneBlue
class node_tagging,node_geometry,node_plotfiles toneAmber
class node_hydro,node_reconstruction,node_riemann,node_diffusion toneMint
class node_chemistry,node_particles,node_soot toneRose
class node_derive,node_diagnostics,node_io,node_input,node_amrex toneIndigo
```

## Components

### Run control

- [Executable driver](https://github.com/pele-suite/pelec/blob/development/Source/main.cpp): `Source/main.cpp`
- [AMR orchestration](https://github.com/pele-suite/pelec/blob/development/Source/PeleCAmr.cpp): `Source/PeleCAmr.cpp`
- [PeleC level](https://github.com/pele-suite/pelec/blob/development/Source/PeleC.cpp): `Source/PeleC.cpp`
- [Problem setup](https://github.com/pele-suite/pelec/blob/development/Exec/Production/ChallengeProblem/prob.H): `Exec/Production/ChallengeProblem/prob.H`

### AMR and geometry

- [Refinement tagging](https://github.com/pele-suite/pelec/blob/development/Source/Tagging.H): `Source/Tagging.H`
- [EB geometry](https://github.com/pele-suite/pelec/blob/development/Source/Geometry.H): `Source/Geometry.H`

### Flow numerics

- [Hydro update](https://github.com/pele-suite/pelec/blob/development/Source/Godunov.cpp): `Source/Godunov.cpp`
- [State reconstruction](https://github.com/pele-suite/pelec/blob/development/Source/PLM.H): `Source/PLM.H`
- [Riemann solver](https://github.com/pele-suite/pelec/blob/development/Source/Riemann.H): `Source/Riemann.H`
- [Diffusion](https://github.com/pele-suite/pelec/blob/development/Source/Diffusion.cpp): `Source/Diffusion.cpp`

### Reacting physics

- [Chemistry and EOS](https://github.com/pele-suite/pelec/blob/development/Source/React.cpp): `Source/React.cpp`
- [Spray particles](https://github.com/pele-suite/pelec/blob/development/Source/Particle.cpp): `Source/Particle.cpp`
- [Soot model](https://github.com/pele-suite/pelec/blob/development/Source/Soot.cpp): `Source/Soot.cpp`

### Diagnostics and output

- [Derived quantities](https://github.com/pele-suite/pelec/blob/development/Source/Derive.cpp): `Source/Derive.cpp`
- [Diagnostics](https://github.com/pele-suite/pelec/blob/development/Source/PeleC.cpp): `Source/PeleC.cpp`
- [Plot and checkpoint IO](https://github.com/pele-suite/pelec/blob/development/Source/IO.cpp): `Source/IO.cpp`

### Other components

- **Case user**
- **Case inputs**
- **Plotfiles and checkpoints**
- **AMReX and PelePhysics**

## Connections

- Case user → Case inputs: configures
- Case inputs → Executable driver: provides inputs (evidence: `Source/main.cpp`)
- Executable driver → AMR orchestration: runs AMR
- AMR orchestration → PeleC level: advances levels
- PeleC level → Problem setup: uses problem hooks
- PeleC level → Refinement tagging: tags refinement (evidence: `Source/PeleC.cpp`)
- PeleC level → EB geometry: uses geometry
- PeleC level → Hydro update: computes hydro
- Hydro update → State reconstruction: reconstructs states (evidence: `Source/Godunov.cpp`)
- Hydro update → Riemann solver: solves interfaces
- PeleC level → Diffusion: computes diffusion
- PeleC level → Chemistry and EOS: advances reactions
- PeleC level → Spray particles: updates particles
- PeleC level → Soot model: updates soot
- PeleC level → Derived quantities: registers derives (evidence: `Source/PeleC.cpp`)
- PeleC level → Diagnostics: builds diagnostics (evidence: `Source/PeleC.cpp`)
- Executable driver → Plot and checkpoint IO: writes results (evidence: `Source/main.cpp`)
- Plot and checkpoint IO → Plotfiles and checkpoints: writes files
- PeleC level → AMReX and PelePhysics: uses framework
- Problem setup → AMReX and PelePhysics: uses framework (evidence: `Exec/Production/ChallengeProblem/prob.H`)
