stfc / HartreeParticleDSL

MIT License
1 stars 1 forks source link

Get pointer to particle data. #28

Closed LonelyCat124 closed 2 years ago

LonelyCat124 commented 3 years ago

To interact/couple with other libraries we need to be able to pass pointers to particle data.

Backends should have a get_pointer argument which takes a string. It checks whether that is an element of the particle, and then returns the language-specific pointer. I need to work out whether this should be a user-called function or a coupler/backend/? called function.

LonelyCat124 commented 3 years ago

Actually I think t his is better to be passed some generated code, e.g.:

part1.core_part.velocity[i]

is converted by the C_AOS backend to:

particles[part1].core_part.velocity[i]

and then if some section of code calls get_pointer on that, then the C_AOS backend returns:

&particles[part1].core_part.velocity[i]
LonelyCat124 commented 3 years ago

This is slightly tricky to do - the current implementation is not good, and requires improved language calling functionality