celeritas icon indicating copy to clipboard operation
celeritas copied to clipboard

Generalize along-step kernels

Open sethrj opened this issue 3 years ago • 4 comments

Currently we use the same along-step kernel (including slowing down and field propagation) for all particle types, all energies, all regions. It's probably silly to use the field propagator to move a neutral particle (but at least it works!), we'll likely need to have different slowing-down models for different energy regimes, and we need to support more extensible per-region fields and settings. (Neutral vs "user" action is supported as of #745.)

We will partition the multi-D {particle, energy, region} space into blocks of AlongStepIds, each of which has an MscId, PropagationId, and ElossId. This will allow users to define easy host-side schemes to select a kernel (e.g., looping over particle types and setting different kernels for charged and neutral).

Execution plan

  • [ ] Define Celeritas regions, replacing GeoMaterialData #983
  • [ ] Import regions (and build mag field regions) from Geant4
  • [ ] Build ragged region+particle+energy mapper class (note: may use in future for selecting physics model?)
  • [ ] Add along-step parent class with basic interface, for now taking existing along-step actions and (during execute) setting along-step action IDs (replacing the last bit of PreStepExecutor)
  • [ ] Remove volume-specific field from uniform propagator
  • [ ] Split along-step actions into propagator/eloss/msc with kernels in between

Current kernels

Kernel CylMapFieldMsc RZMapFieldMsc UniformMsc GeneralLinear Neutral
limit-step-msc-urban [^] ✓* ✓* ✓*  
propagate-cylmap        
propagate-rzmap        
propagate-uniform        
propagate-linear     ✓* ✓†[^†]
scatter-msc-urban ✓* ✓* ✓* ✓*  
update-time ✓†
apply-eloss-fluct ✓* ✓* ✓* ✓*  
apply-eloss-mean ✓* ✓* ✓* ✓*  
update-track ✓†

[^*]: * Conditional
[^†]: Combined into a single kernel on GPU

sethrj avatar Nov 01 '22 12:11 sethrj

Note that we should probably add regions (set of volumes) instead of materials; and then refactor our cutoff/materials so that materials can be reused across regions with different cutoffs.

sethrj avatar Apr 13 '23 17:04 sethrj

@amandalund This is what I had in mind for having separate MSC methods as a function of energy. With the speedup we saw from breaking the along-step kernels in to smaller kernels, though, we may want to group tracks by propagation sub-kernel first, and then have a secondary set of kernels for the different MSC regimes.

sethrj avatar Jun 30 '23 11:06 sethrj