Skip to content

[Math] Replace per-axis flux dispatch (_x/_y/_z/_mx/_my/_mz) with a compile-time rotation #2305

Description

@tdavidcl

Every Riemann solver in shammath:

  1. permute & rotate the vector components of the two input PrimState/DustPrimState operands,
  2. call the *_flux_x solver,
  3. permute the resulting ConsState/DustConsState flux back with the mirror functions.

Adding a new solver currently means writing 6 near-copy-pasted wrappers by hand, when the permutation logic is really just fixed rotation matrices (axis swaps + a sign flip) applied to vel/rhovel.

The goal would be replace the six hand-written wrappers per solver with a single generic call that uses compile (NTTP) or runtime (by value) matrices and their inverse to perform the suitable rotations. (maybe we should rewrite the riemman solver to be direction agnostic but i'm not sure if that's the best idea ...)

Note that clang 15 has known issues with vector/floating-point NTTPs, so a Tvec value can't be used directly as an NTTP on that toolchain.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions