# nihaltodurkar-cms/nt-semtcad architecture

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

- Interactive diagram: https://gitdiagram.com/nihaltodurkar-cms/nt-semtcad
- Repository: https://github.com/nihaltodurkar-cms/nt-semtcad

## Overview

PyTCAD is a semiconductor TCAD toolkit for drift-diffusion device and fabrication-process simulation, with a domain workbench and desktop interface. The principal workflow is to author or load a device specification, validate and adapt it into a simulation input, run a solver, and inspect the resulting fields and analyses. The graph also preserves documented process simulation, transient/AC, circuit, and specialized physics capabilities. Some subsystem connections come from README documentation rather than sampled call sites; those are marked unverified.

Main entry points: [`pytcad/pytcad/device2d.py`](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/device2d.py) (2D Device Solver), [`pytcad/gui/services/solver_runner.py`](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/gui/services/solver_runner.py) (Solver Runner), [`pytcad/pytcad/device.py`](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/device.py) (1D Device Solver), [`pytcad/backend_service/server.py`](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/backend_service/server.py) (Backend RPC)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Authoring and Workbench"]
  node_spec["Device Specification<br/>[device_spec.py]"]
  node_structure["Structure Model<br/>[structure_model.py]"]
  node_adapter["Domain Adapter<br/>[spec.py]"]
  node_domain["Workbench Device<br/>[device.py]"]
  node_catalog["Models and Templates<br/>[catalog.py]"]
  node_examples["Example Devices<br/>[examples.py]"]
  node_analysis["Workbench Analysis<br/>[observables.py]"]
end

subgraph group_runtime["Simulation Runtime"]
  node_runner["Solver Runner<br/>[solver_runner.py]"]
  node_backend["Solver Backend<br/>[solver_backend.py]"]
  node_device1d["1D Device Solver<br/>[device.py]"]
  node_device2d["2D Device Solver<br/>[device2d.py]"]
  node_device3d["3D Device Solver<br/>[device3d.py]"]
  node_mesh["Mesh Construction<br/>[mesh2d.py]"]
  node_linear["Linear Solvers<br/>[linsolve.py]"]
end

subgraph group_physics["Physics and Process"]
  node_materials["Material Models<br/>[materials.py]"]
  node_process["Process Simulation<br/>[process.py]"]
  node_advanced["Advanced Physics<br/>[dg.py]"]
end

subgraph group_interaction["Desktop and Results"]
  node_desktop["Desktop Shell<br/>[main_window.cpp]"]
  node_rpc["Backend RPC<br/>[server.py]"]
  node_results[("Result Storage<br/>[result_store.py]")]
  node_viewer["Field and Plot Views<br/>[field_view.cpp]"]
end

node_user(("Engineer"))

node_user -.->|"authors and runs"| node_desktop
node_desktop -.->|"requests jobs"| node_rpc
node_rpc -->|"loads specification"| node_spec
node_rpc -->|"builds examples"| node_examples
node_rpc -->|"loads structure"| node_structure
node_adapter -->|"converts specification"| node_spec
node_adapter -->|"converts structure"| node_structure
node_adapter -->|"builds domain device"| node_domain
node_domain -->|"uses model catalog"| node_catalog
node_runner -->|"constructs and solves"| node_device1d
node_runner -->|"constructs and solves"| node_device2d
node_runner -->|"constructs and solves"| node_device3d
node_runner -->|"validates results"| node_backend
node_backend -.->|"validates result data"| node_results
node_device2d -->|"uses mesh"| node_mesh
node_device3d -->|"shares device models"| node_device2d
node_device1d -->|"uses material models"| node_materials
node_device2d -->|"uses material models"| node_materials
node_device3d -->|"uses material models"| node_materials
node_device1d -->|"solves linear systems"| node_linear
node_device2d -->|"solves linear systems"| node_linear
node_process -.->|"uses material data"| node_materials
node_device1d -->|"supports quantum models"| node_advanced
node_results -.->|"supplies result data"| node_viewer
node_analysis -.->|"derives observables"| node_results

