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

Make it possible to run Cholla with particles but no gravity #412

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

mabruzzo
Copy link
Collaborator

@mabruzzo mabruzzo commented Jul 26, 2024

Overview

This PR makes it possible to run Cholla in a configuration where hydro and particles are enabled while gravity is disabled. This is useful for testing feedback.

A number of small, simple changes were required. These are mostly self-explanatory.

The most important change relates to Particles3D::initialize:

  • previously Particles3D::initialize expected Grav3D& as an argument
  • since the function only used Grav3D& to access spatial properties, it was relatively easy to change
  • I created the new SpatialDomainProps class to be used to convey spatial properties of the grid. It provides a method to create a fresh instance by reading the spatial properties from the main grid object. We now pass this object in place of Grav3D to the Particles3D::initialize
  • While I was making these changes, I also modified Grav3D::Initialize to accept SpatialDomainProps as an argument rather than passing all of the details as individual arguments.

Future Ideas

Ultimately, in the future, I think it would be great to make the SpatialDomainProps class take on more importance:

  • I think it would be great to directly store instances of SpatialDomainProps directly inside of Grid3D, Particle3D, and Grav3D rather than the current solution where we have 3 different approaches for storing the same data.
  • I also think it would be great to create SpatialDomainProps::Get_Position (and have Grid3D::Get_Position forward onto SpatialDomainProps::Get_Position). An added bonus of doing this is we could consider supporting SpatialDomainProps::Get_Position on GPUs (frankly, we might want to do a little more refactoring in that case so we don't need to copy the entirety of SpatialDomainProps on GPUs, but that is very doable)
  • Overall, I think this would be a great step towards reducing the complexity of Grid3D, Grav3D, Particle3D, and reducing code duplication

@mabruzzo mabruzzo marked this pull request as ready for review July 26, 2024 16:54
@mabruzzo mabruzzo changed the title WIP: make it possible to run Cholla with particles but no gravity Make it possible to run Cholla with particles but no gravity Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant