hydromodpy.solver.boussinesq.jacobian.fd#
Finite-difference Jacobian helpers for Boussinesq runtimes.
At the moment the Boussinesq backends share a deliberately simple strategy:
keep the nonlinear unknown equal to the cell-centered head vector;
evaluate the residual as a black-box function of that vector;
approximate the Jacobian by forward finite differences.
This module now exposes both:
a dense builder used by the historical
localandscipyruntimes;sparse-oriented helpers that derive a cell-coupling stencil from mesh connectivity and keep only those entries in the assembled Jacobian.
The sparse path also supports a simple greedy column coloring so structurally independent columns can be perturbed together. That keeps the physics black-box while reducing the number of residual evaluations needed for one sparse FD Jacobian build.
Functions
|
Return the residual rows that can depend on each head unknown. |
|
Build sparse Jacobian triplets using graph-colored FD perturbations. |
|
Build a dense Jacobian by perturbing one head component at a time. |
|
Build sparse Jacobian triplets using a precomputed coupling stencil. |
|
Group columns whose structural row supports do not overlap. |