Skip to content

Thin sheet: solve(picard=N) reaches the rotated loop; picard on a fault contact; a manifold takes stress_transport "none" (#876, #887) - #1066

Merged
lmoresi merged 5 commits into
developmentfrom
bugfix/thin-sheet-solve-picard-876
Nov 11, 2026
Merged

lmoresi merged 5 commits into
developmentfrom
bugfix/thin-sheet-solve-picard-876

Conversation

@lmoresi

@lmoresi lmoresi commented Nov 11, 2026

Copy link
Copy Markdown
Member

picard on the rotated path (#876). A sheet on a manifold always solves in the rotated loop (rotated_bc.solve_rotated_freeslip). SNES_Vector.solve handed that loop picard=0, and ThinSheet.solve took no picard. So sheet.solve(picard=2) was a TypeError, and the plasticity guides' solve(picard=N) recipe could not reach a nonlinear sheet.

  • SNES_Vector.solve plans the warm-up with the rotated loop marked as its own (own_loop) and as one that stages Picard → Newton (staged_loop), and passes picard to the loop. ThinSheet.solve forwards it.
  • On the rotated loop picard=N means at least N Picard iterations. The loop stays on Picard until the residual has fallen by newton_switch_rtol (default 1e-2). The loop takes no automatic cold-start step, so picard=0 is Newton from the start. Both docstrings say so.

picard on a fault contact. A fault contact runs the same loop. An explicit picard > 0 there raised NotImplementedError naming rotated free slip, because solve() did not compile the blended Jacobian for it. staged_loop now counts fault contacts, on SNES_Vector and on Stokes. On a fault-contact Stokes box, solve(picard=2) stages in 5 iterations against 6 for solve(), with the same answer to 1.4e-10. A cold picard=0 solve there still compiles no blended Jacobian. The loop's message, for a caller that reaches it without solve() (fault_contact.solve_with_fault(picard=N)), names both and points at solve(picard=N).

time. #876 also asks for solve(time=). This branch does not add it, following the ruling on #410 (2026-07-24) to retire the PETSc-time plumbing: time is the model's clock. mesh.t reaches the sheet: setting tracker.time from 1 to 3 scales the answer by 3.000000000009 (hyperion's review). solve(time=) on the other solvers sets petsc_t, which nothing a user writes reads (#410).

A manifold takes stress_transport="none" (#887). stress-transport.md recommends "none" for a tidal or seismic cycle, and a manifold sheet refused it along with the flavours that move points off the faceted surface. "none" keeps the tangent projection of the history, the only manifold step "eulerian" has (_keep_history_tangent). On a slow flow, after four steps it is 1.1e-4 from "eulerian", and the stored stress is tangent to 1e-16.

The GAMG-fallback advice (#887). On a refined mesh the warning told a Stokes solver to call set_custom_fmg(solver, mesh.multigrid_levels[:-1]), which raises CollectiveBuildError there: the hierarchy is the velocity block's. It now names field_id=0 for a saddle-point solver, and a manifold is not told to adapt(). Followed literally:

  • on a refined Stokes annulus, velocity iterations go from 29 to 3;
  • on a refined sheet, KSP iterations go from 175 to 13.

thin-sheet.md documents normal_velocity, the transport choices and picard.

Tests

tests/test_1159_thin_sheet_solve_takes_picard.py (new, tier B):

  • picard=3 on a nonlinear sphere sheet runs a Picard phase and converges to the plain solve's answer. With newton_switch_rtol=1 it switches at exactly iteration 3.
  • The printed GAMG advice, followed literally, builds the multigrid on a refined Stokes annulus (with field_id=0) and on a refined sphere (without it).
  • An explicit picard stages on a fault-contact sheet and on a fault-contact Stokes box, and converges to the picard=0 answer. A cold picard=0 solve compiles no blended Jacobian.
  • "none" is taken on a manifold and agrees with "eulerian" on a slow flow; the flavours that move points off the surface are still refused.

On development the first test is a TypeError. With this branch's sheet on development's .pyx there is no Picard phase. These mutants each fail the file:

  • the reverted pass-through;
  • "none" without the tangent step;
  • staged_loop or own_loop without fault contacts;
  • the advice without field_id.

Serial on wombat: 108 passed over 1159, 1077, 1092, 0846, 0847, 1136, 1018 (×2), 0062, 1087 and 0022.

Hyperion ran two review rounds; the records are to be posted here:

  • 254 passed serial, and 22 passed and 12 skipped in the parallel files at np 2;
  • test_1159 passes at np 1, 2 and 4, and the two advice tests read rank 0's printed text on every rank, so they do not hang under mpirun;
  • on Stokes with a fault contact, picard=2 stages in 4 Newton iterations against 7 and matches picard=0 to 1.9e-7, at np 1 and 2, while picard=0 keeps its residual history.

Issues

Underworld development team with AI support from Claude Code

…s stress_transport "none" (#876, #887)

- SNES_Vector.solve handed its rotated path picard=0 and did not tell the
  warm-up planner that the rotated loop stages Picard itself. A manifold sheet,
  which always solves there, could not take the plasticity guides'
  solve(picard=N) recipe, and ThinSheet.solve did not take picard at all (a
  TypeError). Both now pass it through as Stokes does: picard=3 stages three
  Picard iterations, then Newton, and converges to the plain solve's answer.
  With the old call the new test fails ("no Picard phase").
- ThinSheet refused stress_transport="none" on a manifold along with the
  trace-back flavours, though stress-transport.md recommends it for a tidal
  cycle. "none" keeps the history at its node, so it never leaves the faceted
  surface. It is now taken: on a slow flow it agrees with the grid history to
  1.1e-4 of the stress, and both stay tangent.
- The rotated path's GAMG-fallback warning gives advice that fits the mesh. A
  refined mesh carries its coarse levels (register mesh.multigrid_levels[:-1]
  with set_custom_fmg), and a manifold is no longer told to use adapt(), which
  does not keep its vertices on the surface.
- thin-sheet.md documents normal_velocity, the manifold's transport choices
  and solve(picard=N).

#876 also asked for time. ThinSheet.solve still does not take it: under the
#410 ruling, time is the model's clock, and mesh.t already reaches a manifold
sheet (the answer scales by 3.0000000039 when the clock goes from 1 to 3).
solve(time=) sets petsc_t, which nothing a user writes reads; commented on #410.

test_1159 (new, tier B). Serial: the sheet files with test_1018,
test_1059_stress_transport and test_0009 give 110 passed (with an
intermediate time= plumbing since removed); the sheet files at this commit
give 22 passed.

Underworld development team with AI support from Claude Code
Underworld development team with AI support from Claude Code
… fault contact; what picard=N means

hyperion's review of d36ec79:
- F1: the GAMG-fallback advice on a refined mesh names field_id=0 for a
  saddle-point solver; set_custom_fmg(solver, mesh.multigrid_levels[:-1]) raised
  CollectiveBuildError on Stokes. test_1159 follows the printed advice on a
  refined Stokes annulus and a refined sphere and finds the multigrid built.
- F4: an explicit picard stages on a fault contact (staged_loop counts fault
  contacts, on SNES_Vector and Stokes); it raised NotImplementedError naming
  rotated free slip. The loop's message now names both and points at
  solve(picard=N). Tests on a fault-contact sheet (fixture from the review) and a
  fault-contact Stokes box: a Picard phase, convergence, the picard=0 answer, and
  no blended Jacobian for a cold picard=0 solve.
- F2, F3: ThinSheet.solve says the rotated loop takes no automatic Picard step
  and picard=N gives at least N there (newton_switch_rtol); test_1159 pins the
  switch at exactly N with newton_switch_rtol=1.
- F5: lagrangian and forward are not called trace-backs.
Mutants: staged_loop without fault contacts, own_loop without fault contacts,
and the advice without field_id each fail test_1159.

Underworld development team with AI support from Claude Code
The GAMG-fallback warning is printed on rank 0 only, so at np 2 rank 1's
capfd assert failed and it left the test while rank 0 entered the collective
multigrid_levels: test_1159 hung (hyperion's review, F6). The captured text is
broadcast from rank 0 before the asserts.

Underworld development team with AI support from Claude Code
Underworld development team with AI support from Claude Code
Copilot AI balanced review requested due to automatic review settings November 11, 2026 14:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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