Skip to content

main train 2026-11-18: 2.0.0rc1, Richards/TADR first step and per-face BC kinds (C0), abort drain (C32), getCSR and BDM2/RT1 (C8), ymf 0.3 through dispatch (C5), csr 64 (C33), ADRH generator (C19), air-water-vv and sandbox port fixes - #1368

Merged
cekees merged 85 commits into
proteustoolkit:mainfrom
cekees:train/main-2026-11-18
Nov 18, 2026

Conversation

@cekees

@cekees cekees commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Each change below was reviewed, and passed CI, as its own pull request on cekees/proteus. This branch merges them onto main at b9d98f5 with one merge commit per pull request, in the order listed.

Merge with "Create a merge commit", not squash or rebase, so the commits keep their hashes and the fork's pull requests close themselves.

pull request what commits
cekees#303 Version 2.0.0rc1 in the three version files 1
cekees#306 C0: Richards rebuilds the first step's old-time mass at the coupled density; Newton ends a solve whose iterate or residual is non-finite or grew past 1e30 2
cekees#308 C32 round 6: flush and wait before every MPI_Abort; opt-in abort hook for scripts run under mpiexec 3
cekees#309 C8 round 6: SparsityInfo::getCSR heap overrun on a pattern with a missing row; one-cell-per-rank hang 2
cekees#312 CLAUDE.md for Claude Code sessions in cloud containers 1
cekees#316 C5 step 4 part 3: stored meshes, dispersive family, cells per axis, 3D two-phase tanks and gauges through dispatch; dispatch reads ymf 0.3 8
cekees#310 C0: Richards levee first step explained (round-off floor at dt 2.7e-14) and the levee test made non-vacuous 4
cekees#315 C0 round 13: RANS2P ghost penalty on unfitted::jumpPenalty; DG P3+ weak-Dirichlet penalty floor 6
cekees#317 C8 round 7: BDM2 and RT1 on simplices, RT0 on quadrilaterals and hexahedra, constexpr element tables for the ADRH engine 6
cekees#318 C33 tail: the csr 64 build and suite, CouplingFSI nodeStar index type 6
cekees#319 C19: the ADRH generator reads ymf 0.3's words; engine slots for h, dr, diffusion and d(dH); RDLS and MCorr generated 5
cekees#320 C0 round 14: per-face strong / weak / none boundary kinds (C12), gf.D audit, a test that reaches RANS2P's cut-cell code 6
cekees#321 C48: proteus fixes from the air-water-vv 2.0 port (sediment closure pickling, rigid bodies, TwoPhaseFlow 1.x messages, parun, zones, wave time series) 12
cekees#322 Defects found porting the proteus-sandbox decks (step retries, debugger stops, wrapper argument errors, subgrid-error kernel choice, and more) 7
cekees#313 C0: TADR RKEV first dt of an edge-flux run is no longer the CFL of a state with no mass (stacks on #310) 1

The commit counts include the merge commits that bring #316 into #315 and #317-#322, so those pull requests could be tested with it; their own commits are listed below.

Measured, per pull request:

  • added generation of a double-peaked Random wave series #303 changes the three version files (setup.py, proteus/__init__.py, docs/Doxyfile) from 2.0.0.dev to 2.0.0rc1, so a 2.0.0rc1 tag matches the built version (release.yml refuses a mismatch). No code change.
  • Adimako/wavetools #306 changes proteus/richards/Richards.py (LevelModel.refreshOldTimeMass in preStep) and proteus/NonlinearSolvers.py (iterateDiverged). Cause found on CI: the flow stored its time history at rho 1.0 while the coupled density was 1.0125, at the transport's first dt of 2.66e-14, so Newton diverged to |u| 5e189 and SuperLU returned NaN. With the refresh: first residual 34, max |u| 47, nothing non-finite. The guard is bit-identical on well-behaved solves (VOF, VOF3P, serial and 2 ranks).
  • [WIP] Add msdg #308 changes proteus/runtime.py, proteus/partitioning.cpp and test/test_parun_abort.py. Python and C stdio are flushed and the process waits 0.2 s before Abort(1); the partitioner's abortWith and its four bare MPI_Abort calls share abortAfterDrain. runtime.start(abort_program=...) installs the hook for scripts run directly under mpiexec (2-rank repro: without it a 30 s timeout, with it exit 1 in 1.9 s with the message). The lost message did not reproduce before the fix (0/240 on ceds-model); 15 tests pass.
  • some updates for POD DEIM and Hyper reduction cleanup #309 changes proteus/sparsity.cpp and tests. getCSR sizes rows from the largest key and iterates without inserting, so a missing row is an empty row: valgrind 3 invalid reads/writes -> 0 on spark2 and yoda-2604; test_cube_mms.py 25 passed. One hexahedron on 2 ranks now exits on every rank with a message instead of hanging. Why the 11-16 nightly's pattern had a hole is not reproduced elsewhere and stays open.
  • tweaks get_burgers_ns so that multiple imports don't affect test results #312 adds CLAUDE.md (documentation only): building and testing in a cloud container; a scope line keeps the workspace rules first on the maintainer's machines.
  • Add first order maxmin #316 changes proteus/Dispatch*.py, proteus/cli/ymfrun.py, proteus/SWFlow/README.md and test/dispatch. Stored meshes, the dispersive family, mesh.cells per axis, 3D two-phase tanks and point/line gauges run from a ymf spec and equal the hand-written deck bitwise on 1 and 2 ranks. Dispatch reads stabilization through ymf.stabilization.resolve, and its fixtures use ymf 0.3's keys; test/dispatch passes 106 under ymf 0.3.0 and 0.3.1. The SWE and TwoPhaseFlow apps are not retired (air-water-vv still uses TwoPhaseFlow).
  • Cleanup deim #310 changes the Richards levee test and adds test/richards_instr.py and test/richards_first_step_mass_compare.py. The first step stalled at a round-off floor (residual proportional to eps m / dt at dt 2.66e-14), not at a Dirichlet jump; with first dt 1e-8 the run reaches t = 10 in 208 solves, 0 failed. The test now asserts the run reaches its final time with no failed solve. A 365-day density-coupled run does not keep the stale first-step mass (1.1e-3 m at the first step, <= 3e-12 m from day 1).
  • Test global hdf5 pwl only #315 (e57b35d, 531e056, 5ddb8d2, 7d4454a) changes proteus/mprans/RANS2P.h, RANS2P2D.h, proteus/NumericalFlux.py and tests. The ghost penalty is unfitted::jumpPenalty (the per-dof maps are gone): Jacobian 8.9e-16 (2D) and 3.1e-15 (3D), residual 2.2e-16 / 5.6e-16 against the old code at a fixed state with cut faces; a new test pins the old values. DG P3+ weak Dirichlet gets a penalty floor of 2.5 p^2 (measured threshold for optimal rates, p = 2..6); no existing DG result moves.
  • Cython wave tools #317 (dcfa416, e90865d, 31d3795, 1d1260a) adds HdivSpaces RT1 and BDM2 on triangles and tetrahedra (normal jump 4e-14..2e-13; serial = 2 ranks to 8e-17; L2 rates tri rt1 2.00, bdm2 2.995, tet 1.95 / 2.97), RT0 on affine quadrilaterals and hexahedra (normal jump 1.2e-14 / 2.2e-14, rates 1.00 / 1.01), and proteus.ElementTables constexpr reference-element tables equal to numpy bit for bit. 111 tests.
  • Adimako/wave tools/cython #318 (08ee3c5, c972a0d, 90133fb, 7d21425) is the csr 64 build: compile fixes in ErrorResidualMethod.cpp and partitioning.cpp, sparse-diffusion layout arrays stored at CSR_INDEX_DTYPE, CouplingFSI.pyx nodeStar buffers at the index type. Full suite on spark2 against a scratch 64-bit-index PETSc: csr 32 31 failed / 4386 passed, csr 64 141 / 4272 before the last two fixes; of the 115 only at 64, 96 are PETSc's serial SuperLU (not available with 64-bit indices), 13 are stored 32-bit binary matrices; no type defect left. The default build (csr 32) is unchanged.
  • Cython wave tools #319 (0961392, b22a4f0, cb6ec9d) changes experimental/adrh only. The generator reads ymf 0.3's stabilization, shock capturing, lagging, boundary kind and porosity; generated VOF and NCLS equal the hand-written functors to 1.6e-15 (proteus fixtures: VOF residual 1.98e-15, Jacobian 2.44e-16). Engine slots for h, dr, diffusion and d(dH)/d(grad u) (Jacobian vs central differences 2.8e-10); RDLS and MCorr generated.
  • Cython wave tools #320 (5fe6cfd, e39a8aa, d7b47f0, cecb099) adds proteus/BoundaryKinds.py (strong, weak, OPEN) read by FemTools.DOFBoundaryConditions, the flux base class, OneLevelTransport and TADR: a strong face is eliminated and gets no weak term; a Dirichlet callable under a weak class stays weak; an outflow face is a declared 'none'. Mixed-BC MMS (strong, weak and none on one domain): P2 L2 rates 2.97/2.98, P3 4.03/4.02; serial = 2 and 3 ranks to 1e-12. gf.D audit results and a RANS2P cut-cell test (the stock decks never reach the cut-cell code).
  • Adimako/wave tools/cython #321 (fe14ad0, fa41fd9, 2214519, d64388e, 6139bc3, 8214deb, af380ce, 0194dcb, 0fdaab3, 80746da) changes mprans/SedClosure.cpp (pybind pickling for HsuSedStress), mprans/BodyDynamics.py (default scheme, springs and constraints; inertia from the shape), TwoPhaseFlowProblem.py (end at final_time below dt_output; warnings for unattached auxiliary variables; clear errors for the 1.x constructor and parameter names), scripts/parun (a case given only with -f), mprans/SpatialTools.py (numpy integer flags), WaveTools.py (TimeSeries refuses the 1.x argument order) and RANS2P.py (warns that epsFact_solid is unused). Each was hit by an air-water-vv deck; measured before/after in each commit.
  • Doc update #322 (569aa58, 18d6b38, 4abd902, de6e438, feaf133) fixes defects the proteus-sandbox decks hit: a step retry re-applies the controller's cut step (FLCBDF repeated the failed step before); about 30 pdb.set_trace() stops removed from library code; 7 ctransportCoefficients wrappers passed an array element for the space dimension; cnumericalFlux .dim -> .ndim; accumulateExteriorElementPressureIntegrals restored; the Stokes/NS subgrid-error kernel chosen from the diffusion tensor's storage; two out-of-bounds writes found with valgrind; TwophaseStokes_LS_SO steady form; moving-domain wrappers; libode/pyode in environment-mpich-dev.yml. test/test_sandbox_port_fixes.py (27 tests); 260 of 502 runnable sandbox cases run (220 before).
  • reduced number of calls to flcbdfWrappers.globalSum/.globalMax #313 changes proteus/mprans/TADR.py (RKEV.initialize_dt) and the levee tests. With edge fluxes and no mass yet, the first dt is min(tOut - t0, floored CFL dt * M_min / 1e-14) from the flow's initial mass. With a 1000 s first output interval the plain interval made SSP33 blow up at t = 1000; this runs to 3000 s with 0 failed solves. The levee test's workaround and expected failure are gone.

