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

Named Particle SoA Components #3614

Open
ax3l opened this issue Nov 5, 2023 · 1 comment
Open

Named Particle SoA Components #3614

ax3l opened this issue Nov 5, 2023 · 1 comment
Assignees

Comments

@ax3l
Copy link
Member

ax3l commented Nov 5, 2023

X-ref:

It would be nice if AMReX supported the functionality to name particle attributes (as strings). In WarpX, we added this as NamedParticleContainer, but as a mainstream implementation we could avoid deriving yet another class type (because if we do, we will again have additional compile-time to bind that custom type in pyAMReX), and instead could just extend the particle classes with these runtime details.

@ax3l
Copy link
Member Author

ax3l commented Apr 1, 2024

@atmyers volunteered to take this on 🙏 We decided to only add naming arrays for SoA (compile-time and runtime) particle components.

Examples

Here is an example of methods that we will need from ImpactX:

WarpX uses this earlier implementation:

Performance Note

Please also add two signature of the form

AddRealComp(name, comm);
AddRealComp({name1, name2, ...}, {comm1, comm2, comm3}); // or as pairs?

so people can avoid double resizes (#3615 #3861). (Same for Int.)

Deprecation

Please mark the old signature (w/o names) as deprecated - everyone can use the new signature without a problem: even if they do not use the name, this will make code more self-describing.

Default Names

As default names for the compile-time components and old Add..Comp signatures, I suggest to use the same naming scheme as in https://github.com/AMReX-Codes/pyamrex/blob/development/src/amrex/StructOfArrays.py

Tests

Currently, there are no systematic tests in AMReX CI that add (and remove #3595) runtime components to containers and then use these containers (e.g., copy from, redistribute, etc.). Such tests need to be added to ensure correctness and stability.

We currently do not cover the case where we add runtime components before the dummy multifab has been defined.

@ax3l ax3l changed the title Named Particle Attributes Named Particle SoA Attributes Apr 1, 2024
@ax3l ax3l changed the title Named Particle SoA Attributes Named Particle SoA Components Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants