Celeritas  0.5.0-86+4a8eea4
Public Member Functions | List of all members
celeritas::GenericGridInserter< Index > Class Template Reference

Construct a generic grid using mutable host data and add it to the specified grid collection. More...

#include <GenericGridInserter.hh>

Public Types

Type aliases
using SpanConstFlt = Span< float const >
 
using SpanConstDbl = Span< double const >
 
using RealCollection = Collection< real_type, Ownership::value, MemSpace::host >
 
using GenericGridCollection = Collection< GenericGridRecord, Ownership::value, MemSpace::host, Index >
 

Public Member Functions

 GenericGridInserter (RealCollection *real_data, GenericGridCollection *grid)
 Construct with a reference to mutable host data.
 
Index operator() (SpanConstFlt grid, SpanConstFlt values)
 Add a grid of generic data with linear interpolation to the collection.
 
Index operator() (SpanConstDbl grid, SpanConstDbl values)
 Add a grid of generic data with linear interpolation to the collection.
 
Index operator() (ImportPhysicsVector const &vec)
 Add an imported physics vector as a generic grid to the collection. More...
 
Index operator() ()
 Add an empty grid. More...
 

Detailed Description

template<class Index>
class celeritas::GenericGridInserter< Index >

Construct a generic grid using mutable host data and add it to the specified grid collection.

GenericGridInserter insert(&data->reals, &data->generic_grids);
std::vector<GenericGridIndex> grid_ids;
for (material : range(MaterialId{mats->size()}))
grid_ids.push_back(insert(physics_vector[material.get()]));
CELER_CONSTEXPR_FUNCTION Range< T > range(T begin, T end)
Return a range over fixed beginning and end values.
Definition: Range.hh:190
GenericGridInserter(RealCollection *real_data, GenericGridCollection *grid)
Construct with a reference to mutable host data.
Definition: GenericGridInserter.hh:77

Member Function Documentation

◆ operator()() [1/2]

template<class Index >
auto celeritas::GenericGridInserter< Index >::operator()

Add an empty grid.

Useful for when there's no imported grid present for a given material.

◆ operator()() [2/2]

template<class Index >
auto celeritas::GenericGridInserter< Index >::operator() ( ImportPhysicsVector const &  vec)

Add an imported physics vector as a generic grid to the collection.

Returns the id of the inserted grid, or an empty id if the vector is empty.


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