Repository navigation
ymf: stabilization, lagging, boundary kind, porosity, dispersive family and cells per axis (C42 round 5) - #31
Merged
Merged
Conversation
…r read (C42 round 5, 1/5)
A sub-problem (or its split discretization's entry, as the default of its
sub-problems) now states `stabilization` as a method word or a block:
method, tau (metric | element_size), lagged (the subgrid error from the
previous step) and shock_capturing {factor, beta, reference, lagged} or
`none`. The keys proteus's Dispatch already reads (lag, sc_beta, sc_uref)
are aliases of ymf's words (lagged, beta, reference), as round 3 did for
vbdf and mannings. Nothing is defaulted: an unstated key is the solver's
own default, and `ymf.stabilization.missing()` lists what a reader that
must not guess (the generator) still needs.
What the generator can now express: VOF and NCLS (proteus#298) took
`STAB = {SUPG, tau metric, shock_capturing lagged}` from a declaration in
make_inputs.py because dambreak.ymf stated none; dambreak_formulation.ymf
states it for all four sub-problems that have one, with the values
DispatchTable uses (RANS2P ASGS subgrid-lagged, shock 0.5 lagged; VOF and
NCLS SUPG 0.5, beta 1.5, reference 1.0, lagged; RDLS SUPG 0.9 not lagged),
and `split_problem` carries the resolved block in each sub-problem's record.
Tests (29 new, whole suite 904 -> 933 passed, 13 skipped): resolve
normalization and aliases, 16 refusals (unknown method, beta outside
[1, 2], a word and its alias together, a key a method does not read, ...),
`missing`, the dam break states what the dispatcher assumed and what the
generator spike declared by hand, an entry default is replaced whole by a
sub-problem's block, a bad value is refused on load naming its path, the
strict schema refuses an unknown key, and the block survives the archive
with the same input digest (and a changed value changes the digest).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ound 5, 2/5)
A sub-problem states `lagged_coefficients: {name: previous_step |
previous_iterate}`: the coefficients of the model it freezes. The two
words are different things to a kernel: a time lag makes the coefficient a
constant of the step (no entry in the Jacobian), a Newton lag a constant of
the iteration (a Picard step: the Jacobian drops its dependence on the
unknown). Until now the spec could say only which *fields* a sub-problem
reads from others (`lags`, whose `at` is previous_step or current_step) and,
since commit 1, that its stabilization is lagged; a lag on the sub-problem's
own state-dependent coefficient was in no spec.
What the generator can now read: `split_problem` puts
`lagged_coefficients` in the record, and a state coefficient (the
`coefficients` entries with their dependence on the unknowns) carries
`lagged: <when>`, so a kernel emits it as a constant. A name that is not a
model coefficient, or that the sub-problem already reads through `lags`, is
refused on load, naming its path. No fixture states one: RANS2P freezes no
coefficient (the lags of the dispatcher are the stabilization's, commit 1),
and a fixture must not claim what the solver does not do; the tests set it
on the dam-break flow sub-problem.
Not done: the ADR form still differentiates a lagged coefficient; the
generator has to drop it (listed in the handoff for C19).
Tests (7 new, whole suite 933 -> 940 passed, 13 skipped): the record and the
`lagged` flag on a state coefficient (mu previous_iterate, rho previous_step,
chi untouched), nothing stated means nothing lagged, three refusals (bad
word, not a coefficient, already in lags), and the archive keeps it, with
the same digest, and a changed word changes the digest.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…round 5, 3/5) Boundary kind. `imposed` (strong | weak | none) says how a condition reaches the discrete problem, which is what picks a kernel's boundary term: the engine's Strong, WeakDirichlet and Flux face kinds (C19 gap note G8). A Dirichlet condition (and the Dirichlet part of slip, inflow, characteristic) is strong or weak, default strong; Neumann, Robin and open are none; periodic has none. A weak one may state `penalty` (over h) and `form` (symmetric = SIPG, nonsymmetric = NIPG, incomplete = IIPG). `imposed: none` is new; a strong Neumann condition, a penalty on a strong condition, and an imposed on a periodic one are refused on load, naming the condition. An expanded alias gives the kind to its Dirichlet component only (`slip, imposed: weak` is a weak normal and a natural tangential condition; before, the tangential part carried the word too). `split_problem` gives every condition a resolved `kind` (and `penalty`, `form`), and `ymf.boundaries.kinds` lists a document's. What the generator can now express: the face kernel from the declaration, not the model's name. dambreak_formulation.ymf states RANS2P's Dirichlet conditions weak with the symmetric adjoint and VOF's air inflow strong. Not yet expressible: NCLS's inflow penalty against another sub-problem's trace (a weak Dirichlet whose value is RDLS's face value, G8): a condition has no value source `via` a sub-problem; listed in the handoff. Porosity. dambreak_porous.ymf states the two-phase model with a porosity coefficient (`role: porosity`) in the continuity, momentum, VOF and MCorr equations as RANS2P.h, VOF and MCorr carry them (NCLS none). The split record gets `coefficient_roles` for the coefficients each sub-problem uses, so the generator finds the porosity by its role. VOF's ADR is the form the spike wrote by hand in a Space (m = theta chi, f = theta chi v). `_used` no longer reads a function's name as a run of coefficients (`sign` read as `s i g n` put the gravity `g` among RDLS's coefficients). Tests (31 new, whole suite 940 -> 971 passed, 13 skipped): the default kind of every condition type, ten refusals, the alias split, the dam break's kinds in the document and in each sub-problem's record, no kind stated means the type's default, a bad kind in a condition set refused on load with its path, the archive keeps the kinds and a changed kind changes the digest; porosity by role, which sub-problems use it, VOF's m and dm agree and NCLS equals the plain dam break's, the porosity value in open flow, in the block and at its smoothed edge, and the archive round trip. One existing expectation gained the `kind` key (test_split). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…y unknowns (C42 round 5, 4/5)
C5 step 4 part 2 found no ymf spec for a dispersive model: the family word
(assumptions depth_averaged + dispersive, round 3) existed, but a spec could
not say the closure, the three auxiliary unknowns GN_SW2DCV solves beside h
and q (hη, hw, hβ), what each is, or which coefficients of the model the
discretization supplies. A sub-problem now states
dispersion: {closure: hyperbolic_relaxation, closes: [Pd, Qd],
auxiliaries: [{name: hη, role: relaxed_depth, units},
{name: hw, role: relaxed_divergence, ..},
{name: hβ, role: relaxed_bed_flux, ..}]}
with `initial` optional per auxiliary (default: the decks' hη = h², hw =
hβ = 0; a solitary wave's hw is not 0) and each role's `boundary_like`
(hη and hw take h's boundary data, hβ q's, as the decks' comment says).
Checked on load: only a dispersive-family model may state it; one auxiliary
per role; names not already the model's; `closes` names the model's two
coefficients with roles dispersive_pressure (m3/s2) and dispersive_bed_force
(m2/s2), which are new coefficient roles. The model stays closure-free: the
dispersive momentum is the shallow-water one with the pressure g h²/2 + Pd
and the bed force Qd ∇Z, grouped as GN_SW2DCV.h's source terms (transcribed,
not run against the kernel).
What C5 can now read (split_problem): `dispersion` with the resolved
auxiliaries (six unknowns: h, q_0, q_1 and the three), and Pd and Qd as
`reads` fields (`via: dispersion`) with their gradients in the momentum's
reaction (grad_Pd_0, grad_Pd_1), so a dispersion-aware reader sees what the
closure owes the momentum. Fixtures: dispersive.ymf (the family, assumptions
removed and added by `remove:`), dispersive_numerics.ymf (GN_SW2DCV: the
scheme states lumped_mass only, the one option the cell reads) and
circular_dam_dispersive.ymf (circular_damBreak.py, sw_model 1: 49 x 49 cells,
walls, the deck's auxiliary defaults).
Not done: the relaxed equations and the relaxation parameter lambda
(LAMBDA_MGN = 1 compiled in) are not in the spec; santos_step needs atan
(its bathymetry) and conical_island a state on part of the boundary; listed
in the handoff.
Tests (27 new, whole suite 971 -> 998 passed, 13 skipped): defaults and the
decks' roles, 13 refusals in resolve, the family and state of the case, six
unknowns and the closure's fields in the split record, what the deck set by
hand, five refusals on load naming their path, the strict schema, and the
archive keeps it with a digest that moves when an auxiliary's initial value
does.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
`mesh: {cells: {x: 80, y: 40}}` states one count per axis. C5 step 4 part 2
could only compare a deck whose box was a square count: `cells: 80` is one
number for every axis, and `cells: [80, 40]` is a *study* of two meshes, so
dam3Bumps (75 m x 30 m, nnx 81, nny 41) and santos_step (30 m x 2 m, 81 x 9)
had no spelling. A list stays a study, a map is one mesh, and a list of maps
is a study of such meshes; a map's keys are x, y, z in order with none
skipped, each a whole number >= 1, and on load they must equal the axes of the
box the domain states (`domain_dim` reads the box of the notation short form,
`[0, 1]^3` included, or of a mapping). An output key reads `cells=80x40`;
a spec with a single count or a study of counts keeps the keys it always had.
`ymf.discretizations.cells_per_axis(cells, dim)` gives a reader the counts in
axis order; a realization from `closure.realizations` carries the map as
written, so proteus's ymf_run must read it through that helper (`int(cells)`
fails on a map): that reader change is in the handoff, not made here.
What C5 can now express: dam3bumps.ymf (test/SWFlow/dam3Bumps.py at
refinement 4: nnx = 5 * 2^4 + 1 = 81, nny = (nnx - 1)/2 + 1 = 41, so 80 x 40
cells) is one realization `cells=80x40`; its key differs from 40x80, from
80x80 and from 80.
Tests (33 new, whole suite 998 -> 1031 passed, 13 skipped): the counts in
axis order, 11 refusals (a missing, extra or unknown axis, zero, a fraction, a
list, no dimension), the dimension of eight domain spellings, the deck's
80 x 40 from its own refinement formula, the key, four different digests, a
study of maps, an older spec keeps its keys, cells and h still alternatives,
four bad values refused on load naming the discretization, the strict
schema, and the archive.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…made form docs/problem-specification.md: "What a generator and a dispatcher read of the formulation" (stabilization and shock capturing, lagging, boundary kind, porosity, the dispersive family, cells per axis, with the exact keys), the new words in the dispatcher table; docs/changes.md; examples/README.md lists the worked specs (the fixtures that extend the family files). One test added: dambreak_porous.ymf's VOF ADR (theta inlined as the expression of the coordinates) equals, to round-off, the form the generator spike wrote by hand in a Space with the porosity a per-point field (m, dm, f, df, two states, a point inside the block). Whole suite 1031 -> 1032 passed, 13 skipped. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The four porosity tests each called split_problem on dambreak_porous.ymf; a module-scoped fixture does it once. No change to what is checked. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
C42 round 5: stabilization, lagging, boundary kind, porosity, dispersive family, cells per axis
cekees
added a commit
to cekees/proteus
that referenced
this pull request
Nov 18, 2026
…l ymf 0.3.0 Since proteustoolkit/ymf#31 (ymf 0.3.0) is on ymf main, CI installs it and main's test/dispatch fixtures no longer validate: the 0.3 schema requires stabilization.method and renames lag/sc_uref/sc_beta. On #318 (head 7d21425, run 44241675413) that was 10 failed + 38 errors in linux-64, all in test/dispatch, and the coverage floor of Dispatch.py/DispatchRun.py/ cli/ymfrun.py; nothing in the C33 changes. #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. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cekees
added a commit
to cekees/proteus
that referenced
this pull request
Nov 18, 2026
…ymf 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 #315 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 #315 ride the same main train as #316 (cekees, 2026-11-18). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cekees
added a commit
to cekees/proteus
that referenced
this pull request
Nov 18, 2026
…mf 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 #317 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 #317 ride the same main train as #316 (cekees, 2026-11-18). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cekees
added a commit
to cekees/proteus
that referenced
this pull request
Nov 18, 2026
…ail ymf 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 #319 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 #319 ride the same main train as #316 (cekees, 2026-11-18). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cekees
added a commit
to cekees/proteus
that referenced
this pull request
Nov 18, 2026
…ymf 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 #320 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 #320 ride the same main train as #316 (cekees, 2026-11-18). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cekees
added a commit
to cekees/proteus
that referenced
this pull request
Nov 18, 2026
…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>
cekees
added a commit
to cekees/proteus
that referenced
this pull request
Nov 18, 2026
… 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>
cekees
added a commit
to proteustoolkit/proteus
that referenced
this pull request
Nov 19, 2026
…main The three environment files pip-installed ymf from a moving git branch, so the same proteus commit passed or failed depending on when it ran relative to an ymf merge. ymf 0.3.0 reaching main (proteustoolkit/ymf#31, 2026-11-17 19:25Z) broke main's test/dispatch (8 failures on #312's macOS leg, linux-64 legs of #315 and #317-#321) until ymf 0.3.1 (#32) restored the specs; every run in that window failed for a reason outside the commit under test. Earlier: cekees#46 (272 KeyErrors, run began 11 h before ymf#2 merged). Now: `ymf >=0.3.1` from PyPI (0.3.1 released 2026-11-18) in environment-dev-up, -mpich-dev and -openmpi-dev (sdist.yml and pytest-ways.yml copy these). ymf-import-gmsh is not on PyPI and stays at git main. Testing against ymf main stays one click away: sdist.yml's workflow_dispatch takes a `ymf_ref` input (branch, tag or commit); when set, a step installs ymf from that ref of proteustoolkit/ymf over the PyPI release. Empty (and on push/pull_request) changes nothing. The "Record the ymf this leg resolved" step already reports either source. test/run_like_ci.sh's comment follows. Measured: environment files parse (yaml.safe_load), sdist.yml parses; the pin is exercised by CI of this PR (the conda env step installs it) -- before: git main of ymf at run time; after: PyPI >=0.3.1. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One round from cekees/ymf. With it, a spec can say the things the proteus kernel generator and the app framework had to guess or hard-code before.
stabilizationwithshock_capturing(SUPG, ASGS, residual shock capturing, entropy viscosity, two graph-viscosity variants;tau,lagged, factor);lagged_coefficients(frozen in time or in the Newton iteration); animposedboundary kind per condition (withpenaltyandform), porosity andcoefficient_roles;dispersion(the hyperbolic-relaxation dispersive family);mesh.cellsper axis for structured meshes; docs, and the spec's porous VOF checked against the generator spike's hand-written formymf states only what a spec says: a key left out stays unstated and the solver's default applies (
ymf.stabilization.missing(block)lists what a reader still needs). Every new key is checked on load, is part of an archive's input key, and survives an archive round trip (one test per word). Suite 904 -> 1032 passed.CI is green on cekees#16 (10 checks: core on Python 3.10, 3.12, 3.13 and 3.14, the three one-extra legs, linux-aarch64, macOS arm64 and Intel). Nothing is tagged or uploaded by this PR. After it merges,
v0.3.0is the next tag (your approval in thepypienvironment), and then proteus CI pinsymf>=0.3.🤖 Generated with Claude Code