Celeritas  0.5.0-56+6b053cd
Public Member Functions | List of all members
celeritas::GridIdFinder< KeyQuantity, ValueId > Class Template Reference

Map an input grid to an ID type, returning invalid ID if outside bounds. More...

#include <GridIdFinder.hh>

Public Types

Type aliases
using argument_type = KeyQuantity
 
using result_type = ValueId
 
using SpanConstGrid = LdgSpan< typename KeyQuantity::value_type const >
 
using SpanConstValue = LdgSpan< result_type const >
 

Public Member Functions

CELER_FUNCTION GridIdFinder (SpanConstGrid, SpanConstValue)
 Construct from grid and values. More...
 
CELER_FUNCTION result_type operator() (argument_type arg) const
 Find the ID corresponding to the given value.
 

Detailed Description

template<class KeyQuantity, class ValueId>
class celeritas::GridIdFinder< KeyQuantity, ValueId >

Map an input grid to an ID type, returning invalid ID if outside bounds.

The input grid should be a monotonic increasing series, and the corresponding ID values should be one fewer (cell-centered data). Values outside the grid bounds are unassigned, and grid points are attached to the model ID above the corresponding value.

GridIdFinder<MevEnergy, ActionId> find_model(energy, values);
ActionId applicable_model = find_model(particle.energy());
OpaqueId< class ActionInterface > ActionId
Within-step action to apply to a track.
Definition: ThreadId.hh:26

Constructor & Destructor Documentation

◆ GridIdFinder()

template<class K , class V >
CELER_FUNCTION celeritas::GridIdFinder< K, V >::GridIdFinder ( SpanConstGrid  grid,
SpanConstValue  value 
)
inline

Construct from grid and values.

Todo:
Construct from reference to collections and ranges so we can benefit from __ldg as needed

The documentation for this class was generated from the following file: