Skip to content

Curvature-adaptive grid refinement on all axes #2

@jc-macdonald

Description

@jc-macdonald

Generalise the curvature-adaptive trait grid from structured-observables into a reusable, axis-agnostic grid refinement engine.

Origin

The structured-observables computational companion notebook implements generate_adaptive_theta_from_curvature() — a function that:

  1. Evaluates curvature κ = |η''w + 2η'w' + ηw''| on a dense reference grid
  2. Builds a cumulative weight function from κ
  3. Distributes N points uniformly in weight-space → non-uniform in θ-space

This concentrates resolution where the solution has structure and saves points where it's smooth. Currently hardcoded for a single trait axis (θ) with specific functions (η, w).

Generalisation

The same idea applies to every axis in an operator-partitioned system:

  • Trait axes (phytoplankton size θ, zooplankton size ϑ, detritus size ξ in TRIDENT)
  • Spatial axes (depth z in TRIDENT, with curvature from thermocline/nutricline)
  • Age/stage axes (in epidemiological or demographic models)

Tasks

  • Define an AdaptiveGrid type parameterised by axis and curvature estimator
  • Implement curvature estimation from: (a) known analytic curvature, (b) numerical second derivatives of a reference solution, (c) user-supplied weight function
  • Build grid from curvature weights (the inverse-CDF / quantile approach)
  • Support multi-axis grids: independent adaptive refinement per axis, with tensor-product assembly
  • Integrate with the finite-volume discretisation in OpEngine.jl Core operator-splitting solver: ODE + IMEX #1 — non-uniform cell widths
  • Allow runtime re-gridding (solution-adaptive: re-estimate curvature from current state and rebuild grid)

Cross-references

  • structured-observables: computational companion notebook (generate_adaptive_theta_from_curvature)
  • trident Core operator-splitting solver: ODE + IMEX #1: TRIDENT has trait + spatial axes that will consume this
  • representation-matters: ρ = ε/h — adaptive h means ρ varies across the domain, concentrating resolution where biology demands it

Boundary

This is a solver feature — grid refinement lives in OpEngine. The declaration of which axes exist and their bounds lives in OpSystem.jl.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions