hydromodpy.solver.boussinesq.smoothing#

Smooth C¹ approximations of the piecewise operators used in Boussinesq.

Replacing hard kinks (np.maximum, np.clip) with smooth counterparts makes the Newton Jacobian continuous and improves solver convergence on fine meshes where stiff ill-conditioned systems expose the non-differentiability.

All operators converge to their piecewise limits as ε → 0.

Functions

dsmooth_positive_part(u, eps)

Derivative of smooth_positive_part() with respect to u.

dsmooth_positive_thickness_dh(raw, bmax, eps)

Derivative of smooth_positive_thickness() with respect to head.

smooth_clip_01(x, eps)

Smooth approximation of clip(x, 0, 1) on the unit interval.

smooth_positive_part(u, eps)

Smooth approximation of max(u, 0).

smooth_positive_thickness(raw, bmax, eps)

Smooth approximation of clip(raw, 0, bmax).