click node_desktop "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/desktop/src/shell/main_window.cpp"
click node_rpc "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/backend_service/server.py"
click node_spec "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/gui/services/device_spec.py"
click node_structure "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/gui/services/structure_model.py"
click node_adapter "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/workbench/adapters/spec.py"
click node_domain "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/workbench/core/device.py"
click node_catalog "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/workbench/core/catalog.py"
click node_examples "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/gui/services/examples.py"
click node_runner "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/gui/services/solver_runner.py"
click node_backend "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/gui/services/solver_backend.py"
click node_device1d "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/device.py"
click node_device2d "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/device2d.py"
click node_device3d "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/device3d.py"
click node_mesh "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/mesh2d.py"
click node_linear "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/linsolve.py"
click node_materials "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/materials.py"
click node_process "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/process.py"
click node_advanced "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/dg.py"
click node_analysis "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/workbench/analysis/observables.py"
click node_results "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/gui/services/result_store.py"
click node_viewer "https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/desktop/src/views/field/field_view.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_spec,node_structure,node_adapter,node_domain,node_catalog,node_examples,node_analysis toneBlue
class node_runner,node_backend,node_device1d,node_device2d,node_device3d,node_mesh,node_linear toneAmber
class node_materials,node_process,node_advanced toneMint
class node_desktop,node_rpc,node_results,node_viewer toneRose
class node_user toneIndigo
```

## Components

### Authoring and Workbench

- [Device Specification](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/gui/services/device_spec.py): `pytcad/gui/services/device_spec.py`
- [Structure Model](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/gui/services/structure_model.py): `pytcad/gui/services/structure_model.py`
- [Domain Adapter](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/workbench/adapters/spec.py): `pytcad/workbench/adapters/spec.py`
- [Workbench Device](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/workbench/core/device.py): `pytcad/workbench/core/device.py`
- [Models and Templates](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/workbench/core/catalog.py): `pytcad/workbench/core/catalog.py`
- [Example Devices](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/gui/services/examples.py): `pytcad/gui/services/examples.py`
- [Workbench Analysis](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/workbench/analysis/observables.py): `pytcad/workbench/analysis/observables.py`

### Simulation Runtime

- [Solver Runner](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/gui/services/solver_runner.py): `pytcad/gui/services/solver_runner.py`
- [Solver Backend](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/gui/services/solver_backend.py): `pytcad/gui/services/solver_backend.py`
- [1D Device Solver](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/device.py): `pytcad/pytcad/device.py`
- [2D Device Solver](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/device2d.py): `pytcad/pytcad/device2d.py`
- [3D Device Solver](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/device3d.py): `pytcad/pytcad/device3d.py`
- [Mesh Construction](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/mesh2d.py): `pytcad/pytcad/mesh2d.py`
- [Linear Solvers](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/linsolve.py): `pytcad/pytcad/linsolve.py`

### Physics and Process

- [Material Models](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/materials.py): `pytcad/pytcad/materials.py`
- [Process Simulation](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/process.py): `pytcad/pytcad/process.py`
- [Advanced Physics](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/pytcad/dg.py): `pytcad/pytcad/dg.py`

### Desktop and Results

- [Desktop Shell](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/desktop/src/shell/main_window.cpp): `pytcad/desktop/src/shell/main_window.cpp`
- [Backend RPC](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/backend_service/server.py): `pytcad/backend_service/server.py`
- [Result Storage](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/gui/services/result_store.py): `pytcad/gui/services/result_store.py`
- [Field and Plot Views](https://github.com/nihaltodurkar-cms/nt-semtcad/blob/main/pytcad/desktop/src/views/field/field_view.cpp): `pytcad/desktop/src/views/field/field_view.cpp`

### Other components

- **Engineer**

## Connections

- Engineer → Desktop Shell: authors and runs
- Desktop Shell → Backend RPC: requests jobs
- Backend RPC → Device Specification: loads specification (evidence: `pytcad/backend_service/server.py`)
- Backend RPC → Example Devices: builds examples (evidence: `pytcad/backend_service/server.py`)
- Backend RPC → Structure Model: loads structure (evidence: `pytcad/backend_service/server.py`)
- Domain Adapter → Device Specification: converts specification (evidence: `pytcad/workbench/adapters/spec.py`)
- Domain Adapter → Structure Model: converts structure (evidence: `pytcad/workbench/adapters/spec.py`)
- Domain Adapter → Workbench Device: builds domain device (evidence: `pytcad/workbench/adapters/spec.py`)
- Workbench Device → Models and Templates: uses model catalog (evidence: `pytcad/workbench/core/device.py`)
- Solver Runner → 1D Device Solver: constructs and solves (evidence: `pytcad/gui/services/solver_runner.py`)
- Solver Runner → 2D Device Solver: constructs and solves (evidence: `pytcad/gui/services/solver_runner.py`)
- Solver Runner → 3D Device Solver: constructs and solves (evidence: `pytcad/gui/services/solver_runner.py`)
- Solver Runner → Solver Backend: validates results (evidence: `pytcad/gui/services/solver_runner.py`)
- Solver Backend → Result Storage: validates result data
- 2D Device Solver → Mesh Construction: uses mesh (evidence: `pytcad/pytcad/mesh2d.py`)
- 3D Device Solver → 2D Device Solver: shares device models (evidence: `pytcad/pytcad/device3d.py`)
- 1D Device Solver → Material Models: uses material models (evidence: `pytcad/pytcad/device.py`)
- 2D Device Solver → Material Models: uses material models (evidence: `pytcad/pytcad/device2d.py`)
- 3D Device Solver → Material Models: uses material models (evidence: `pytcad/pytcad/device3d.py`)
- 1D Device Solver → Linear Solvers: solves linear systems (evidence: `pytcad/pytcad/device.py`)
- 2D Device Solver → Linear Solvers: solves linear systems (evidence: `pytcad/pytcad/device2d.py`)
- Process Simulation → Material Models: uses material data
- 1D Device Solver → Advanced Physics: supports quantum models (evidence: `pytcad/pytcad/device.py`)
- Result Storage → Field and Plot Views: supplies result data
- Workbench Analysis → Result Storage: derives observables
