Tsunami Project Lab
Loading...
Searching...
No Matches
validate_middle_states.cpp File Reference
#include "constants.h"
#include "io/Csv.h"
#include "patches/WavePropagation1d.h"
#include "solvers/FWave.h"
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <string>
Include dependency graph for validate_middle_states.cpp:

Functions

int main (int i_argc, char *i_argv[])
 

Function Documentation

◆ main()

int main ( int i_argc,
char * i_argv[] )
Author
Moritz Arnhold, Moritz Martin

DESCRIPTION

Full-scale validation of the f-wave solver against the reference middle-state heights in resources/middle_states.csv.

For each Riemann problem in the CSV this binary:

  1. initialises a 1d domain split at its middle into left/right states,
  2. advances the solver for a CFL-safe number of steps until the fastest wave has travelled ~40% of the half-domain (plateau formed, waves have not yet reached the boundaries),
  3. samples the water height at the discontinuity (middle cell), which lies inside the middle-state plateau,
  4. compares against the expected h* and records absolute and relative errors plus a pass/fail flag.

Output is written to validation_middle_states.csv. Summary statistics (total rows, miss count, miss ratio, max/mean absolute error, mean relative error) are printed to stdout.

Usage: ./build/validate_middle_states [nCells] [maxRows] [relTol]

  • nCells : number of cells in x-direction (default: 500)
  • maxRows : process only this many rows, 0 = all (default: 1000)
  • relTol : relative tolerance for pass/fail (default: 1e-2)