Skip to content

Remove hardcoded 2D requirement #19

Closed

Description

@jbphyswx

Right now the package takes u and v on cartesian x and y.

  • we should relax the 2D requirement, it is not necessary.
  • we should one day relax the cartesian requirement and support spherical (though I don't fully know how the math works, somethign about legendre polynomials times spherical harmonics)

Activity

  1. self-assigned this
    on Jun 5, 2026
  2. jbphyswx commented on Sep 6, 2026

    @jbphyswx
    OwnerAuthor

    Done. Dimension support now follows what each operator actually needs, rather than a blanket restriction.

    Measured across D ∈ {1,2,3,4,5} through the public entry:

    operator consumes works at
    S2SF, L2SF, T2SF, L3SF, L1T2SF δu_L, ‖δu‖² — defined at any D every D
    T2ComponentSF ‖δu_T‖²/(D−1) — needs a transverse subspace D ≥ 2
    T3SF an oriented n̂ D ∈ {2,3}

    The remaining restriction is real rather than incidental: an orientation exists only at D = 2 (the quarter turn) and D = 3 (the turn about ẑ), and only operators odd in the transverse component need one. n̂'s refusal was a bare error("Only 2D and 3D supported"); it now states which operators need an orientation and that everything else consumes δu_T² and works at any dimension.

    One latent silent-wrong-answer this exposed: _sf_raw for the transverse-component operator divided by length(dx) - 1 unguarded, so at D = 1 it would have returned Inf/NaN the moment the validator was relaxed. Guarded now, matching the guard the underlying norm already had — and the guard is free: dx is an SVector, so length(dx) is a type-level constant and the guarded and unguarded operators generate byte-identical LLVM with no throw path emitted.

    The spherical half of this issue is #30.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions