Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix swarm block neighbor indexing in 1D, 2D #1184

Merged
merged 6 commits into from
Oct 5, 2024
Merged

Conversation

brryan
Copy link
Collaborator

@brryan brryan commented Oct 2, 2024

PR Summary

For some cases, the current block of particles was being computed incorrectly. This was because the swarm_comms.cpp initialization machinery would overwrite the region of neighbor_indices_h belonging to the currently active meshblock. I fixed this, and also changed the index we use to compute neighbor indices for unused dimensions in SwarmDeviceContext to improve consistency.

This should fix the downstream issue @pdmullen.

PR Checklist

  • Code passes cpplint
  • New features are documented.
  • Adds a test for any bugs fixed. Adds tests for new features.
  • Code is formatted
  • Changes are summarized in CHANGELOG.md
  • Change is breaking (API, behavior, ...)
    • Change is additionally added to CHANGELOG.md in the breaking section
    • PR is marked as breaking
    • Short summary API changes at the top of the PR (plus optionally with an automated update/fix script)
  • CI has been triggered on Darwin for performance regression tests.
  • Docs build
  • (@lanl.gov employees) Update copyright on changed files

Copy link
Collaborator

@Yurlungur Yurlungur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty trivial. LGTM. Is there a unit test we could add to catch this?

@brryan
Copy link
Collaborator Author

brryan commented Oct 3, 2024

Pretty trivial. LGTM. Is there a unit test we could add to catch this?

I don't think this is easy to do as a unit test because ultimately we need to call Mesh::Initialize() to set up the data structures used by the swarm to compute neighbor blocks, but I added a check to the particles example that makes sure initialized particles report that they are on the current meshblock.

@brryan brryan enabled auto-merge (squash) October 5, 2024 19:55
@brryan brryan merged commit f61ef10 into develop Oct 5, 2024
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants