Make it possible to run Cholla with particles but no gravity #412
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
:Particles3D::initialize
expectedGrav3D&
as an argumentGrav3D&
to access spatial properties, it was relatively easy to changeSpatialDomainProps
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 ofGrav3D
to theParticles3D::initialize
Grav3D::Initialize
to acceptSpatialDomainProps
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:SpatialDomainProps
directly inside ofGrid3D
,Particle3D
, andGrav3D
rather than the current solution where we have 3 different approaches for storing the same data.SpatialDomainProps::Get_Position
(and haveGrid3D::Get_Position
forward ontoSpatialDomainProps::Get_Position
). An added bonus of doing this is we could consider supportingSpatialDomainProps::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 ofSpatialDomainProps
on GPUs, but that is very doable)Grid3D
,Grav3D
,Particle3D
, and reducing code duplication