The fifteen merge cleanly in the order listed (checked by the dry run). Several touch the same modules (FemTools.py: #317, #320, #322; Transport.py: #320, #322; NumericalFlux.py: #315, #320; TADR.py: #313, #320; Richards.py: #306, #310, #322), so the fork pull request for this train runs CI on the combination before this one is merged. 2.0 only; the 1.9.x counterparts of #306, #310 and #313 merged in #1367.

Diff against main: 139 files changed, 10249 insertions(+), 1401 deletions(-).

🤖 Generated with Claude Code

cekees and others added 30 commits November 17, 2026 08:15
proteus/__init__.py, setup.py and docs/Doxyfile (RELEASE.md, Versions) set outright to
2.0.0rc1 so that release.yml (#301) accepts the tag 2.0.0rc1: the tag must
equal the built version, and 2.0.0.dev is refused as a dev version.

Checked: the three files agree (git grep), 2.0.0rc1 is a PEP 440 pre-release and not a dev
version, so the TestPyPI job (not PyPI) runs for it. CI is the oracle for the sdist legs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ty (the source of the all-NaN Jacobian)

The levee test (test_levee_edge_flux_with_implicit_flow_fct) made an all-NaN Jacobian on the
fork CI runners and the fleet nightly. Traced by an instrumentation plugin on CI (draft
#304, run 44040001946, linux-64 py3.12, test run unconditionally, -s):

  * the flow model's history is stored at initialization with q['rho'] = rho_f = 1.0; the
    transport model's density rho_f (1 + eps c0) = 1.0125 is copied in by Coefficients.preStep
    at the first step, so m_last (0.0713..0.41) is stale by 5.125e-3 against m(u^0)
    (0.0722..0.4151) = mn;
  * the system dt of that step is 2.66e-14 (the transport's CFL), so the storage term
    (m - m_last)/dt is 1e11-2.5e11 per node and, in the saturated cells, no head can remove it:
    Richards Newton it 0 ||r|| = 1.33e13, the first step goes to |u|max = 1.9e14, the iterates
    then grow by 2 per Newton iteration (line search halves, the next step doubles back);
  * each failed attempt (13 halvings of dt, 2.66e-14 -> 4.2e-16) reaches |u|max 5e189, and
    LU.solve of a finite 13429 x 13429 matrix with b up to 1.5e188 returns 13364 NaN (SuperLU
    overflows in the factor: inf - inf), u becomes NaN, the next Jacobian has 92985 of 93017
    entries NaN. So the NaN is born in the linear solve of a diverged step; the cause is the
    stale first-step mass.

Fix: Coefficients.preStep at the first step (after the coupled density is copied) calls
LevelModel.refreshOldTimeMass, which evaluates the residual at u_dof_old and sets
m_last = m_tmp. Later steps are untouched (they carry the mass their previous step produced).
Lines: proteus/richards/Richards.py preStep (new `if firstStep:` block after the rho_nodal
copy) and the new method LevelModel.refreshOldTimeMass next to estimate_mt. No richards/*.h line.

Measured (levee deck, serial, first step, dt = 2.66e-14):
  before  first residual ||r|| 1.33e13 (CI, linux-64) / 2.8e9 (Mac); |u|max over the Newton
          history 1.9e14 -> 5.0e189 (CI), 1.1e114 (Mac); NaN Jacobian at dt 4.2e-16 (CI)
  after   first residual ||r|| 34.2 (flux terms only, Mac); |u|max <= 3e2 (Mac); no non-finite
          value (Mac). The step is still not accepted at any dt (separate defect, see handoff).
New test: test_first_step_old_time_mass_is_at_the_coupled_density (3 s; max|m(u^0) - m_last|
5.1e-3 before, 0 after; first residual < 1e3).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…y 1e30 as a failed solve

Second line of defence for the all-NaN Jacobian (first line: the stale first-step old-time mass,
previous commit), written with cekees's cross-territory yes (option A, relayed 2026-11-17).
NonlinearSolver.iterateDiverged (new) is called by Newton.solve after the line search: a
non-finite max|u| or ||r||, max|u| > 1e30 max(1, max|u0|) or ||r|| > 1e30 max(1, ||r0||)
sets linearSolverFailed, which failed() already reads, so the solve is reported failed, the
FCT predictor falls back / the step controller retries with a smaller dt, and the diverged
state is never handed to the linear solver. It only reads u and r; with par_u the answer is a
globalMax so every rank agrees. No StepControl/TimeIntegration/SplitOperator/ShockCapturing line.

Measured:
  levee test, refresh of the previous commit disabled (so the divergence still happens), Mac,
  serial: before the guard max|u| in the Newton history 1.1e114; with it 7e40 (the line-search
  evaluation that trips it), no non-finite value anywhere, 10 dt halvings as before;
  CI before (run 44040001946): 5e189 and an all-NaN Jacobian at dt 4.2e-16.
  Bit-identity of a well-behaved solve (guard called 1146 times, never fired): VOF and VOF3P
  STAB=1 (TwoStageNewton -> Newton.solve), vof_fct_partition_mpi.py, u.csv sha256 serial
  f935c6d5745aa4f2 and 2 ranks 3e565650ad8f2b6e, identical on main and on this branch.
  test/test_newton_divergence_guard.py: 11 passed (thresholds, NaN/Inf, tiny ||r0||).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… the first dt (levee deck first step)

Pytest plugin (from the closed diagnostic PR #304, plus): RICHARDS_ARGMAX=1 prints, at the last
residual of every Richards Newton solve, the node with the largest |r| (x, u, u_old, Dirichlet value, bc_mask, ML,
mn, eps*ML*mn/dt); DT0 lines show where the first dt comes from; RICHARDS_FIRST_DT forces it (experiment).

Measured on the levee deck (Mac, test_levee_edge_flux_with_implicit_flow_fct, base = cekees/main + #306):
- The flow model's Dirichlet condition is WEAK (forceStrongConditions False): there is no strong node to jump.
- First step, dt 2.66e-14 halving to 5.2e-17 (10 attempts, 20 Newton solves, all failed, 30 its each): the argmax
  node is never at or next to the boundary (0 of the nodes above half the max touch a Dirichlet face; max |r| at the
  Dirichlet nodes 5e-4, 1e-3 at dt 2.7e-14 .. 6.7e-15) and has u == u_old; ||r|| 4.6e-3 -> 0.51 doubles each
  time dt halves; |r_i| = 0.35..0.86 of eps*ML_i*m_i/dt (the round-off of the stored mass over dt) in every attempt.
- The 2.66e-14 is edge_based_cfl = 1.9e13 at the transport's first residual (M_low = M_dof = 0, flow not attached,
  Mnew floored at 1e-14 in TADR.h:2305) -> RKEV.choose_dt dt = 0.5/1.9e13.
- RICHARDS_FIRST_DT=1e-8: first step accepted in 3 Newton its (||r|| 2.6e-8), 208 Richards solves, none failed,
  t = 10 reached, test 35 s.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The hook wrote the traceback to stderr and called Abort(1) at once. MPICH's
hydra kills its proxies on abort and can exit before forwarding what the
ranks wrote: ceds-model nightly 2026-11-16, test_parun_abort
[parun] and [pro] failed with empty stderr, exit 1 (load average 31 then).

New runtime.drain_before_abort(): flush Python stdout/stderr, fflush(NULL)
for C stdio, sleep ABORT_DRAIN_SECONDS (0.2 s, the same wait as
partitioning.cpp's abortWith, cross-referenced; the C++ cannot call Python).

Measured on ceds-model (Linux, MPICH, 2 ranks, the two
test_each_driver_aborts... tests per repeat), failures per repeat:
  before: 0/60 at load ~4; 0/120 at 4 concurrent loops; 0/60 at load 15-25
          (24 niced spinners + 4 loops). NOT reproduced: the cause is
          inferred from the nightly's empty stderr, as in round 5.
  after : 0/60 at load 15-25 (same setup). test_parun_abort.py 14 passed.
Two new unit tests (drain precedes Abort; flush + wait).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…r the loop bound

getCSR sized rowptr by columnIndecesMap.size()+1 and read each row with columnIndecesMap[I-1]. When the
pattern has a row nobody inserted, operator[] inserts it and grows the map under the loop bound, so the loop
runs past size()+1 and rowptr[I] is written beyond its allocation (valgrind: Invalid write of size 4 at
sparsity.cpp:470); keys at or above the original size were dropped. Now nrows = largest key + 2, a missing row
is empty, and the loops walk the map with iterators.

New test/test_sparsity_getcsr.py (4 patterns, one with no hole, three with holes at the start, middle, several).
Measured (spark2 aarch64, dev_pip venv, OpenMPI 4.1.6, PETSc 3.25.4, valgrind 3.27.1):
  old code: 3 of 4 fail; valgrind reports 3 invalid reads/writes, at sparsity.cpp getCSR
  new code: 4 of 4 pass; valgrind 0 invalid reads/writes
  (Mac arm64 conda env: old 1 passed 3 failed, new 4 passed)
test_cube_mms two_ranks (6 cases, incl. [3-3-4-element-1]): 6 passed on spark2 with and without the change; the
unfixed code did not reproduce the nightly's hole in this environment (rows 856 and 1000 of 1000, none missing),
so the cause of the hole in the nightly's PETSc 3.26/MPICH prefix is not yet established.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ict xfail for the 2.66e-14 first dt

test_levee_edge_flux_with_implicit_flow_fct asserted only c = 0.5, which holds after zero accepted steps. It now
also asserts that the flow's last accepted step ended at the final time, that every one of the Richards Newton
solves converged (more than 20 of them) and that the head is finite and inside [-12, river stage 48] +- 1e-4.
To make that possible the test's transport uses an RKEV whose first dt is the deck's first output interval (1e-8)
instead of TADR's 2.66e-14 (edge_based_cfl 1.9e13 from M_low = 0); the dt itself is recorded by a new strict-xfail
test, test_first_dt_is_not_set_by_an_uninitialized_mass (dt must exceed eps/nl_atol_res = 2.2e-10; the deck's is
2.66e-14), which will flip when the dt is fixed.

Measured (Mac, conda-dev-mpich, 3 tests 37 s): with the override the levee test passes: tLast = 10.0, 208 Richards
Newton solves, 0 failed, head in [-12.0000018, 47.944]. Without it (override line removed) the same test FAILS:
flow tLast = 5.198e-17, tCount 1, all 20 Newton solves failed. The two other tests (first-step mass, first dt) as
described.

Correction to the previous commit's message: at the last solves (#16-#20) one node above half the max |r| is a node
touching a Dirichlet face (1 of 7-21 nodes), the other attempts none; the max |r| at the Dirichlet nodes is
5e-4 (dt 2.7e-14) up to 0.14 (dt 5e-17), the same round-off floor as everywhere else, not a boundary effect.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…every rank at once, pinned by a test

NN is nodes per direction, so NN=2 is one cell per direction (1 hexahedron in 3-D). On 2 ranks one rank
holds no element: its Jacobian is empty, Transport.initializeJacobian asserts nNonzerosInJacobian > 0 on that
rank only (before that, getCSR raised "Invalid shape in axis 0: 0" on the empty pattern), and the other rank
waits in a collective, so the run hung past 300 s (3-D, P=3, element partition, NLAYERS=1, 2 ranks).
The helper now checks (NN-1)**ND >= ranks first and exits 3 on every rank with a message.
New test_more_ranks_than_cells_stops_at_once_instead_of_hanging: exit status != 0 and the message, before the
guard the same launch ran to the 120 s timeout (spark2, dev_pip venv: hang past 90 s measured with timeout 124).
Measured: test_cube_mms.py 25 passed (spark2 aarch64, OpenMPI 4.1.6, PETSc 3.25.4) in 68 s.
The uncaught exception on one rank leaving the others in a collective is runtime.abort_on_uncaught_exception
(C32's file), not changed here.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ass? No (script + measurement, main and 1.9.x)

test/richards_first_step_mass_compare.py (diagnostic, run by hand): the levee deck on the explicit edge-flux
transport, c0 = 0.5, cin = 0.7 (coupled density 1.0125), implicit flow FCT, first dt = 1e-8, output times 1, 10, 30,
100, 365 d; with #306's refreshOldTimeMass and with it disabled.

Measured (Mac, conda-dev-mpich; main = this branch, 1.9.x = #307's head 97271c0, built as proteus-richards-r2-19x):
both trees give 511 accepted steps to t = 365, 0 failed Newton solves, 1022 Richards solves with the refresh and
1023 without; the head at t = 1e-8 differs by max|du| 1.1e-3 m (rel L2 1.3e-6, |u|max 46.8), at t = 2e-8 by 5.7e-10,
and at 1, 10, 30, 100, 365 d by 2.5e-12, 3.8e-13, 3.0e-12, 6.2e-13, 1.1e-12 (rel L2 <= 3e-15); the fluid mass
sum(m dV) differs by <= 1.8e-12 of 3.1e3 at every output time (3227.73079 at 365 d both ways); c(365 d) by 3e-14.
main and 1.9.x agree bit for bit (max|du| = 0 at every output time). So on a run that gets past its first step the
stale mass is one wrong first step (1.25 % of the stored mass over dt = 1e-8) that the second step undoes; it
leaves no trace. Its harm is only the dt = 2.7e-14 case (the NaN), which #306 fixes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…is 1 there, so a fix can key on it)

Measured (levee deck, Mac): at RKEV.choose_dt#1 _use_edge_flux = 1, edge_based_cfl max 1.8787e13, M_low = 0,
dt = 2.66137e-14. With a scratch change in RKEV.initialize_dt (first dt = tOut - t0 when _use_edge_flux; not
committed, TADR.py is not this round's file) the strict-xfail test_first_dt_is_not_set_by_an_uninitialized_mass
XPASSes and test_levee_edge_flux_with_implicit_flow_fct passes without the test-side override (37.9 s).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
abortWith waited 0.2 s before MPI_Abort (#290) but four other sites called
MPI_Abort directly (checkEveryEntityOwned, partitionNodes, partitionElements,
the vertex-file read in the subdomain builder), so a message written just
before them could be lost the same way under MPICH's hydra. New
abortAfterDrain(comm): flush cerr and C stdio, usleep 0.2 s, MPI_Abort;
abortWith (message line, then this) and the four sites use it.

Measured (ceds-model, Linux, MPICH, load average 81 from other users' jobs):
extensions rebuilt (build_ext --inplace -j 8, rc 0);
test/ci/test_meshPartitionCharacterisation.py + test/test_parun_abort.py,
PETSc -mat_partitioning_type current: 428 passed, 0 failed (331 s).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Notes for Claude Code sessions on a fresh Linux x86_64 machine, measured in a
Claude Code cloud container on main b9d98f5 (4 cores, 15 GB, root):

- Miniforge instead of micromamba (micro.mamba.pm is blocked by the proxy);
  environment-openmpi-dev.yml.
- `python setup.py build_ext -i` before the editable install: a plain
  `pip install -e .` took more than 30 minutes there.
- OpenMPI as root needs OMPI_ALLOW_RUN_AS_ROOT(_CONFIRM); oversubscription on
  small machines; the partition pin for multi-rank comparisons.
- With those settings, 7 test files/dirs (CompQuad, analyticalSolutions,
  boundaryconditions, adr_problem, cube_mms, bodydynamics, TADR) gave
  178 passed, 0 failed in about 2 minutes (pytest -n 4).
- xdist leaves test/gw0.. output; remove with test/gw[0-9]* (test/gwvd is
  tracked).

A scope line says the workspace CLAUDE.md on cekees's machines wins (no
`pip install -e` into the shared envs there), and a short section says where
pull requests go (cekees/proteus against dev; never proteustoolkit; merges,
not rebase).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… with no mass

RKEV.initialize_dt formed runCFL / max(edge_based_cfl) at the transport's initial
state, where the carried mass M_low is still 0 (the flow model hands it over in
Coefficients.preStep). TADR.h floors Mnew at 1e-14, so the CFL is (sum_gamma+B)/(ML 1e-14):
levee deck dt = 0.5/1.9e13 = 2.66e-14, no Newton solve of the flow can take it
(round-off floor eps m ML/dt = 5e-3..0.5 vs nl_atol_res 1e-6): 20 of 20 flow solves
failed, run ends at t = 5.3e-17.

Now, with _use_edge_flux and M_low = 0, the CFL of the real mass is the floored one times
1e-14/M, and M_min (smallest quadrature mass of the flow's initial state) bounds it for every dof:
first dt = min(tOut - t0, dt_floored M_min/1e-14). Later steps unchanged (choose_dt on the carried mass).
Plain (dt = tOut - t0) vs this, levee deck, c0 = 0, cin = 1, Mac conda-dev-mpich:
- first interval 1e-8 and 1e-3 s (SSP11, SSP33): identical to plain (the flow's dt is
  the smaller), 0 failed flow solves, flow reaches t = 10 (214/171 solves SSP11, 213/177 SSP33).
- first interval 1000 s: plain SSP33 dies at t = 1000 (c = -2.6e8 .. 9.5e7, 20 failed
  flow solves); this change: first dt 0.192 s (the dispersive CFL of the real mass), runs to 3000 s
  (SSP11 6323 / SSP33 7037 flow solves, 0 failed), c in [3e-30, 0.99982].
  The first step still overshoots (c max 4.5 after it: the flow's fluxes are 0 until it steps, so the
  advective CFL is not known at the first dt); the later steps are CFL-limited and the run recovers.
The explicit stage's first dt cannot be better informed than that; the plain interval is
not safe on a long first interval, so this variant.

Tests: test_levee_edge_flux_with_implicit_flow_fct runs with TADR.RKEV itself (the
test-local override removed): tLast 10, 208 solves, 0 failed; before, it failed without
the override (flow tLast 5.2e-17). test_first_dt_is_not_set_by_an_uninitialized_mass is no longer
xfail (strict xfail removed): passes. New test_first_dt_of_an_explicit_transport_respects_its_cfl
(SSP11, SSP33, 1000 s first interval): fails with the plain interval (dt = 1000), passes.
Mac serial: test/TADR, test/salinity, partition independence of TADR/VOF/NCLS (serial vs
2 ranks, FI_PROVIDER=tcp, -mat_partitioning_type current), hotstart state: 76 passed in 745 s.
2 ranks (mpiexec -n 2, ASM+LU for the flow): the levee tests above, 4 passed on both ranks (32 s).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…dof std::map)

The ghost penalty on the faces of the cut elements (Massing, Schott, Wall) was assembled by
accumulating [dW_i/dn] into a std::map keyed by global dof, per quadrature point, in the residual and again in the
Jacobian (plus three maps of (row, col) -> CSR position). It is the one form
r_i += c w [u] [v_i], J_ij += c w [v_i][v_j] of proteus/UnfittedKernels.h (ADR.h uses it): now the [dW_i/dn] of the two
elements go into a local array of 2 nDOF entries, jumpPenalty<2 nDOF> forms r and J, and they are scattered to the
global dof / CSR entry of each (side, i; side2, j). The maps are gone. Same in RANS2P.h (3D) and RANS2P2D.h (2D).

Identical to round-off. Ghost penalty needs useExact (otherwise no cut elements: the stock cylinder decks
never reach it, the penalty was untested), so test/cylinder2D/test_rans2p_ghost_penalty.py runs the immersed
cylinder decks (2D ball r = 0.12, 3D deck's own) with useExact on and pins the residual and Jacobian at one fixed state
(first residual call + fixed random perturbation of u) as norm, sum, weighted sum, from the OLD kernels:
- before vs after, same state, max abs entry difference: 2D Jacobian 8.9e-16 (entries up to 2.4), residual 2.2e-16 (up to 1.0);
  3D Jacobian 3.1e-15 (2.7), residual 5.6e-16 (0.68). The three checksums agree to 1e-15 relative (3D residual sum
  -0.04181976366686011 vs -0.0418197636668594, 3e-14 relative of a small sum).
- the penalty is exercised: constant 0.1 -> 0 changes the Jacobian by 1.4 (2D) and 2.7 (3D), the residual by 0.67 / 0.68.
- not within 1e-13 once the Newton iteration runs on: the 2D run (4 steps, 514 residual calls, penalty constant 1000 on
  the particle) amplifies the round-off: relative residual difference 4e-14 at the first call it is nonzero,
  1e-11 by call 20, 4e-9 by call 26-38; the Jacobians 8e-16 to 5e-12. It is the same Newton path on a different last bit.
The stock decks (ghost penalty not reached): test/cylinder2D 9 passed (serial, Mac, the old comparison files unchanged).
Not run on 2 ranks (the penalty has no rank-specific code; the cut faces are in the owned-ghost pattern as before).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…f 2.5 p**2

Round 12 scaled the Nitsche penalty by p**2 on C0 spaces and left the discontinuous ones unmeasured. Measured now
on -div(grad u) = f (the weak_dirichlet_mms_mpi.py problem, h = 1/8, 1/16), DG monomial P2..P6 with
Advection_DiagonalUpwind_Diffusion_SIPG (interior faces and the weak boundary, serial, Mac):
- the smallest penalty constant that holds the optimal rates grows like p**2: about 10, 10-30, 30, 100, 100 for p = 2..6
  (about 2.5 p**2, the same threshold as the C0 spaces: 10, 20, 40);
- below it the error blows up on coarse meshes: p = 2 with constant 3: L2 0.41 (1.1e-3 with 10); p = 4 with 10 (the exterior
  classes' constant): 2.0e-4 vs 5.6e-6 with 1000 (36x), p = 5 with 10: 2.0e-6 vs 2.6e-7 (7.8x);
- the interior classes' own constant (100) is above 2.5 p**2 for every monomial degree (p <= 6): DG P3/P4/P6 at 100 give
  L2 5.979e-6 / 1.688e-7 / 7.188e-11 (h = 1/16) before and after, to all printed digits.
So the rule for a discontinuous space is a FLOOR: penaltyOrderFactor returns max(C0 factor, 2.5 p**2/penalty_constant) when the
constant is below it (p > 2 only); constant 10 at p = 3, 4, 5 gets 2.25, 4, 6.25. Measured with the floor (constant 10, h = 1/8):
P3 L2 8.5e-5 (1.6e-4 without), P4 4.8e-6 (2.0e-4), P5 2.3e-7 (2.0e-6), the large-penalty (1000) values 1.0e-4, 5.6e-6, 2.6e-7:
within 1.2x of them. Rates (default constant, h = 1/8 -> 1/16): P3 L2 4.4, H1 3.4. 2 ranks (element partition, 1 layer) = serial
to 4e-13 relative (P3 L2 8.527076157186e-5 vs ...190e-5). weak_dirichlet_mms_mpi.py takes DG=1 (FLUX=dgsipg) and evaluates the
error from the model's quadrature values (the monomial basis has no tabulate).
Tests: test_weak_dirichlet_mms.py 18 passed in 25 s (8 new/changed: DG rates P3/P4, floor vs no floor P4/P5, 2 ranks P3/P4, the
factor table). test/levelset (the DG P3 vof decks), test_space_interface: 170 passed in 111 s, nothing moved.
Not measured: DG weak Dirichlet with advection (upwind terms do not enter the penalty), cubes, 3D DG.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…7.8x, not 42x and 8.7x)

Docstring only; the assertions (10x and 5x) are unchanged and passed in the previous commit (18 passed).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e ball; use r = 0.08 (linux-64 failure of [3d])

CI linux-64 (run 44138808011): [3d] failed, residual stats 2.37708 / -0.0418198 / 211.929 vs the Mac-pinned
2.37900 / -0.0418198 / 211.692 (relative 1.1e-3 in the norm; the sum agrees). [2d] passed with the Mac pins
(rtol 1e-12). Cause, not the refactor: the 3D deck's mesh (meshCylinder.node) has 40 nodes at distance exactly 0.0 from
the ball of radius 0.05 (min |d - 0.05| = 0.0), so which elements are cut (phi_s <= 0 on a face's nodes, useExact) is
decided by the last bit, which differs between platforms. The Jacobian was never reached (the residual assert is first).
Fix: the 3D case uses r = 0.08 (min node distance to the surface 2.6e-3; 2D at 0.12: 9.0e-3), and the test asserts a margin
> 1e-3. Re-pinned from the OLD kernels (b9d98f5, the std::map assembly) at this radius, residual then Jacobian
(2-norm, sum, weighted sum):
- residual 1.23781106813492 / -0.04057353778230391 / 30.157917770112114; Jacobian 18.256164034910746 / 296.47672330919784 / 2256185.437234731;
- refactored kernels, same state: norm and the Jacobian identical to all printed digits, residual sum -0.040573537782304034 (1.4e-16
  absolute), weighted sum 30.157917770112313 (2e-13 absolute, 7e-15 relative): round-off. 2D unchanged (pins as before).
Mac: test/cylinder2D 9 passed. The Linux result is for CI to show.
The other red thing in that job is not new and not PUMI: the "Fatal Python error: Segmentation fault" with the frame
00000-19999 lines is the captured output of test_launch_output's deliberate crash (test_a_crash_keeps_its_whole_output,
os.kill(SIGSEGV)); test/MeshAdaptPUMI/test_poiseuilleError.py PASSED in that run; 4576 passed, 1 failed (this test).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ound 5 words)

Org ymf main (5ad375b, round 5) requires `method` in a stabilization block and names its keys `lagged`, `beta`,
`reference`, `tau`. The dispatcher read the raw block, so it silently dropped those words, and the RDLS fixture
(shock capturing without a method) no longer loaded.

- Dispatch._stabilization resolves the sub-problem's block (or the entry's default) with ymf and folds the older
  spellings (`lag`, `sc_beta`, `sc_uref`) as ymf does; `lagged` -> subgridError.lag, shock_capturing
  `factor`/`lagged`/`beta`/`reference` -> shockCapturingFactor, shockCapturing.lag, sc_beta, sc_uref; `tau`
  metric/element_size -> useMetrics 1/0; an explicit `shock_capturing: none` -> factor 0. A block ymf refuses is a
  DispatchError naming the sub-problem.
- dambreak.ymf states ymf's words (as dambreak_formulation.ymf does); RDLS says `method: SUPG`.

Measured (macOS arm64, ymf 5ad375b): test/dispatch on b9d98f5: 4+ errors at fixture load, after: 85 passed (83 +
2 new: ymf words and the older spellings dispatch to the same cells and reach the numerics; a block without a method is
refused); the bitwise runs of test_dispatch_run.py (all cases, serial and 2 ranks) unchanged. test_pro_cli,
test_adr_problem, test_domain_ymf: 178 passed, 19 skipped, 1 failed (test_iproteus_is_a_shim_over_runtime,
environment: not touched).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…OnSimplex)

BDM2 (all of P2^d) and RT1 (P1^d + x P1~) join RT0 and BDM1 as FemTools H(div)
spaces on triangles and tetrahedra.

Dofs. Face dofs are flux densities N_f . v at the nodes of the face's degree-1
(RT1) or degree-2 (BDM2: vertices, edge midpoints) Lagrange lattice; the node's
multi-index is permuted by the face's global vertex order, so one rule gives the
orientation of the dofs of a face on every rank (BDM1 is the case k = 1).
Interior dofs (RT1: 2/3 in 2D/3D, mean of v.e_i; BDM2: 3/6, mean of v.w for the
Nedelec fields w) are element owned, in the element's reference frame; they get a
closed-form block after the face block of each rank ([owned faces | owned elements
| ghost faces | ghost elements] on the subdomain). The basis is the dual basis of a
monomial generating set (cond of the dof matrix 60/420 in 2D, 80/850 in 3D for
rt1/bdm2); it reproduces the closed forms of RT0/BDM1 to 1e-16.

Measured (Mac arm64, conda-dev-unpinned MPICH, FI_PROVIDER=tcp,
PETSC_OPTIONS="-mat_partitioning_type current"):
- oracle: sympy, exact rational dof-matrix inverse and exact integrals, values,
  divergences, face fluxes: 1e-12 (tri and tet, rt1 and bdm2); rt0/bdm1 tables
  byte-identical to round 5.
- normal component continuous across every face: jump 4e-14 (rt1 tri), 1.5e-13
  (bdm2 tri), 2e-13 (rt1/bdm2 tet); negative control (no sign/order rule) 14-44;
  tangential component jumps (H(div), not H1); also with element vertex orders
  scrambled per rank.
- serial = 2 ranks, node and element partitioning, 1 layer: same dofs at the same
  points, values equal to 8e-17 (tri) and 4e-17 (tet) including the interior dofs;
  global dof counts rt1/bdm2 tri 322/483, tet 1620/3240 = nFaces*dpf + nElements*dpc.
- interpolation rates (6x5 -> 12x10 triangles; 3^3 -> 6^3 tets), L2 / divergence:
  tri rt1 2.00/0.99, bdm2 2.995/2.00; tet rt1 1.95/0.93, bdm2 2.97/1.97
  (rt0 1.00/1.00, bdm1 1.99/1.00 unchanged). RT1's divergence converges at 1,
  not the best-approximation rate 2, because face dofs are point values: only
  moment dofs commute with the divergence.
- L2 projection onto the space (global solve, serial): L2 tri rt1 1.99,
  bdm2 2.92; tet rt1 1.95, bdm2 2.90; divergence tri bdm2 2.01, tet 1.97.

API: HdivSpace.tabulate(...).grads is now (nQ, dim) for every family
(was (dim,), constant); HdivSpace.divergence stays for rt0/bdm1;
Hdiv_AffineOnSimplex.interpolate(f) handles the interior dofs (returnDefect=True
for the old triple), divergence/getBasisDivergences take reference points;
dofsFromElementValues refuses spaces with interior dofs. Not touched:
DOFBoundaryConditions, PostProcessingTools.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… not made

Both realizers refused a file domain ("builds a box domain"). A file domain with bounds now realizes as the decks
realize a stored mesh (genMesh = False, polyfile = the prefix of <prefix>.node/.ele):

- tank_sides: a region named by the mesh's tags (`tags: [bottom, right, left]` -> `flags`) claims the sides whose
  Tank2D flag (y- 1, x+ 2, y+ 3, x- 4) it lists; position regions work as before.
- _tank / shallow_water: read the file, refuse a missing one, a format other than tetgen, a non-box realization
  (levels > 1, h, cells); the run record says `mesh: stored <prefix>`.
- stored_element_size: a mesh that is already made has no h (ymf refuses one); its element size, which TwoPhaseFlow
  reads for tolerances (nl_atol_res = c he^2) and for the regularization width, is the mesh's longest edge (what
  Proteus's mesh.h is).
- shallow_water_boundary: tags must cover every boundary tag of the mesh (one treatment on the whole boundary).

Measured, each against the app it replaces, on 1 and 2 ranks (partition pinned), every dataset of the archive
bitwise equal (field moves > 0.1):
- damBreakLevelSet.py genMesh=False he=<longest edge of meshDambreak / 3.22> (the stored 109-node mesh of
  test/TwoPhaseFlow) vs dambreak_short_stored.ymf: 0 of the deck's datasets differ, 1 and 2 ranks. Before: refused.
- dam3Bumps.py (final_time 0.5, he 2) vs dam3bumps_stored.ymf reading the deck's own dam3bumps.node/.ele: 0 differ,
  1 and 2 ranks. Before: refused.
test/dispatch: 92 passed (85 + 4 deck comparisons + 3 data-only tests: sides from tags, genMesh off and polyfile,
refusals). ymf finding for the handoff: split_problem on a file domain without bounds raises KeyError: 0 (the domain
dict is parsed as notation); bounds are required here.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…p-copy

MultilevelTransport.initialize applies copy.deepcopy to every model's
coefficients. The pybind11 class HsuSedStress had no pickle support, so a
Kappa or Dissipation coefficients object that holds closure=HsuSedStress(...)
failed at model allocation:

  TypeError: cannot pickle 'proteus.mprans.SedClosure.HsuSedStress' object

It is a parameter holder: py::pickle by its seventeen constructor arguments.

Measured (ceds-model, proteus b9d98f5, py3.12):
  before: copy.deepcopy(HsuSedStress(...)) -> TypeError (reproduced)
  after:  deepcopy and pickle round trips keep all 17 parameters and
          betaCoeff; copy.deepcopy(Kappa.Coefficients(closure=...)) works
          (test_sedclosure.py::testPickleAndDeepcopy, testKappaCoefficientsDeepcopy;
          the full file passes)
  air-water-vv 2d/sediment/sediment_erosion at its default useRANS=1,
  refinement=10 duration=0.02 (1 rank): before: TypeError at model
  allocation; after: allocation passes and the run reaches the first flow
  solve, where it stops in WallFunctions (a separate defect: the wall-function
  boundary condition is evaluated by a model it was never attached to).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nertia reads the shape's coords_system

A body that never called setNumericalScheme / setSprings / setConstraints
failed at its first step (AttributeError 'scheme', then 'Kx', then 'free_x').
getInertia's 3D branch (RigidBody and CaissonBody) read self.coords_system,
which only the shape has, so every 3D rotation failed (the test masked it by
assigning c3d.coords_system). setRecordValues(filename=None) and the 'No
inertia tensor' assertion read self.name, which only the shape has.
Runge_Kutta integrates the rotation about z only, so a free roll or pitch in
3D never moved, silently. setInertiaTensor's docstring said the tensor must
not be scaled by the mass but getInertia multiplies by it: it is per unit
mass, as in 1.x.

Defaults: Forward_Euler, springs off (K and C zero), free_x = free_r = ones.
getInertia and the record file name use self.Shape. Runge_Kutta with nd == 3
and a free rotation about x or y raises NotImplementedError naming the fix
(Forward_Euler); a 3D body free only about z still runs.

Measured (ceds-model, proteus b9d98f5): test_bodydynamics.py 18 passed after;
before, the four tests that exercise this (testGetInertia with the
coords_system assignment removed, testDefaultSchemeSpringsConstraints,
testRungeKuttaRefusesFreeRollIn3D, testRecordFilenameFromShape) fail with
AttributeError 'scheme' / 'coords_system' / 'name' or no error at all.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…FMap, Hdiv_AffineOnCube)

H(div) on cubes, lowest order: RT_[0], component a linear in x_a and constant
in the others, one flux dof per face, on the reference square/cube [-1,1]^d.
phi_f = s (1 + s x_a) / 2 / 2^(d-1) e_a (s = side of the face), divergence 2^-d,
dof sigma_f(v) = N_f . v(face centre). Piola map as on simplices (|det J|).

FemTools: HdivOnCube (local space), CubeFaceDOFMap (same rules and the same
closed-form owned-face numbering as FaceDOFMap, which now shares its layout code
through _layout; sign of a face = global normal from the face's vertices sorted by
global number against the element's outward normal), Hdiv_AffineOnCube (same
interface as Hdiv_AffineOnSimplex), cubeElementJacobians. Elements must be
parallelograms / parallelepipeds (AffineMaps, as the Q_p spaces of round 4); a
general multilinear element raises ValueError (tested). Left for a later round:
multilinear geometry (Piola with J(xi), flux dofs by face quadrature).

Measured (Mac arm64, conda-dev-unpinned MPICH, FI_PROVIDER=tcp,
PETSC_OPTIONS="-mat_partitioning_type current"), sheared grids (affine image of
the rectangular grid, so J is a full matrix); 7x6 nodes quad, 4^3 nodes hex:
- normal component continuous across every face: 1.2e-14 (quad), 2.2e-14 (hex);
  negative control without the sign rule 13-44; tangential component jumps
  (3.8 quad, 14 hex); also with a random symmetry of the cube applied to every
  element's vertex listing, per rank (44e-15 hex).
- a field of the space (A w(A^-1 x)/|det A| with w = a + b.x Cartesian) is
  interpolated exactly: 1e-15, divergence 1e-14, element fluxes = integral of div.
- serial = 2 ranks, node and element partitioning, 1 layer: same dofs at the same
  points (2e-16), same values (2e-16); global dof counts 71 (quad), 108 (hex)
  = number of faces; the partition has faces whose vertices sort differently by
  local and global number on some rank (>0 asserted).
- interpolation rates, mesh halved: L2 1.00 (quad), 1.01 (hex); divergence 1.00,
  0.98; L2 projection 0.99, 0.99.
Unit tests: duality, normal traces, divergence, Piola (both orientations), the
affine check.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ymf round 5 states the dispersive model by hyperbolic relaxation (`dispersion: {closure, closes, auxiliaries}`);
Dispatch already mapped it to GN_SW2DCV but nothing realized the family. Now:

- DispatchTable: SHALLOW_WATER_MODELS has GN_SW2DCV (sw_model 1, GN_sw_p/GN_sw_n); REALIZERS maps
  dispersive_shallow_water to the shallow-water realizer; SHALLOW_WATER_AUXILIARIES names the three auxiliaries by
  role (relaxed_depth -> h_times_eta, relaxed_divergence -> h_times_w, relaxed_bed_flux -> h_times_beta).
- DispatchRun.shallow_water: the auxiliaries' initial values come from the spec's `dispersion.auxiliaries[].initial`
  (the roles' defaults h^2, 0, 0, an expression of the depth's initial value, evaluated by sympy at each point);
  boundary data are the whole-boundary wall or open treatment the walls already had (no Dirichlet data: the decks'
  reflecting case). Refused: an auxiliary initial that reads anything but the depth, x, y, t.
- test/dispatch gets ymf's dispersive fixtures (dispersive, dispersive_numerics, circular_dam_dispersive; `linear_solver:
  petsc` dropped as in proteus_numerics: the n module's solve is not the spec's to choose) and a two-second variant.

Measured, circular_damBreak.py -C "sw_model=1 final_time=2.0 dt_output=0.4" (structured, 50 x 50 nodes) against
circular_dam_dispersive_short.ymf (mesh.cells 49): every dataset of the archive bitwise equal (field moves > 0.1), on
1 and 2 ranks (partition pinned). Before: refused ("nothing realizes family dispersive_shallow_water yet").
test/dispatch: 95 passed (92 + the two ranks + 1 test of the auxiliary's initial value: h^2, 0, h x, and a symbol it
may not read refused).
Not covered: santos_step.py (waits on `atan` in ymf's notation) and conical_island.py (a state imposed on part of the
boundary).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…w dt_output/2; nDTout-only decks run

setOutputStepping computed nDTout = int(round(final_time/dt_output)), which is
0 when final_time < dt_output/2. tnList was then [0, dt_init]: the run took one
step, stopped at t = dt_init, and reported normal completion with no warning.
The assertion that should catch a missing dt_output/nDTout read the undefined
name nDTout (NameError instead of the message), and min(self.dt_output, ...)
raised TypeError for a deck that sets only nDTout.

nDTout is at least 1 (with a log line saying so), dt_init is also bounded by
final_time, and the assertion reads self.nDTout; dt_output is derived from
nDTout before dt_init is chosen. The tnList construction moves, unchanged, to
OutputStepping.buildTnList so it can be tested.

Measured (ceds-model, proteus b9d98f5, air-water-vv 2d/benchmarks/wavesloshing
-C "T=0.02 he=0.004", dt_output = 0.05, 1 rank):
  before: last Step Taken at t = 1.0e-3, exit status 0 (the run 'completed')
  after:  last Step Taken at t = 2.0e-2 = T
test_twophaseflow_outputstepping.py: 5 passed after, 5 failed before.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
….ElementTables)

python -m proteus.ElementTables --cell triangle --family lagrange --order 3
--nodes gll --degree 8 writes a C++17 header with one struct of static constexpr
data per configuration, in the shape of the engine's Space (experimental/adrh/
spaces.h: nS, nDOF, nVertices, nFaces, nFaceVertices, vertices first): the element
rule (qPoint, qWeight) with phi, dphi and d2phi at its points; the face rule
(eta, weights), the face points in reference coordinates, phiFace and dphiFace
on every face; nRef (n dS = |det J| J^-T n_ref d(eta)), faceVertex, faceDOF (the
dofs on each face), dofPoint, the entity of each dof (dofEntityDim/Index) and the
multi-index. Interval, triangle, tetrahedron (Lagrange and Bernstein, equispaced
or GLL/warp-blend, any order the space supports, rule degree up to 20) and
quadrilateral/hexahedron (Q_p, GLL). Conventions are the engine's (face k opposite
vertex k, eta on the standard reference simplex, cube faces k = 2 I + side on
[-1,1]^(nS-1)), not proteus's boundaryMapList; faceProteus maps cube faces back.
experimental/adrh is read, not edited: the hand-off is in the C8 round 7 handoff.

Measured (Mac arm64, Apple clang, -std=c++17 -Wall -Werror):
- 8 configurations compile as constexpr; a program that prints the tables gives
  numpy's values bit for bit (qPoint, qWeight, phi, dphi, d2phi, fqPoint,
  fqWeight, fxi, phiFace, dphiFace, nRef, dofPoint).
- against experimental/adrh/spaces.h (P1, P2 on triangle and tetrahedron, Q1 on
  quadrilateral and hexahedron, degree-6 rule): basis values and gradients at the
  element and face points, faceToReference, referenceNormal and faceVertex agree
  to < 1e-13 (asserted), template shapes equal by static_assert.
- numbers: partition of unity 1e-13, zero gradient/Hessian sums, monomials exact
  to the rule's degree, a basis function vanishes on the faces it is not on, the
  reference divergence theorem with n_ref and the face weights to 1e-12.
- sizes (with / without Hessians): P2 triangle degree 4 10 / 8 kB; P3 triangle
  degree 8 43 / 25 kB; P2 tet degree 4 42 / 29 kB; P3 tet degree 8 393 / 196 kB;
  Q2 quad degree 4 24 / 15 kB; Q2 hex degree 4 339 / 181 kB.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…died with IndexError)

The air-water-vv READMEs and older docs run
mpiexec -n 2 parun -f dambreak.py --TwoPhaseFlow. The log opening already
handled an empty args with -f, but the --TwoPhaseFlow branch (and the SWEs
branch) read the case from args[0]: IndexError on every rank. When there is no
positional case, -f's file name is the case. 'No input file specified' now
also fires for --TwoPhaseFlow without a case, and says the three forms.

Measured (ceds-model, proteus b9d98f5, test_parun_case_argument.py with a
case that raises a marker error on import):
  before: parun -f case.py --TwoPhaseFlow -> IndexError: list index out of
          range (2 of 5 tests fail, plus the -f order variant)
  after:  the case is imported for case.py, -f case.py and --TwoPhaseFlow -f
          case.py (5 passed)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…CouplingFSI nodeStar index type

First real build against a PETSc with --with-64-bit-indices (3.26.1, spark2, scratch prefix, removed at round end)
with PROTEUS_CSR_INDEX_BITS=64 and proteus_index_t=int64 stopped on:
- MeshAdaptPUMI/ErrorResidualMethod.cpp: idx/idxr/idxc/ez_idx/F_idx handed to MatSetValues/VecSetValues/VecGetValues
  were int arrays -> PetscInt (5 errors).
- partitioning.cpp: ISPartitioningCount wrote into valarray<int> -> PetscInt buffer then copied (1 error).
mbd/CouplingFSI.pyx: pyxGetLocalNearestNode nodeStarOffsets/nodeStarArray/node/nearest_node were int, now
proteus_index_t; nearest_node_array/containing_element_array use the index dtype. Both configs build (41 s incremental).
MeshConverter.cpp: clang -fsyntax-only against the macOS scorec 4.2.1 is clean at index 32/64 x csr 32/64 (no change needed).
Suites 32 vs 64 csr follow in the next commit message.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ones accept a numpy integer flag

The three setters tested isinstance(flags, int) to decide between one flag and
a list. A flag taken from shape.regionFlags[i] is numpy.int64, so the code
then iterated over it: TypeError: 'numpy.int64' object is not iterable. Test
numbers.Integral instead (and store a plain int).

Measured (ceds-model, proteus b9d98f5): test_zones_accept_numpy_integer_flags
passes for np.int32, np.int64 and an element of an int array for the
absorption and porous setters; before, the first numpy flag raised the
TypeError above (the air-water-vv decks wrapped the flag in int()).
test_spatialtools.py: 58 passed with test_wavetools.py.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
cekees and others added 28 commits November 18, 2026 09:32
…f 0.3.0

Since ymf 0.3.0 (proteustoolkit/ymf#31) is on ymf main, CI installs it and
main's test/dispatch fixtures no longer validate (stabilization.method is
required; lag/sc_uref/sc_beta are renamed), so linux-64 and coverage on
#321 failed in test/dispatch only. #316 (f9c3d4d) updates the fixtures and
is green on all 12 legs. Merged, not cherry-picked, so the commits keep
their hashes and drop out once #316 lands on main; this lets #321 ride the
same main train as #316 (cekees, 2026-11-18).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fixtures fail ymf 0.3.0

The CI failures on #322 (38 errors + 8 failures in test_dispatch.py, 2 in
test_dispatch_run.py, coverage after them) are main's dispatch fixtures
against ymf 0.3.0 (proteustoolkit/ymf#31, on ymf main 2026-11-17): a
stabilization block now needs a method, so RDLS's shock-capturing-only block
no longer loads. #316 (f9c3d4d) updates the fixtures and is green on all 12
legs with ymf 0.3.0. Merged, not cherry-picked, so the commits keep their
hashes and drop out once #316 lands on main; this lets #322 ride the same
main train (cekees, 2026-11-18).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two more found reconstructing the sandbox's missing Stokes/level-set decks.

- evaluate passed c[('m',ci)] to the kernels unconditionally; steady=True
  leaves the mass terms out (KeyError). Scratch arrays are passed then.
- When the level set model has no values at the flow model's points (another
  quadrature, mass lumping, which adds nodal points, or no element boundary
  values), the kernel was handed None or a shorter array (SIGSEGV). It now
  raises, naming the causes.

Tests: two more in test/test_sandbox_port_fixes.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsNEVP5iqW8j2B7hKt9ibb
From unblocking the sandbox's moving-cylinder deck (threep_cylinder_md_2d_so).

- environment-openmpi-dev.yml: libode/pyode 0.16.6 (conda-forge), the Open
  Dynamics Engine and its Python bindings (`import ode`), for decks whose
  rigid-body motion predates pychrono.
- cfemIntegrals: restore three wrappers lost in the move to Cython, whose
  callers in FemTools, Transport and TransportCoefficients remained:
  parametricMaps_getJacobianValuesTrace_movingDomain (the 2d moving-domain
  kernel was still in femIntegrals.c, undeclared; 1d/3d use the fixed-domain
  ones, as before), copyLeftElementBoundaryInfo_movingDomain (likewise) and
  update_df_movingDomain (the update_f kernels with dm, as before).

Other cfemIntegrals names Python still calls with no wrapper (not on a path
the sandbox reaches): setInflowFlux, updateExteriorElementBoundaryStressFlux,
calculateVelocityVolumeAverage2D/3D, calculateVelocityQuadrature_MixedForm2
(and _Jacobian), writeDOF, writeDOF_ZEROS.

Tests: two more in test/test_sandbox_port_fixes.py (31).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsNEVP5iqW8j2B7hKt9ibb
The Open Dynamics Engine and its bindings (`import ode`) for the rigid-body
decks; libode has no MPI dependency, so the same 0.16.6 pins apply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsNEVP5iqW8j2B7hKt9ibb
… and 0.3.1

ymf 0.3.1 reads a `stabilization:` block without `method` as `method: none`, so Dispatch no longer gets ymf's "say the
method" error: the VOF cell offers SUPG only, and the refusal is "no Proteus module covers vof (... stabilization none)
... the cell has SUPG". The test now accepts either refusal for a block without a method (0.3.0: method; 0.3.1: the cell
has SUPG) and keeps the other half, a key the method does not read (`{method: SUPG, no_such_key}`), which both refuse the
same way. No other dispatch test depended on the 0.3.0 wording.

Measured, test/dispatch, macOS arm64: ymf 0.3.0 (5ad375b): 106 passed; ymf 0.3.1 (org main 6868e7c): 106 passed. Before
the change, ymf 0.3.1: 105 passed, 1 failed (this test).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ymf 0.3.1

ymf 0.3.1 (proteustoolkit/ymf#32) reads a stabilization block without a
method as method none, so test_stabilization_without_a_method_..._is_refused
failed on #315's linux-64 py3.13 leg (it expected 'method' in the refusal;
the cell now refuses 'none'). #316's d04b966 accepts either refusal;
test/dispatch passes 106 under ymf 0.3.0 and 0.3.1. Merged, not
cherry-picked, so #315 stays in the same main train as #316.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mf 0.3.1

ymf 0.3.1 (proteustoolkit/ymf#32) reads a stabilization block without a
method as method none, so test_stabilization_without_a_method_..._is_refused
failed on #315's linux-64 py3.13 leg (it expected 'method' in the refusal;
the cell now refuses 'none'). #316's d04b966 accepts either refusal;
test/dispatch passes 106 under ymf 0.3.0 and 0.3.1. Merged, not
cherry-picked, so #317 stays in the same main train as #316.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r ymf 0.3.1

ymf 0.3.1 (proteustoolkit/ymf#32) reads a stabilization block without a
method as method none, so test_stabilization_without_a_method_..._is_refused
failed on #315's linux-64 py3.13 leg (it expected 'method' in the refusal;
the cell now refuses 'none'). #316's d04b966 accepts either refusal;
test/dispatch passes 106 under ymf 0.3.0 and 0.3.1. Merged, not
cherry-picked, so #318 stays in the same main train as #316.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…der ymf 0.3.1

ymf 0.3.1 (proteustoolkit/ymf#32) reads a stabilization block without a
method as method none, so test_stabilization_without_a_method_..._is_refused
failed on #315's linux-64 py3.13 leg (it expected 'method' in the refusal;
the cell now refuses 'none'). #316's d04b966 accepts either refusal;
test/dispatch passes 106 under ymf 0.3.0 and 0.3.1. Merged, not
cherry-picked, so #319 stays in the same main train as #316.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ymf 0.3.1

ymf 0.3.1 (proteustoolkit/ymf#32) reads a stabilization block without a
method as method none, so test_stabilization_without_a_method_..._is_refused
failed on #315's linux-64 py3.13 leg (it expected 'method' in the refusal;
the cell now refuses 'none'). #316's d04b966 accepts either refusal;
test/dispatch passes 106 under ymf 0.3.0 and 0.3.1. Merged, not
cherry-picked, so #320 stays in the same main train as #316.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f 0.3.1

ymf 0.3.1 (proteustoolkit/ymf#32) reads a stabilization block without a
method as method none, so test_stabilization_without_a_method_..._is_refused
failed on #315's linux-64 py3.13 leg (it expected 'method' in the refusal;
the cell now refuses 'none'). #316's d04b966 accepts either refusal;
test/dispatch passes 106 under ymf 0.3.0 and 0.3.1. Merged, not
cherry-picked, so #321 stays in the same main train as #316.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st holds under ymf 0.3.1

ymf 0.3.1 (proteustoolkit/ymf#32) reads a stabilization block without a
method as method none, so test_stabilization_without_a_method_..._is_refused
failed on #315's linux-64 py3.13 leg (it expected 'method' in the refusal;
the cell now refuses 'none'). #316's d04b966 accepts either refusal;
test/dispatch passes 106 under ymf 0.3.0 and 0.3.1. Merged, not
cherry-picked, so #322 stays in the same main train as #316.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ate for TestPyPI)

From cekees/rc-2.0.0rc1 at 5c12bfd (#303).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oupled density (all-NaN Jacobian of the implicit-FCT levee test)

From cekees/richards-nan-fix at ad7d4bc (#306).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…caught_exception

From cekees/c32-r6 at f996ae5 (#308).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n with a missing row

From cekees/c8-r6 at 1db4465 (#309).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From cekees/claude-md-cloud at 6bb6e08 (#312).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… per axis, 3D tanks, gauges through dispatch

From cekees/c5-s4p3 at d04b966 (#316).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… dt 2.7e-14), non-vacuous levee test

From cekees/richards-r2 at ce63315 (#310).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ak Dirichlet DG P3+, per-face strong/weak/none

From cekees/c0-r13 at fc1047a (#315).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…les for C19

From cekees/c8-r7 at 0405deb (#317).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dex type

From cekees/c33-tail at 43c83eb (#318).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ngine slots, RDLS and MCorr functors

From cekees/c19-slices at 55875d9 (#319).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (C12), gf.D audit, cut-cell RANS2P test

From cekees/c0-r14 at 23557c6 (#320).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (HsuSedStress, BodyDynamics, OutputStepping, parun -f, warnings)

From cekees/awvv at fa526fc (#321).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From cekees/fix/sandbox-port-bugs at 2f94a76 (#322).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…L of a state with no mass (stacks on #310)

From cekees/tadr-first-dt at e10830d (#313).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cekees
cekees merged commit d22a869 into proteustoolkit:main Nov 18, 2026
13 checks passed
@cekees
cekees deleted the train/main-2026-11-18 branch November 18, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants