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

Integration of Constants into AoSoA Arrays: Seeking Guidance on Approach #750

Open
dineshadepu opened this issue Apr 30, 2024 · 2 comments
Labels
feature-request question Further information is requested

Comments

@dineshadepu
Copy link
Contributor

Hi all,

Is there a way to add constants to the AoSoA array? Currently, when creating an AoSoA, we assign a property to each particle. However, I have a few properties that apply to the entire group of particles and have a length of 3, such as the center of mass. If these constants were stored in the AoSoA and passed around to functions, it would simplify the computation of interactions among the particles using these constants. Otherwise, I have to create these arrays separately on the GPU and pass them to the function for computing interactions.

Does my approach seem sensible? Or is passing these arrays separately a more idiomatic way to approach this in Cabana?

Thank you very much for your help!

@streeve streeve added the question Further information is requested label Apr 30, 2024
@streeve
Copy link
Member

streeve commented May 2, 2024

For now, you could certainly build a Kokkos::Array or Kokkos::View for those parameters as you mentioned. I think it's reasonable to consider a particle type-mapping being included in a new Cabana object, but I don't think the AoSoA is the right place. That new class would just hold both the AoSoA particle data and the type map and a few convenience functions to enable treating those just like other particle data. I'll link to this issue if I make any progress on this

@dineshadepu
Copy link
Contributor Author

Thank you. I will keep an eye out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants