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

Particle destructor #927

Merged
merged 11 commits into from
Mar 7, 2025
Merged

Particle destructor #927

merged 11 commits into from
Mar 7, 2025

Conversation

chongchonghe
Copy link
Contributor

@chongchonghe chongchonghe commented Mar 6, 2025

Description

Support particle destruction.

Changes:

  • Define ParticleDestructionTraits. The user define their own particle destructor by specializing the ParticleChecker method in ParticleDestructionTraits, which return true or false to mark a particle for destruction. As a placeholder, particles.param3 is used in particle destructor.
  • Define ParticleDestructionImpl, which loops over all particles at a level and mark particles for destruction.
  • Add a getNumParticles function to PhysicsParticleDescriptor to get the total number of valid particles of that type.
  • Add a new particle parameter particles.verbose to turn on printing particle logistics at each time step. Currently, it prints the number of particles of each type.

The new particle destructor feature is tested in gravity_3d.cpp.

Next, I'll add a particleDestruction method in ParticleDestructionTraits, which modifies the hydro state while removing a particle.

Related issues

None.

Checklist

Before this pull request can be reviewed, all of these tasks should be completed. Denote completed tasks with an x inside the square brackets [ ] in the Markdown source below:

  • I have added a description (see above).
  • I have added a link to any related issues (if applicable; see above).
  • I have read the Contributing Guide.
  • I have added tests for any new physics that this PR adds to the code.
  • (For quokka-astro org members) I have manually triggered the GPU tests with the magic comment /azp run.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. particles labels Mar 6, 2025
@chongchonghe
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Collaborator

@BenWibking BenWibking left a comment

Choose a reason for hiding this comment

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

Overall design looks good to me.

@chongchonghe chongchonghe requested a review from BenWibking March 6, 2025 23:29
Copy link

sonarqubecloud bot commented Mar 7, 2025

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 7, 2025
@chongchonghe chongchonghe enabled auto-merge March 7, 2025 01:22
@chongchonghe chongchonghe added this pull request to the merge queue Mar 7, 2025
Merged via the queue into development with commit 306cf35 Mar 7, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer particles size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants