Repository navigation
#894: refresh the interface-law operator in place in the rotated Newton loop - #913
Merged
Merged
Conversation
…perator With a fault interface law the rotated Newton loop hands the KSP a new operator at every iterate, and the velocity multigrid keeps the finest smoother's operator of iterate 0. The test records, after each linear solve, the operator the multigrid was handed and the finest smoother's operator, on the saddle-point and thin-sheet paths, with a viscous fault and with the frictionless contact as the control. On this commit (no fix) the viscous-fault cases fail: the operators differ by 0.77-0.87 (relative, Frobenius) at every iterate after the first, on both paths. The frictionless cases pass. Tier B, serial and parallel, one file under tests/parallel with no min_size mark (run from the serial batches beside test_1090). Underworld development team with AI support from Claude Code
…on loop With a fault interface law the loop built Ahat + Khat into a new Mat at every iterate. PCMG keeps the finest smoother's operator unless the PC's new pmat is that same object, and the fieldsplit hands over a new velocity block when the pattern changes, so the finest smoother and the Galerkin coarse operators stayed at iterate 0, on the saddle-point and the thin-sheet paths alike. The sum is now made once and refreshed in place after that: MatCopy of Ahat and MatAXPY of the tangent, both SUBSET_NONZERO_PATTERN, which insert into existing locations and leave the Mat and its nonzero state unchanged. This is what the frictionless contact already does with Ahat. The tangent's pattern is fixed by the fault facets and Ahat's by the ptap, so both stay inside the first sum's pattern. The null space attached to the first sum stays with it, so the re-attach is gone. test_1088 passes (it failed on the parent). Velocity iterations per Newton increment on its fixture, viscous fault: saddle point 2, 32, 31, 26, 27 -> 2, 2, 2, 3, 3; thin sheet 2, 27, 21, 21, 21, 20 -> 2 at every increment. The test now also bounds them at 5. Underworld development team with AI support from Claude Code
…erate The in-place refresh does not fit the direct-LU path: its pressure pin (zeroRows, without MAT_KEEP_NONZERO_PATTERN) drops the pinned row's entries from the sum, and the next MatCopy raised "new nonzero at (0,818) caused a malloc" at iterate 1. That path has no multigrid to go stale, so it builds a fresh sum as before; the in-place refresh stays on the multigrid paths. test_1088 gains the LU case. The path does not converge on a fault contact on development either (#899, filed: 50 increments, slip 4-5% off, with or without an interface law), so the case is a strict xfail on its convergence assertion only: the PETSc error above still fails it. Underworld development team with AI support from Claude Code
…nd GAMG From the adversarial review of this branch: - The operator-gap check alone could not see an operator that is the right object holding iterate 0's values: a mutant that skips the in-place refresh passed the thin-sheet case. The test now also bounds the Newton increments (5-6 measured; the mutant takes 49 or stalls) and fails all six viscous-fault arms under that mutant. - The split mesh's own multigrid tail (no set_custom_fmg) was stale too (thin sheet 4, 30, 23, 24, 23, 22 before, 4-5 after) and is now an arm. GAMG is an arm as a control: it rebuilds from the live operator at every set-up and was never stale (31-44 before and after, gap 0). - The direct-LU case is an imperative xfail on non-convergence (#899) only, so a fix to #899 that converges to a different slip fails the test. - The comment named the wrong trigger: a new Pmat object resets the PC's nonzero state even with an identical pattern. - FAULT_CONTACT_DEPLOYMENT's trap list prescribed a rebuilt copy per iterate; it now says to refresh one copy in place, LU excepted. On the parent build the four viscous-fault multigrid arms fail and the rest pass; on this build 12 pass and the LU case xfails. Underworld development team with AI support from Claude Code
Member
Author
Adversarial review (fixes in 12e5fc0)Reviewed by a separate agent against Findings and what was done
On the parent build, the four viscous-fault multigrid arms of test_1088 fail and the rest pass. On this build, 12 pass and the LU case xfails. Issue verdicts
Underworld development team with AI support from Claude Code |
lmoresi
changed the base branch from
bugfix/fac-live-block-solver
to
development
October 31, 2026 21:06
lmoresi
added a commit
that referenced
this pull request
Oct 31, 2026
CI failed test_1106 at np 1 as well as at np 2: Linux counts 4772 patch rows in serial against 4780 on macOS. The placed fault's cavity fill differs by a few rows between hosts: - macOS arm64, custom PETSc 3.25.0; - CI's Linux x86_64, conda-forge PETSc 3.25.3; - both with gmsh 4.15.2. On CI the np 2 count is 4772 too, so the partition does not change the band there either: the test's single macOS baseline was the defect, not the halo. The test accepts exactly the recorded serial counts, one per host. #896's error added 2110 rows. A new host records its serial count. Passes at np 1 and 2. The merged branch's FAC and fault suite passes: 66 serial, 26 at np 2 (3 skipped). test_1088 (from #913) passes 12, with its LU case xfailing (#899). Underworld development team with AI support from Claude Code
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.
With a fault interface law, the rotated Newton loop handed the KSP a new operator at every iterate. The velocity multigrid kept the finest smoother's operator of iterate 0, and the Galerkin coarse operators with it. This PR refreshes the operator in place.
Stacked on #892's PR (
bugfix/fac-live-block-solver); it is retargeted todevelopmentwhen that merges.What was wrong
The loop built
Ahat + Khatinto a new Mat at every iterate. PCMG keeps the finest smoother's operator unless the PC's new pmat is the same object. The fieldsplit hands over a new velocity block when the pattern state changes, and a new Pmat object resets that state even with an identical pattern. So on the saddle-point and thin-sheet paths alike, the smoothers worked on iterate 0's operator.GAMG was never stale: it rebuilds from the live operator at every set-up. The mesh's own multigrid tail (no
set_custom_fmg) was stale too.The fix
The sum is made once, then refreshed in place with MatCopy of
Ahatand MatAXPY of the tangent, both SUBSET_NONZERO_PATTERN. This is what the frictionless contact already does withAhat. The null space attached to the first sum stays with it.The direct-LU path keeps a fresh sum each iterate. Its pressure pin (
zeroRows) drops pattern entries, so an in-place copy would raise "new nonzero ... caused a malloc". That path has no multigrid to go stale.Measured
Velocity iterations per Newton increment on test_1088's fixture, viscous fault:
On the box at np 4 with a rate law, the parent capped 746 of 772 velocity sub-solves and had not converged at 60 minutes. This branch converges in 160 s.
Tests
test_1088 runs three hierarchies (
set_custom_fmg, the mesh's own tail, GAMG as a control) on the saddle-point and thin-sheet paths, with a viscous fault and with the frictionless contact as the control. It also has the direct-LU case.Review
The adversarial review (12e5fc0) is in the first comment.
Issues
test_1063_constrained_freeslip_parallel[ti]misses its accuracy anchor (test_1063 [ti]: constrained free-slip topography 1.8% off its recorded anchor on the anchor's own mesh #826), on development too.Underworld development team with AI support from Claude Code