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

SoA: InitRandom/OnePerCell #3280

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Apr 27, 2023

Summary

Support more init methods on SoA particle containers.

Additional background

Follow-up to #2878.
Needed for AMReX-Codes/pyamrex#124

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

@ax3l ax3l mentioned this pull request May 26, 2023
7 tasks
@ax3l ax3l force-pushed the topic-soa-init-particle branch 8 times, most recently from a2420d6 to 0d800a5 Compare May 30, 2023 22:25
p.pos(0) = static_cast<ParticleReal>(grid_box.lo(0) + (dist(mt) + icnt) / icount_per_box * grid_box.length(0));
p.pos(1) = static_cast<ParticleReal>(grid_box.lo(1) + (dist(mt) + jcnt) / icount_per_box * grid_box.length(1));
p.pos(2) = static_cast<ParticleReal>(grid_box.lo(2) + (dist(mt) + kcnt) / icount_per_box * grid_box.length(2));
// the position data
Copy link
Member Author

@ax3l ax3l May 30, 2023

Choose a reason for hiding this comment

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

I think InitRandomPerBox needs a bigger rewrite.

@ax3l ax3l force-pushed the topic-soa-init-particle branch from 0d800a5 to 54d0623 Compare May 30, 2023 22:29
@@ -60,8 +60,8 @@
}

// Add some particles
constexpr int NReal = 12;
constexpr int NInt = 4;
constexpr int NReal = AMREX_SPACEDIM + 12;

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable NReal is not used.
constexpr int NReal = 12;
constexpr int NInt = 4;
constexpr int NReal = AMREX_SPACEDIM + 12;
constexpr int NInt = 2 + 4;

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable NInt is not used.
@ax3l ax3l changed the title [WIP] SoA: InitRandom/RandomPerBox/OnePerCell SoA: InitRandom/OnePerCell Jun 6, 2023
Support more init methods on SoA particle containers.
@ax3l ax3l force-pushed the topic-soa-init-particle branch from 54d0623 to d2aa914 Compare June 6, 2023 06:49
@ax3l
Copy link
Member Author

ax3l commented Jun 6, 2023

@atmyers @AlexanderSinn ready to review & merge :)

This should help with #3290

InitRandomPerBox can be done in a follow-up.

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.

None yet

2 participants