Skip to content

Make half-step wrapper views array-like and integrate into time-stepping#154

Open
AhmedSalih3d wants to merge 1 commit intocodex/refactor-to-avoid-if-statementfrom
codex/remove-support-data-code-structures-89vga9
Open

Make half-step wrapper views array-like and integrate into time-stepping#154
AhmedSalih3d wants to merge 1 commit intocodex/refactor-to-avoid-if-statementfrom
codex/remove-support-data-code-structures-89vga9

Conversation

@AhmedSalih3d
Copy link
Owner

Motivation

  • Fix MethodError when using Base array utilities (e.g. keys) on half-step wrapper views and make them interoperable with existing array-based code paths.
  • Integrate half-step position/velocity/density views into the symplectic time-stepping so neighbor list updates and pressure/density calculations operate on computed half-step values.

Description

  • Add HalfStepPosition, HalfStepVelocity, and HalfStepDensity types as subtypes of AbstractVector with convenience constructors, length/axes/size/IndexStyle, and getindex implementations in src/SPHCellList.jl so they behave like array views.
  • Use the half-step views throughout the time-stepping loop by creating PositionHalfStep, passing HalfStepPosition/HalfStepVelocity/HalfStepDensity into NeighborLoopPerParticle!, and updating calls that compute pressure and density to use half-step values.
  • Add PressureHalfStep! and a new DensityEpsi! overload that accept half-step inputs and motion limiters, and replace usages accordingly.
  • Adjust allocation and initialization in SimulationLoop to create AccelerationMax, dρdtI, ∇Cᵢ, and ∇◌rᵢ with similar/fill! and handle NoShifting mode.
  • Update SPHNeighborList to resize ParticleRanges in UpdateNeighbors! and add an alternative allocation-free UpdateΔx! overload that computes norms via dot for generic posₙ⁺ types.
  • Small example and I/O tweaks in example/StillWedgeMDBC.jl to use mkpath and a local OutputDirectory variable.

Testing

  • No automated tests were run for these changes.

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