celeritas-project / celeritas

Celeritas is a new Monte Carlo transport code designed to accelerate scientific discovery in high energy physics by improving detector simulation throughput and energy efficiency using GPUs.
https://celeritas-project.github.io/celeritas/user/index.html
Other
62 stars 33 forks source link

Refactor GenericGrid classes to more closely mimic behavior of ValueGrid classes #1299

Closed hhollenb closed 2 months ago

hhollenb commented 3 months ago

Initially, the GenericGridBuilder was designed to accept a scalar Collection that it would immediately populate with generic grid data, and return a GenericGridData. This is the opposite of the ValueGridBuilder which we use in StepLimitBuilders, which caches the grids to be built and then populates a Collection when a ValueGridInserter is supplied. I later added the GenericGridInserter on top of this to combine the steps of building a GenericGridData grid and putting it into a grid Collection, returning its new ID in the collection.

To have optical physics more closely mimic the conventions of core physics, I've refactored some of the GenericGrid classes. All classes called Builder are now intermediate objects which will later supply their grids to classes called Inserter, which are responsible for the actual population of grids in a given Collection.

Appropriate changes in existing code have been made to use the right classes.

sethrj commented 3 months ago

Oh nooooo I thought we talked about this at the hackathon, but the "inserter" stuff is legacy crap that we used to populate data before we had Collections. I'll take a look at this later but we want to change the physics code (which is basically the oldest in our code base) to be more like the more contemporary code... this is the danger of not updating (or at least warning about!) obsolete code 😞