Repository navigation
Use the default Newton W cutoff in the DFG example solver - #62
Merged
Merged
Conversation
new_W_dt_cutoff = 0 refactorized the W matrix on every step (197 factorizations); the default cutoff needs 35 and gives identical cD, cL and dp to 10 digits, with 2.4x less solve time at 16,430 dofs. Agent-Harness: Claude Code 2.1.318 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
The page showed NLNewton(new_W_dt_cutoff = 0), which the example no longer uses, and gains a note on UMFPACK accuracy above about 60k dofs. Agent-Harness: Claude Code 2.1.312 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.312 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.312 Agent-Model: claude-sonnet-5-5 Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c Agent-Review: unreviewed Co-authored-by: Claude Code <agent@noreply.juliahub.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.
The DFG example forced a W refactorization on every step with
new_W_dt_cutoff = 0. With the default NLNewton cutoff, 2D-1 (16,430 dofs, tend 60) refactorizes 35 times instead of 197. Solve time drops from about 18.5 to 20.5 s to about 7.8 s (2.4x), with 288 accepted steps instead of 289. cD, cL and Δp are identical to 10 digits (5.5794364082, 0.0105832589, 0.1175842628); the NavierStokes test prints the same values.The only change is dropping
new_W_dt_cutoff = 0fromDFG_ALGinexamples/dfg_cylinder/dfg_cylinder.jl, plus a short comment: UMFPACK's default has no iterative refinement and its residual grows above about 60k dofs (measured on the example's W matrices: about 1e-13 at 5k dofs, 1e-12 at 62k, 8e-8 at 125k, 2e-4 at 248k; root cause is UMFPACK's relative pivot tolerance of 0.1, and Julia turns off UMFPACK's iterative refinement), while it is accurate at this size (5e-14 at 16,430). Above about 60k dofs useKLUFactorization()untilpivot_tolerance/strategyare available in a released LinearSolve, thenUMFPACKFactorization(control = (; strategy = 3, irstep = 2)).irstep = 2alone is not sufficient at high resolution (2.7e-9 at 248k dofs), and it costs most of the remaining time at this size, so it is not used here.Docs:
docs/src/navier_stokes.mdshows the same solver call, so its snippet (line 38) now readsDFBDF(linsolve = UMFPACKFactorization())and the Linear solver note gains the UMFPACK accuracy sentence with the 60k-dof advice (a hand edit; the page is not generated from the example). Not changed: the README showcase keeps its own setting (on the showcase, dropping the cutoff gains at most 8%); other uses ofnew_W_dt_cutoff = 0are untouched:src/frontend.jl:436(docstring),docs/src/getting_started.md:131,test/shared/frontend.jl:10,test/shared/frontend_tests/api_example.jl:62,benchmarks/accuracy_convdiff.jl:32,46;benchmarks/navier_stokes/ns_cylinder.jlusesDFG_ALGand speeds up automatically.Local results on Julia 1.12:
GROUP=NavierStokespasses 15 of 15 (1m30), Runic 1.13 clean, Codex approved. Measured on a shared box (load 1.6 to 15), two runs each back to back.🤖 Posted by an AI agent · harness: Claude Code 2.1.318 · model: claude-sonnet-5-5
Review: unreviewed
Session: 43e03fde-3384-4386-bae9-03e81f19ba7c