Skip to content

Support randomized particle locations at t=0#389

Merged
JamesMcClung merged 11 commits intopsc-code:mainfrom
JamesMcClung:pr/randomize-prts
Mar 23, 2026
Merged

Support randomized particle locations at t=0#389
JamesMcClung merged 11 commits intopsc-code:mainfrom
JamesMcClung:pr/randomize-prts

Conversation

@JamesMcClung
Copy link
Collaborator

Add the random_offsets boolean field to SetupParticles, which is false by default. When enabled, particles' initial positions are randomized within a cell instead of being centered. Locations of particles from different species are exactly correlated, so rho=0 as long as there is one positive and one negative species with equal densities. A warning is always emitted when this feature is used.

Also add a test to check that rho=0 when random offsets are enabled.

@germasch germasch force-pushed the pr/randomize-prts branch from 17913f0 to 3b245dd Compare March 19, 2026 13:15
Copy link
Contributor

@germasch germasch left a comment

Choose a reason for hiding this comment

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

Looks great to me. I was going to suggest to test that one really ends up neutral, but then saw you added that already 👍

@JamesMcClung JamesMcClung merged commit df9f2bf into psc-code:main Mar 23, 2026
2 of 3 checks passed
@JamesMcClung JamesMcClung deleted the pr/randomize-prts branch March 23, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants