Skip to content

C1 Rows by their meaning ​

IDGroupTypeBackendsFigureProgram
C1ContractsCPython 3 (exact rationals, 100-digit decimals)yesscripts/gen_gideon.py --check

Case and scope ​

Every coefficient of GIDEON is derived by the generator from what the row means, a datum (a point value or a cell average) and a target (a derivative at a point, or its average over a cell), never copied from a table. This case is the generator's own checks, run before any Fortran is written: a row that fails one of them is not emitted, and the generator exits 1. What it cannot check, the compiled kernels, is the subject of C2 to C6.

Models and numerics ​

ItemChoiceCode
Derivationthe moment system ∑owoLo(xj)=T(xj), j<N, solved by Gauss–Jordan in fractions.Fractionderive
Exact degree, orderthe largest K with the row exact on x0…xK (checked up to N+4); order K+1−nexact_degree, composite_order
Pair forma centred row is symmetric or antisymmetric, exactly, or the generator stopscheck_pairs
Mirrorsevery left-side row solved independently on its own window, and compared with the right-side row mirrored, times (−1)n; the cell derivatives' orders recomputed on the mirrored operatorbuild
ADAMADAM's committed tables (notes/adam-reference/) parsed into exact fractions and compared with the derived rows, never adoptedparse_adam_tables, cross_check_adam
Orders, free of round-off|k−T| on g(x)=sin⁡(1.3x+0.4)+0.5cos⁡(0.7x−0.2) at x0=0.37, h=2−11,2−12, every weight exact, in 100-digit decimal arithmetic; bound: observed ≥ design −0.25check_orders
Read-backthe emitted Fortran rows parsed back and compared with the derived oneswrite_sources, parse_emitted_tables

The figure shows four rows as the generator derives them: the weights by offset (exact), the window, the target.

The windows of the upwind FV kernels with the weights of their rows

The right-side rows and their mirrors: face values (a face at 0) and cell-average first derivatives (cell 0). The left-side row is the right one read backwards, times (−1)n; GIDEON stores only the right one.

Program ​

bash
python3 scripts/gen_gideon.py --check                    # derive and verify, write nothing
python3 scripts/gen_gideon.py --check --json rows.json   # the data of these pages (scripts/run_report.sh)

Results ​

CheckResult
rows derived (exact rationals)332
3-D operators assembled from them40
ADAM rows cross-checked (non-zero ones of its tables)93, mismatches 0
left-side rows solved independently and found to be mirrors95
orders at 100 digits (h=2−11,2−12), bound design − 0.25332 rows, smallest margin -0.002 (fv_face_ur9, observed 8.998)
findings that fail the generator0

By family, with the smallest margin of the 100-digit order against the design order:

FamilyKernelsOrdersWindow (cells or nodes)Smallest observed − design order (100 digits)
FD centred, face value52-102-10-0.000 (fd_face_c10)
FD centred, node derivatives d1-d6242-103-11-0.000 (fd_d1_c10)
FD centred, face derivatives d1-d5192-102-10-0.000 (fd_face_d2_c8)
FD one-sided, face value (extrapolation)181-91-9-0.002 (fd_face_ur9)
FD upwind-biased, face value (interpolation)83-93-9-0.000 (fd_face_br9)
FV centred, face value52-102-10-0.000 (fv_face_c10)
FV centred, face derivatives d1-d5192-102-10-0.000 (fv_face_d2_c8)
FV centred, cell-average derivatives d1-d6242-103-11-0.000 (fv_d1_c10)
FV upwind, face value181-91-9-0.002 (fv_face_ur9)
FV upwind, face derivatives d1-d5601-82-9-0.002 (fv_face_d1_ur8)
FV upwind, cell-average derivatives d1-d6781-92-10-0.002 (fv_d1_ur8)
Deconvolution (point value, cell average)104-123-11-0.000 (fv_point_c12)
FV upwind-biased, face value83-93-9-0.000 (fv_face_br9)
FD undivided face differences (dissipation fluxes)52-22-10-0.000 (fd_face_diss_c10)
FV undivided face differences (dissipation fluxes)52-22-10-0.000 (fv_face_diss_c10)
FD dissipation parts of the biased face values82-24-10-0.000 (fd_face_diss_br9)
FV dissipation parts of the biased face values82-24-10-0.000 (fv_face_diss_br9)
FD explicit filters52-103-11-0.000 (fd_filter_c10)
FV explicit filters52-103-11-0.000 (fv_filter_c10)
all332

Findings ​

  • No mismatch with ADAM's tables: ADAM's coefficients are right where it has them. ADAM's defects (audit items A, B, F) are in how its kernels read the rows and their windows, not in the rows (C5).
  • The upwind rows sit closest to the bound: at h=2−12 their 100-digit orders are a few thousandths below the design order, the pre-asymptotic term of a one-sided stencil. The compiled kernels' orders, on coarser plateaus where quadruple precision resolves them, are in A1.
  • The FV centred cell-average derivatives have the rows of the FD node derivatives (below).

24 of the 24 centred cell-average derivatives fv_dN_cP have the weights of the node derivative fd_dN_cP of the same window, exactly (the rows of the JSON compared as fractions).

The reason: for a Fourier mode the cell average multiplies the data and the target by the same factor, sin⁡(ξ/2)/(ξ/2), so the moment systems of the two have the same solution. The kernels compute it differently, by a flux difference of face rows (fv) and by pairs (fd), so their values agree to round-off, not bitwise in general (A3 draws one curve for both).

Released under your choice of GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause or MIT.