Skip to content
szaghiPublic

About

Smoothness-weighted ENO, TENO and Hybrids: high-order non-oscillatory reconstruction and interpolation for HPC

Resources

Contributing

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

SETH, the Riemann fan opened like a folding fan on a crackle-glazed tile

WENO and TENO kernels, one pure function each, on every CPU and GPU

Smoothness-weighted ENO, TENO and Hybrids

High-order non-oscillatory reconstruction and interpolation for HPC, in modern Fortran. The successor of WenOOF: one pure, device-callable kernel per scheme, coefficients as compile-time constants, no dynamic dispatch where the cells are swept.

Version CI Matrix Fortran License: GPL v3 License: BSD-2 License: BSD-3 License: MIT

🧮 Every scheme, one kernel each
WENO-JS 1/3/5/7/9, WENO-Z 3/5/7/9, TENO5, TENO5-opt, TENO5-AZ, TENO5-A, TENO6, TENO6-opt, NENO6, TENO8 and TENO8-A, for reconstruction from cell averages and interpolation from point values, and the centred WENO4/6/8-C (reconstruction), optionally returning the weights ratios. Schemes · API
⚡ Called from inside your loops
Every kernel is pure, !$acc routine seq and !$omp declare target; the coefficients are compile-time constants, so nothing is set up or copied to the device. On an RTX 4070, WENO-5 reconstructs a face in 0.97 ns and WENO-7 in 1.76 ns, in double precision. Performance
🎯 Exact coefficients
The WENO-Z and TENO coefficients are derived in exact rational arithmetic, cross-checked against the papers and re-verified as compiled. Tables
🛡️ Positivity near vacuum
seth_positivity_euler, the flux limiter of Hu, Adams & Shu (2013) for the Euler equations in 1-D to 3-D: the blending factor in closed form, the largest that keeps density and pressure above their floors, on the host and on the GPU. Positivity limiter
🔬 Verification you can read
Thirty-one programs, also the test suite: orders at a point, at critical points and over whole domains, invariances, golden values, Sod, Lax, 123, Shu–Osher and the blast wave in a 1-D Euler harness, Burgers against its exact solution, spectral properties; figures and animations on every case page. Verification
🧰 Three compilers, CPU and GPU
gfortran, nvfortran and ifx, debug and optimised, plus the OpenACC build on the GPU; built with FoBiS or fpm. A mutation run catches 25 of 25 planted defects. Installation · Mutation testing

Full documentation: guide · verification · API reference


Quick start

git clone https://github.com/szaghi/SETH && cd SETH
fobis fetch                                                   # PENF, into src/third_party/
fobis build --mode static-gnu                                 # lib/gnu/static/libseth.a
fobis build --mode tests-gnu && bash scripts/run_tests.sh     # the 34 verification programs

as a FoBiS dependency, in the fobos of your project (then fobis fetch && fobis build):

[dependencies]
deps_dir = src/third_party
PENF     = https://github.com/szaghi/PENF :: branch=master   # SETH's own dependency: fobis fetch is not transitive
SETH     = https://github.com/szaghi/SETH :: branch=main

or as an fpm dependency, in your fpm.toml:

[dependencies]
SETH = { git = "https://github.com/szaghi/SETH", branch = "main" }

The two states at the face i+1/2, from the values around it (cells by offset from the face: 0 left, 1 right):

use seth
real(R_P) :: vp(-2:3), vm(-2:3), rp, rm

call seth_weno5_js(vp, vm, SETH_WENO_JS_EPS, 1._R_P, rp, rm)   ! WENO-JS 5: rp left, rm right
call seth_teno5(vp, vm, SETH_TENO_EPS, SETH_TENO5_CT, rp, rm)  ! TENO5

The quick start lists every kernel and its parameters; conventions explains the stencil layout and the kinds.

Authors

Stefano Zaghi · stefano.zaghi@gmail.com

Chief Yak Shaver & Serial Library Resurrector — wrote WenOOF, watched it die of run-time polymorphism in the inner loops, and named its successor after the son Adam had once Abel was gone

Giacomo Rossi

High Priest of the GPU & Exorcist of Data Races — co-author of the GPU WENO machinery SETH grew from

Claude (Anthropic)

Omniscient Code Oracle & Tireless Rubber Duck — AI pair programmer, responsible for deriving coefficients in exact rational arithmetic and for running mutants all night so humans don't have to

License

SETH is available under your choice of license:

License SPDX File
GNU General Public License v3 GPL-3.0-or-later LICENSE.gpl3.md
BSD 2-Clause BSD-2-Clause LICENSE.bsd-2.md
BSD 3-Clause BSD-3-Clause LICENSE.bsd-3.md
MIT MIT LICENSE.mit.md

© Stefano Zaghi

About

Smoothness-weighted ENO, TENO and Hybrids: high-order non-oscillatory reconstruction and interpolation for HPC

Resources

Contributing

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages