-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add SwarmPacks #1037
Add SwarmPacks #1037
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am super happy to see this be added! Worth noting it does break downstream because you moved where swarms live to be in meshblock data (which is where they belong). Comments below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a brief first read, this looks great to me so far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this LGTM. Some small non-blocking questions/comments below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still have some minor nitpicks but nothing I would call blocking. Thanks for this cleanup @pdmullen it's really great to have swarm packs.
FYI I'm happy with the discussion and don't plan a detailed review. So just go ahead an merge when everyone is happy. |
This MR introduces the notion of a
SwarmPack
. It is a stripped down version ofSparsePack
, tuned towards particle swarms, to enable packing overMeshBlock
s. I have preliminarily settled on a design wherein one can pack aSwarmPack
via astd::vector<std::string>
or the type-based variable prescription previously used inSparsePack
s.SwarmPack
s are unique fromSparsePack
s in that we must be able to handle bothReal
andinteger
types. In this MR, I do not allowSwarmPack
s to contain mixed types, however, one can create a pack ofReal
swarm variables and a separate pack forint
swarm variables. The design follows:by
std::vector<std::string>
(where the template argument specifies that the data type):by type-based vars (where the data type is inferred from var-types):
There are so many opportunities to further clean up things here... One could imagine (1) allowing mixed types in packs, (2) allowing for packing via Metadata or regex, or (4) combining
SparsePack
s andSwarmPack
s, to name a few.This MR adds the
SwarmPack
machinery to theparticle_leapfrog
test.Finally, I'd note that this MR also transitions
swarm_data
to belong tomeshblock_data
rather thanpmb
. This likely has consequence when considering copies ofmesh_data
registers (e.g., in RK staging). Any undesired manifestations from this change should be uncovered as we continue to test downstream. For one, the current design requires that downstream users interface with particles via thebase
mesh_data
register.PR Checklist
SwarmPack
s (cache cleared wheneverSwarm::setPoolMax
is called)