Skip to content

Dispatch time-stepping neighbor loops via multiple dispatch#197

Open
AhmedSalih3d wants to merge 1 commit into
BeforeLidDrivenCavityExamplefrom
codex/use-multiple-dispatch-for-time-stepping-in-sphcelllist.jl
Open

Dispatch time-stepping neighbor loops via multiple dispatch#197
AhmedSalih3d wants to merge 1 commit into
BeforeLidDrivenCavityExamplefrom
codex/use-multiple-dispatch-for-time-stepping-in-sphcelllist.jl

Conversation

@AhmedSalih3d

Copy link
Copy Markdown
Owner

Motivation

  • Replace runtime isa checks for SingleNeighborTimeStepping and SymplecticTimeStepping with multiple-dispatch to let Julia compile specialized paths and keep the main loop concise.
  • Move mode-specific neighbor-loop sequences out of SimulationLoop to reduce branching and encourage better performance and code clarity.

Description

  • Add InitializeTimeStepNeighborLoop! overloads: a full initializer for SingleNeighborTimeStepping and an inline no-op for SymplecticTimeStepping to handle initial pressure/MDBC/neighbor-loop setup via dispatch.
  • Add AdvanceHalfTimeStepNeighborLoop! overloads for SymplecticTimeStepping and SingleNeighborTimeStepping encapsulating the half-step neighbor-loop sequences and motion/pressure updates.
  • Replace the isa branches in SimulationLoop with calls to InitializeTimeStepNeighborLoop! and AdvanceHalfTimeStepNeighborLoop!, keeping shared loop structure and letting Julia choose the mode-specific implementation.
  • All changes are contained in src/SPHCellList.jl.

Testing

  • Ran git diff --check which reported no issues.
  • Ran julia --project=. -e 'using SPHExample', which precompiled dependencies and loaded the package successfully.
  • Both automated checks completed successfully.

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