Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/src/navier_stokes.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ disc = FEMDiscretization(Ω, t; spaces = Dict(u => Q2, v => Q2, p => Q1),
pairing = Dict(eqs[3] => p), natural = [Γout], initializealg = CheckInit())
prob = DAEProblem(dfg, disc)
abstol = [d ? 1e-7 : 1e8 for d in prob.differential_vars] # pressure and Dirichlet rows out of error control
sol = solve(prob, DFBDF(nlsolve = NLNewton(new_W_dt_cutoff = 0), linsolve = UMFPACKFactorization());
sol = solve(prob, DFBDF(linsolve = UMFPACKFactorization());
abstol, reltol = 1e-7)
```

Expand Down Expand Up @@ -65,6 +65,11 @@ sol = solve(prob, DFBDF(nlsolve = NLNewton(new_W_dt_cutoff = 0), linsolve = UMFP
(and on Ferrite's own `ns_vs_diffeq.jl` tutorial). Naming it also removes the default's
silent fall-back to sparse QR on a singular Newton matrix, which costs tens of gigabytes
here; the example's `check_solved` raises if the solve stops before its final time.
UMFPACK's default has no iterative refinement and its residual grows above about 60k dofs
(about 1e-12 at 62k, 2e-4 at 248k, on this example's matrices); it is accurate at the 16,430
dofs here. Above about 60k dofs use `KLUFactorization()` until `pivot_tolerance` and `strategy`
are available in a released LinearSolve, then
`UMFPACKFactorization(control = (; strategy = 3, irstep = 2))`.

## Drag and lift

Expand Down
5 changes: 4 additions & 1 deletion examples/dfg_cylinder/dfg_cylinder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ differential_abstol(prob, abstol) = [d ? abstol : 1.0e8 for d in prob.differenti
# pattern as the analyzed matrix" on these Newton matrices, as it does on Ferrite's own ns_vs_diffeq tutorial.
# Naming it also removes the default's silent fall-back to sparse QR when a Newton matrix is singular, which
# for this index-2 system took tens of GB: a singular matrix now fails the step, and `check_solved` raises.
const DFG_ALG = DFBDF(nlsolve = NLNewton(new_W_dt_cutoff = 0), linsolve = UMFPACKFactorization())
# UMFPACK's default has no iterative refinement and its residual grows above ~60k dofs; at this size (16,430) it is
# accurate. Above about 60k dofs use KLUFactorization() until pivot_tolerance/strategy are available in a released
# LinearSolve, then UMFPACKFactorization(control = (; strategy = 3, irstep = 2)).
const DFG_ALG = DFBDF(linsolve = UMFPACKFactorization())

"Raise unless `sol` succeeded and reached its final time (a callback can stop it early with `Terminated`, a success code); a DAE solve that stopped early must not report coefficients."
function check_solved(sol)
Expand Down
Loading