Skip to content

Skip non-fluid work in neighbor loops#141

Open
AhmedSalih3d wants to merge 1 commit intocodex/optimize-neighborlist-code-performancefrom
codex/refactor-particle-neighbor-loop-logic
Open

Skip non-fluid work in neighbor loops#141
AhmedSalih3d wants to merge 1 commit intocodex/optimize-neighborlist-code-performancefrom
codex/refactor-particle-neighbor-loop-logic

Conversation

@AhmedSalih3d
Copy link
Owner

Motivation

  • Reduce unnecessary computation for boundary/fixed/moving particles by avoiding full neighbor interaction work when a particle is not Fluid.
  • Prevent accumulation of stale values in per-particle buffers for non-fluid entries by explicitly zeroing outputs.

Description

  • Added early-exit checks in all NeighborLoopPerParticle! variants to skip the heavy neighbor scanning when ParticleType[i] != Fluid and to write zeroed accumulators back to particle fields.
  • Avoided processing non-fluid neighbors by guarding interaction calls with ParticleType[jIndex] == Fluid inside the inner loops.
  • Pulled ParticleType = SimParticles.Type once per thread loop to reduce repeated field access.
  • Change localized to src/SPHCellList.jl across the multiple overloads of NeighborLoopPerParticle! handling different metadata modes.

Testing

  • No automated tests were run on this change (CI/tests not executed).

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