parthenon-hpc-lab / parthenon

Parthenon AMR infrastructure
https://parthenon-hpc-lab.github.io/parthenon/
Other
112 stars 34 forks source link

Support for multiple types of `MeshBlockData` #744

Open lroberts36 opened 2 years ago

lroberts36 commented 2 years ago

There are a number of use cases for allowing for multiple types of variables (e.g. mixed precision solvers, flagging). During the 2022 Parthenon meeting, a discussion was had about the best path for implementing this and what the needs of various users were. The consensus was that this is straightforward to implement, but it is not currently high priority. Some thoughts:

brryan commented 2 years ago

One small concern: If we require specifying types through Metadata then won't downstream developers be unable to enroll types that aren't already hardcoded into parthenon, for example a downstream code-specific enum? I think this wouldn't be a concern if we instead specifed type via a template parameter on the AddField function.

lroberts36 commented 2 years ago

I was thinking that there might be some clever way to store a generic type in the metadata (not sure if this is possible? although my general belief is that all is possible in c++ at compile time), rather than doing this through metadata flags.