Skip to content

Encode time-stepping mode in SimulationMetaData and dispatch neighbor loops#177

Open
AhmedSalih3d wants to merge 1 commit into
BeforeLidDrivenCavityExamplefrom
codex/change-timesteppingmode-to-type-parameter-xdow8g
Open

Encode time-stepping mode in SimulationMetaData and dispatch neighbor loops#177
AhmedSalih3d wants to merge 1 commit into
BeforeLidDrivenCavityExamplefrom
codex/change-timesteppingmode-to-type-parameter-xdow8g

Conversation

@AhmedSalih3d

Copy link
Copy Markdown
Owner

Motivation

  • Centralize the time-stepping strategy into the simulation metadata to make the simulation API cleaner and enable compile-time dispatch on stepping mode.
  • Remove the ad-hoc SimTimeStepping argument from RunSimulation to simplify caller code and example scripts.
  • Separate the neighbor-loop logic for the two stepping strategies so the main loop is simpler and easier to maintain.

Description

  • Add a TimeSteppingMode abstract type and concrete types SymplecticTimeStepping and SingleNeighborTimeStepping, and extend SimulationMetaData with a TMode type parameter.
  • Provide a default SimulationMetaData constructor that defaults TMode to SingleNeighborTimeStepping to preserve prior behavior.
  • Remove the SimTimeStepping parameter and the TimeSteppingMode field from runtime metadata, and update RunSimulation signature to accept the SimulationMetaData with the time-stepping mode encoded in its type.
  • Introduce InitialNeighborLoop! and HalfStepNeighborLoops! methods specialized for SymplecticTimeStepping and SingleNeighborTimeStepping, and refactor SimulationLoop to call these helpers instead of branching inline; update README and example scripts to reflect the new metadata-driven configuration.

Testing

  • No automated tests were present or modified in the repository, so no automated test suite was run as part of this change.
  • Local type-level compilation/inspection was used to ensure the new dispatch-based code paths resolve, with no compile-time errors observed.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant