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.
Add a simple inserter for generic grids, similar to ValueGridInserter. I use this for constructing the step limit grids for optical processes, but it can probably be reviewed separately since we'll want to use it in more than one place. Since ValueGridBuilder handles grids differently than GenericGridBuilder, we can't just copy the ValueGridInserter implementation.
The main idea is to handle the GenericGridBuilder and CollectionBuilder that the grids are being inserted into as a single object, making it easy to pass this data to processes and have them build their grids directly instead of having to manage both the mutable scalar host data (which is an implementation detail) as well as constructing the generic grid collection. Currently I have it templated on the collection index type so it's usable by more collections.
I wrote a trivial change for CerenkovParams.cc to use GenericGridInserter as an example and to make sure it passed a simple test. The same can't be done for ScintillationParams.cc since per particle grids are encapsulated in another data structure before being added to a particle-indexed collection.
Add a simple inserter for generic grids, similar to
ValueGridInserter
. I use this for constructing the step limit grids for optical processes, but it can probably be reviewed separately since we'll want to use it in more than one place. SinceValueGridBuilder
handles grids differently thanGenericGridBuilder
, we can't just copy theValueGridInserter
implementation.The main idea is to handle the
GenericGridBuilder
andCollectionBuilder
that the grids are being inserted into as a single object, making it easy to pass this data to processes and have them build their grids directly instead of having to manage both the mutable scalar host data (which is an implementation detail) as well as constructing the generic grid collection. Currently I have it templated on the collection index type so it's usable by more collections.I wrote a trivial change for
CerenkovParams.cc
to useGenericGridInserter
as an example and to make sure it passed a simple test. The same can't be done forScintillationParams.cc
since per particle grids are encapsulated in another data structure before being added to a particle-indexed collection.