# quentinmale/sharp-crested-weir architecture

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

- Interactive diagram: https://gitdiagram.com/quentinmale/sharp-crested-weir
- Repository: https://github.com/quentinmale/sharp-crested-weir

## Overview

This repository combines sharp-crested-weir flow simulations and their output/visualization tools with experimental-data plotting and a Marp slide deck. The simulation workflow is represented as model runs producing XDMF data, which the ParaView script loads to render animation frames; the experimental plot is a separate branch. The README documents slide authoring, while its build and deployment machinery is omitted. Relationships are limited to the sampled source and README; simulation internals are kept within their model components.

Main entry points: [`basilisk/3d/render.py`](https://github.com/quentinmale/sharp-crested-weir/blob/main/basilisk/3d/render.py) (Animation renderer), [`basilisk/sharp_crested_weir_2d.c`](https://github.com/quentinmale/sharp-crested-weir/blob/main/basilisk/sharp_crested_weir_2d.c) (2D weir model), [`basilisk/3d/sharp_crested_weir_3d.c`](https://github.com/quentinmale/sharp-crested-weir/blob/main/basilisk/3d/sharp_crested_weir_3d.c) (3D weir model), [`utils/exp_data/plot_exp.py`](https://github.com/quentinmale/sharp-crested-weir/blob/main/utils/exp_data/plot_exp.py) (Experimental plotter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sim["Weir simulations"]
  node_model2d["2D weir model"]
  node_model3d["3D weir model"]
  node_writer2d["2D XDMF writer<br/>[xdmf2d.h]"]
  node_writer3d["3D XDMF writer<br/>[xdmf3d.h]"]
end

subgraph group_viz["Output visualization"]
  node_render["Animation renderer<br/>[render.py]"]
  node_frames["Rendered frames"]
end

subgraph group_exp["Experimental data"]
  node_plotter["Experimental plotter<br/>[plot_exp.py]"]
  node_measurements["Experimental measurements<br/>[data.csv]"]
end

subgraph group_pres["Presentation"]
  node_slides["Slide deck<br/>[index.md]"]
end

node_user(("Project user"))
node_paraview["ParaView"]
node_author(("Slide author"))

node_model2d -->|"calls"| node_writer2d
node_model3d -->|"calls"| node_writer3d
node_render -->|"uses API"| node_paraview
node_paraview -->|"loads XDMF"| node_render
node_render -->|"saves animation"| node_frames
node_plotter -->|"reads"| node_measurements
node_author -->|"edits"| node_slides

click node_model2d "https://github.com/quentinmale/sharp-crested-weir/blob/main/basilisk/sharp_crested_weir_2d.c"
click node_model3d "https://github.com/quentinmale/sharp-crested-weir/blob/main/basilisk/3d/sharp_crested_weir_3d.c"
click node_writer2d "https://github.com/quentinmale/sharp-crested-weir/blob/main/basilisk/xdmf2d.h"
click node_writer3d "https://github.com/quentinmale/sharp-crested-weir/blob/main/basilisk/3d/xdmf3d.h"
click node_render "https://github.com/quentinmale/sharp-crested-weir/blob/main/basilisk/3d/render.py"
click node_plotter "https://github.com/quentinmale/sharp-crested-weir/blob/main/utils/exp_data/plot_exp.py"
click node_measurements "https://github.com/quentinmale/sharp-crested-weir/blob/main/utils/exp_data/data.csv"
click node_slides "https://github.com/quentinmale/sharp-crested-weir/blob/main/slides/index.md"

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_model2d,node_model3d,node_writer2d,node_writer3d,node_user,node_paraview toneBlue
class node_render,node_frames toneAmber
class node_plotter,node_measurements toneMint
class node_slides toneRose
class node_author toneIndigo
```

## Components

### Weir simulations

- [2D weir model](https://github.com/quentinmale/sharp-crested-weir/blob/main/basilisk/sharp_crested_weir_2d.c): `basilisk/sharp_crested_weir_2d.c`
- [3D weir model](https://github.com/quentinmale/sharp-crested-weir/blob/main/basilisk/3d/sharp_crested_weir_3d.c): `basilisk/3d/sharp_crested_weir_3d.c`
- [2D XDMF writer](https://github.com/quentinmale/sharp-crested-weir/blob/main/basilisk/xdmf2d.h): `basilisk/xdmf2d.h`
- [3D XDMF writer](https://github.com/quentinmale/sharp-crested-weir/blob/main/basilisk/3d/xdmf3d.h): `basilisk/3d/xdmf3d.h`

### Output visualization

- [Animation renderer](https://github.com/quentinmale/sharp-crested-weir/blob/main/basilisk/3d/render.py): `basilisk/3d/render.py`
- **Rendered frames**

### Experimental data

- [Experimental plotter](https://github.com/quentinmale/sharp-crested-weir/blob/main/utils/exp_data/plot_exp.py): `utils/exp_data/plot_exp.py`
- [Experimental measurements](https://github.com/quentinmale/sharp-crested-weir/blob/main/utils/exp_data/data.csv): `utils/exp_data/data.csv`

### Presentation

- [Slide deck](https://github.com/quentinmale/sharp-crested-weir/blob/main/slides/index.md): `slides/index.md`

### Other components

- **Project user**
- **ParaView**
- **Slide author**

## Connections

- 2D weir model → 2D XDMF writer: calls (evidence: `basilisk/sharp_crested_weir_2d.c`)
- 3D weir model → 3D XDMF writer: calls (evidence: `basilisk/3d/sharp_crested_weir_3d.c`)
- Animation renderer → ParaView: uses API (evidence: `basilisk/3d/render.py`)
- ParaView → Animation renderer: loads XDMF (evidence: `basilisk/3d/render.py`)
- Animation renderer → Rendered frames: saves animation (evidence: `basilisk/3d/render.py`)
- Experimental plotter → Experimental measurements: reads (evidence: `utils/exp_data/plot_exp.py`)
- Slide author → Slide deck: edits (evidence: `README.md`)
