Build & Benutzung

Voraussetzungen

Folgende Software wird benoetigt:

Tool

Zweck

Installation (Ubuntu/WSL)

GCC/G++

C++11-Compiler

sudo apt install build-essential

SCons

Build-System

pipx install scons

Git

Versionskontrolle

sudo apt install git

Doxygen + Graphviz

API-Dokumentation

sudo apt install doxygen graphviz

Sphinx + RTD-Theme

Benutzer-Dokumentation

pip3 install sphinx sphinx_rtd_theme

Python 3

Fuer SCons und Sphinx

sudo apt install python3 python3-pip

Repository einrichten

Klonen und Submodule

git clone https://git.uni-jena.de/na48gom/tsunami.git
cd tsunami

# Catch2 Test-Framework als Submodul initialisieren (wichtig!)
git submodule init
git submodule update

Kompilierung

Das Projekt verwendet SCons als Build-System.

Build-Modi

# Release-Build (optimiert, -O2)
scons

# Debug-Build (keine Optimierung, Debug-Symbole)
scons mode=debug

# Debug + Address- und Undefined-Behavior-Sanitizer
scons mode=debug+san

# Release + Sanitizer
scons mode=release+san

# Paralleler Build (z.B. mit 4 Threads)
scons -j4

# Build aufraeumen (alle erzeugten Dateien loeschen)
scons -c

Unit-Tests

Catch2 als Test-Framework.

Tests ausführen

# Alle Tests ausfuehren
./build/tests

# Nur Tests mit einem bestimmten Tag
./build/tests "[FWave]"
./build/tests "[RoeSpeeds]"

# Einen einzelnen Test nach Name ausfuehren
./build/tests "Test f-wave net-updates for steady state"

# Alle vorhandenen Tags auflisten
./build/tests --list-tags

# Alle Tests mit ausfuehrlicher Ausgabe
./build/tests -s

Verzeichnisstruktur

tsunami/
├── SConstruct               # Build-Einstiegspunkt (SCons)
├── shell.nix                # Nix-Entwicklungsumgebung (Uni-Rechner)
├── submit.sh                # Abgabe-Skript (erstellt tar.xz)
├── src/
│   ├── main.cpp             # Simulations-Einstiegspunkt
│   ├── tests.cpp            # Catch2 Test-Runner
│   ├── constants.h          # Globale Konstanten (t_real, t_idx, g)
│   ├── SConscript           # Quell- und Testdatei-Listen
│   ├── solvers/             # Riemann-Solver
│   │   ├── Roe.h/.cpp       #   Roe-Solver (Referenzimplementierung)
│   │   ├── FWave.h/.cpp     #   F-wave Solver
│   │   └── *.test.cpp       #   zugehoerige Unit-Tests
│   ├── patches/             # Wellen-Propagation
│   ├── setups/              # Anfangsbedingungen (z.B. DamBreak)
│   └── io/                  # Ein-/Ausgabe (CSV)
├── submodules/Catch2/       # Catch2 Test-Framework (Git-Submodul)
├── sphinx/                  # Sphinx-Dokumentation (dieses Dokument)
├── doxygen/                 # Doxygen-Konfiguration + generierte API-Doku
└── build/                   # Erzeugte Binaries (nicht im Git)