Skip to content

Use PolymorphicArenaAllocator in the SOAParticle test#4859

Merged
ax3l merged 1 commit intoAMReX-Codes:developmentfrom
atmyers:polymorphic_pc_test
Jan 5, 2026
Merged

Use PolymorphicArenaAllocator in the SOAParticle test#4859
ax3l merged 1 commit intoAMReX-Codes:developmentfrom
atmyers:polymorphic_pc_test

Conversation

@atmyers
Copy link
Copy Markdown
Member

@atmyers atmyers commented Dec 18, 2025

This expands the coverage to include the C++ version of the functionality.

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

@atmyers atmyers requested a review from ax3l December 18, 2025 19:23
@ax3l ax3l self-assigned this Jan 5, 2026
@ax3l ax3l added the test label Jan 5, 2026
Copy link
Copy Markdown
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

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

Thank you! :)

using namespace amrex;

template <typename T_PC,template<class> class Allocator=DefaultAllocator>
template <typename T_PC,template<class> class Allocator=amrex::PolymorphicArenaAllocator>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks like an unused template parameter to me...?

Suggested change
template <typename T_PC,template<class> class Allocator=amrex::PolymorphicArenaAllocator>
template <typename T_PC>

DistributionMapping dm(ba);

T_PC pc(geom, dm, ba);
pc.SetArena(The_Arena());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@atmyers what happens if someone changes the addParticles<...> template parameter to anything but amrex::PolymorphicArenaAllocator and tries to call SetArena()?

Just a test, but a bit funny.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It does nothing

@ax3l ax3l merged commit 373c071 into AMReX-Codes:development Jan 5, 2026
73 checks passed
ankithadas pushed a commit to ankithadas/amrex that referenced this pull request Jan 7, 2026
This expands the coverage to include the C++ version of the
functionality.

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
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.

3 participants