# silvapmm/pcb-thermal-lab architecture

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

- Interactive diagram: https://gitdiagram.com/silvapmm/pcb-thermal-lab
- Repository: https://github.com/silvapmm/pcb-thermal-lab

## Overview

PCB Thermal Lab lets users describe a multilayer board, import board geometry and copper when needed, choose a thermal model, run a solve, and inspect temperatures and other results. The main path is represented through the GUI or API, shared problem model, solver, and results; the CLI is another documented entry point. Additional branches cover Gerber import, transient power profiles, and memory safeguards. Edges reflect README statements or shown import/reference evidence; unsampled implementation details are omitted rather than inferred.

Main entry points: [`pcbthermal/api.py`](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/api.py) (Simulation API), [`pcbthermal/fvm.py`](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/fvm.py) (Finite volumes), [`pcbthermal/gui/app.py`](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/gui/app.py) (Interactive editor), [`pcbthermal/model.py`](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/model.py) (Board problem)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_gui["Interactive editor<br/>[app.py]"]
  node_cli["Command line<br/>[cli.py]"]
  node_api["Simulation API<br/>[api.py]"]
end

subgraph group_board["Board definition"]
  node_problem["Board problem<br/>[model.py]"]
  node_geometry["Board geometry<br/>[geometry.py]"]
  node_profiles["Power profiles<br/>[profiles.py]"]
end

subgraph group_import["Board import"]
  node_gerber["Gerber reader<br/>[parser.py]"]
  node_importsession["Import workflow<br/>[import_session.py]"]
  node_copper["Imported copper<br/>[copper.py]"]
end

subgraph group_simulation["Thermal simulation"]
  node_fvm["Finite volumes<br/>[fvm.py]"]
  node_fdm["Finite differences<br/>[fdm.py]"]
  node_solid["3D solid<br/>[solid3d.py]"]
  node_fem["Finite elements<br/>[fem.py]"]
  node_lumped["Thermal network<br/>[lumped.py]"]
  node_analytic["Analytical model<br/>[analytic.py]"]
  node_laminate["Laminate network<br/>[laminate.py]"]
  node_blocks["Metal blocks<br/>[blocks.py]"]
  node_vias["Via constriction<br/>[viaconstriction.py]"]
  node_viawell["Via wells<br/>[viawell.py]"]
  node_convection["Convection<br/>[convection.py]"]
end

subgraph group_results["Results and safeguards"]
  node_memory["Memory guard<br/>[memory.py]"]
  node_resultsdata["Solve results<br/>[results.py]"]
  node_plots["Maps and plots<br/>[plots.py]"]
end

node_user(("Engineer"))

node_user -->|"edits board"| node_gui
node_user -->|"starts run"| node_cli
node_gui -->|"runs simulation"| node_api
node_cli -->|"runs simulation"| node_api
node_api -->|"uses description"| node_problem
node_api -->|"dispatches model"| node_fvm
node_api -->|"dispatches model"| node_fdm
node_api -->|"dispatches model"| node_solid
node_api -->|"dispatches model"| node_fem
node_api -->|"dispatches model"| node_lumped
node_api -->|"dispatches model"| node_analytic
node_problem -->|"uses geometry"| node_geometry
node_fvm -->|"builds nodes"| node_laminate
node_fvm -->|"models blocks"| node_blocks
node_fvm -->|"models vias"| node_viawell
node_lumped -->|"uses constriction"| node_vias
node_api -->|"checks memory"| node_memory
node_api -->|"returns results"| node_resultsdata
node_gui -->|"shows results"| node_resultsdata
node_resultsdata -->|"feeds displays"| node_plots
node_gui -->|"starts import"| node_importsession
node_importsession -->|"reads files"| node_gerber
node_importsession -->|"builds imported copper"| node_copper
node_fvm -->|"maps copper"| node_copper
node_api -->|"simulates profiles"| node_profiles
node_api -->|"computes convection"| node_convection
node_problem -->|"stores profiles"| node_profiles

