Skip to content

Unit tests ​

The unit tests pin the building blocks below the solver: the eigensystems, the fluxes and Riemann solvers, the positivity limiter, the WENO tables and weights, and the library pieces FLUME relies on (the tree lookup, the quadtree seam exchange, the Poisson solvers). Each device twin (_fnl) also asserts the device result equal to the host one.

FLUME ​

Sources in src/tests/flume/unit/.

TestWhat it pins
test_flume_euler_library (+ _fnl)Euler eigensystem, flux, Roe average, split consistency; RS(q, q) = f(q) for LLF/HLL/HLLC, HLLC exact on a contact, positive first-order updates; the si descaler of planar and static states within 108 of the largest (host); device = host
test_flume_mhd_library (+ _fnl)MHD, GLM and EGLM eigensystems (including degenerate states), fluxes, auxiliary variables, cyclic invariance; the si descaler of planar, field-free and static states within 108 of the largest; αf, αs to full relative accuracy at high and low β with B near the normal, against quadruple precision (#79) (host); device = host
test_flume_mhd_riemann (+ _fnl)MHD LLF/HLL/HLLD without cleaning, with GLM and with EGLM: consistency, HLLD exact on contact, tangential and rotational discontinuities, cyclic invariance bitwise, positive updates, EGLM = GLM bitwise at ψ=0; device = host
test_flume_positivityPV-0, the limiter on random admissible states with perturbed fluxes (Euler, MHD, EGLM): every limited update positive and above the relative floor, the limiter needed and acting; a NaN or infinite high-order flux replaced by the backbone flux; inadmissible face ghosts blended above the floors, every other value untouched; a cell with a 2:1 seam face (mean donor-state backbone) admissible for any seam factor up to its own, and not without the limiter
test_flume_weno_interpolation (+ _fnl)WENO interpolation tables: exactness, convergence, device = host for both weights (js, si); the reconstruction tables unchanged; the si weights scale-covariant bitwise on the device
test_flume_weno_weightsNV-1 of issue #49: with [weno] weights = si, WENO(2nv) = 2n WENO(v) bitwise for every scheme, both tables, random stencils from 10−12 to 1012; the js weights fail it (negative control); quadratic data reproduced by both; zero data stay zero
bash
fobis build --mode test-flume-<name>-gnu                         # host
fobis build --mode test-flume-<name>-fnl-nvf --varset local_nvf  # device twin

Library tests used by the FLUME cases ​

TestSourcesWhat it pinsCase
test_tree_closest_blocksrc/tests/amr/the tree lookup of the seam peers on binary trees, quadtrees and octrees, including a single-block tree (#54)multi-realm runs
test_quadtree_seam_ghost (+ -fnl-nvf)src/tests/amr/the 2:1 seam exchange on a linear field: octree, quadtree nk = 4 and nk = 1, 1 to 3 ranks; the device exchange equal to the CPU one, bit for bit (#46)quadtree AMR
test_poisson_fft (+ -fnl-nvf)src/tests/poisson/the FFT Poisson solver, periodic and isolated (SV-2, SV-6)FFT Poisson solver, isolated solver
test_poisson_mgsrc/tests/poisson/the multigrid Poisson solver on AMR grids (SV-9, SV-12, SV-13); --bc the boundary kinds per face, against the FFT solver on uniform grids and a manufactured potential on AMR (#84, E1b); --flail the FLAIL facade with them, bitwise against the solvers called directly, and per-component kinds as one instance per component (E1c)multigrid on AMR
test_flail_bc (+ -fnl-nvf)src/tests/poisson/FLAIL boundary kinds per face in the FFT solver: periodic, Dirichlet and Neumann at the face (mixed per axis, 2n/4n extensions), ghost-Dirichlet; round-off against per-axis discrete eigenfunctions, ghost layer included; D/D order 1.99 (#84, E1a). The same with the wide D(G) of order 2, 4, 6, 8 (PRISM's elliptic operator, E2a), its eigenvalue computed in real space, ghost layers to depth p; wide p = 4 D/D order against the continuum. Zero-ghost faces (PRISM's Dirichlet, E2b) by preconditioned CG: a manufactured solution, the ghosts against the rules, the iterations bounded in the grid. PRISM's own operators (E3a): div(grad phi) = f with the library's centred FD and FV derivatives of order 2–8, the solver's ghosts read, so FLAIL inverts exactly the operator PRISM applies. Free-space ghosts (PRISM's exact/open face, E3c): the ghost slabs against a direct Green's sum, D(G) phi = factor f with them, the same on 1–3 rankspoisson.sh --legs bc

| test_rk_ssp_tableau | src/tests/rk/ | the SSP Butcher tableaux (#104): the order conditions up to each scheme's order in quadruple precision (≤10−14; SSP(5,4) at 6⋅10−16), ci=∑jaij, A strictly lower triangular, a constant force exact, the observed order on y′=−y, the SSP(5,4) error at 320 steps ≤10−12 | every case (the time integrator) |

Build modes: test-tree-closest-block-gnu, test-quadtree-seam-ghost-gnu (-fnl-nvf), test-poisson-fft-gnu (-fnl-nvf), test-poisson-mg-gnu, test-rk-ssp-tableau-gnu.