click node_gui "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/gui/app.py"
click node_cli "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/cli.py"
click node_api "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/api.py"
click node_problem "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/model.py"
click node_geometry "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/geometry.py"
click node_profiles "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/profiles.py"
click node_gerber "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/gerber/parser.py"
click node_importsession "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/gui/import_session.py"
click node_copper "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/copper.py"
click node_fvm "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/fvm.py"
click node_fdm "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/fdm.py"
click node_solid "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/solid3d.py"
click node_fem "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/fem.py"
click node_lumped "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/lumped.py"
click node_analytic "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/analytic.py"
click node_laminate "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/laminate.py"
click node_blocks "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/blocks.py"
click node_vias "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/viaconstriction.py"
click node_viawell "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/viawell.py"
click node_memory "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/memory.py"
click node_resultsdata "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/results.py"
click node_plots "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/plots.py"
click node_convection "https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/convection.py"

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_gui,node_cli,node_api toneBlue
class node_problem,node_geometry,node_profiles toneAmber
class node_gerber,node_importsession,node_copper toneMint
class node_fvm,node_fdm,node_solid,node_fem,node_lumped,node_analytic,node_laminate,node_blocks,node_vias,node_viawell,node_convection toneRose
class node_memory,node_resultsdata,node_plots,node_user toneIndigo
```

## Components

### User interfaces

- [Interactive editor](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/gui/app.py): `pcbthermal/gui/app.py`
- [Command line](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/cli.py): `pcbthermal/cli.py`
- [Simulation API](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/api.py): `pcbthermal/api.py`

### Board definition

- [Board problem](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/model.py): `pcbthermal/model.py`
- [Board geometry](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/geometry.py): `pcbthermal/geometry.py`
- [Power profiles](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/profiles.py): `pcbthermal/profiles.py`

### Board import

- [Gerber reader](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/gerber/parser.py): `pcbthermal/gerber/parser.py`
- [Import workflow](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/gui/import_session.py): `pcbthermal/gui/import_session.py`
- [Imported copper](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/copper.py): `pcbthermal/copper.py`

### Thermal simulation

- [Finite volumes](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/fvm.py): `pcbthermal/fvm.py`
- [Finite differences](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/fdm.py): `pcbthermal/fdm.py`
- [3D solid](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/solid3d.py): `pcbthermal/solid3d.py`
- [Finite elements](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/fem.py): `pcbthermal/fem.py`
- [Thermal network](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/lumped.py): `pcbthermal/lumped.py`
- [Analytical model](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/analytic.py): `pcbthermal/analytic.py`
- [Laminate network](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/laminate.py): `pcbthermal/laminate.py`
- [Metal blocks](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/blocks.py): `pcbthermal/blocks.py`
- [Via constriction](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/viaconstriction.py): `pcbthermal/viaconstriction.py`
- [Via wells](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/viawell.py): `pcbthermal/viawell.py`
- [Convection](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/convection.py): `pcbthermal/convection.py`

### Results and safeguards

- [Memory guard](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/memory.py): `pcbthermal/memory.py`
- [Solve results](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/results.py): `pcbthermal/results.py`
- [Maps and plots](https://github.com/silvapmm/pcb-thermal-lab/blob/main/pcbthermal/plots.py): `pcbthermal/plots.py`

### Other components

- **Engineer**

## Connections

- Engineer → Interactive editor: edits board (evidence: `README.md`)
- Engineer → Command line: starts run (evidence: `README.md`)
- Interactive editor → Simulation API: runs simulation (evidence: `README.md`)
- Command line → Simulation API: runs simulation (evidence: `README.md`)
- Simulation API → Board problem: uses description (evidence: `pcbthermal/api.py`)
- Simulation API → Finite volumes: dispatches model (evidence: `pcbthermal/api.py`)
- Simulation API → Finite differences: dispatches model (evidence: `pcbthermal/api.py`)
- Simulation API → 3D solid: dispatches model (evidence: `pcbthermal/api.py`)
- Simulation API → Finite elements: dispatches model (evidence: `pcbthermal/api.py`)
- Simulation API → Thermal network: dispatches model (evidence: `pcbthermal/api.py`)
- Simulation API → Analytical model: dispatches model (evidence: `pcbthermal/api.py`)
- Board problem → Board geometry: uses geometry (evidence: `pcbthermal/model.py`)
- Finite volumes → Laminate network: builds nodes (evidence: `pcbthermal/fvm.py`)
- Finite volumes → Metal blocks: models blocks (evidence: `pcbthermal/fvm.py`)
- Finite volumes → Via wells: models vias (evidence: `pcbthermal/fvm.py`)
- Thermal network → Via constriction: uses constriction (evidence: `pcbthermal/lumped.py`)
- Simulation API → Memory guard: checks memory (evidence: `pcbthermal/api.py`)
- Simulation API → Solve results: returns results (evidence: `pcbthermal/api.py`)
- Interactive editor → Solve results: shows results (evidence: `README.md`)
- Solve results → Maps and plots: feeds displays (evidence: `README.md`)
- Interactive editor → Import workflow: starts import (evidence: `pcbthermal/gui/import_session.py`)
- Import workflow → Gerber reader: reads files (evidence: `pcbthermal/gui/import_session.py`)
- Import workflow → Imported copper: builds imported copper (evidence: `pcbthermal/gui/import_session.py`)
- Finite volumes → Imported copper: maps copper (evidence: `pcbthermal/fvm.py`)
- Simulation API → Power profiles: simulates profiles (evidence: `README.md`)
- Simulation API → Convection: computes convection (evidence: `pcbthermal/api.py`)
- Board problem → Power profiles: stores profiles (evidence: `pcbthermal/model.py`)
