Celeritas  0.5.0-86+4a8eea4
Public Member Functions | List of all members
celeritas::SplineXsCalculator Class Reference

Find and interpolate cross sections on a uniform log grid with an input spline-order. More...

#include <SplineXsCalculator.hh>

Public Types

Type aliases
using Energy = Quantity< XsGridData::EnergyUnits >
 
using Values = Collection< real_type, Ownership::const_reference, MemSpace::native >
 

Public Member Functions

CELER_FUNCTION SplineXsCalculator (XsGridData const &grid, Values const &values, size_type const order)
 Construct from cross section data.
 
CELER_FUNCTION real_type operator() (Energy energy) const
 Calculate the cross section. More...
 
CELER_FUNCTION real_type operator[] (size_type index) const
 Get the cross section at the given index.
 
CELER_FUNCTION Energy energy_min () const
 
CELER_FUNCTION Energy energy_max () const
 

Detailed Description

Find and interpolate cross sections on a uniform log grid with an input spline-order.

Todo:
Currently this is hard-coded to use "cross section grid data" which have energy coordinates uniform in log space. This should be expanded to handle multiple parameterizations of the energy grid (e.g., arbitrary spacing needed for the Livermore sampling) and of the value interpolation (e.g. log interpolation). It might also make sense to get rid of the "prime energy" and just use log-log interpolation instead, or do a piecewise change in the interpolation instead of storing the cross section scaled by the energy.
SplineXsCalculator calc_xs(xs_grid, xs_params.reals, order);
real_type xs = calc_xs(particle);
CELER_FUNCTION SplineXsCalculator(XsGridData const &grid, Values const &values, size_type const order)
Construct from cross section data.
Definition: SplineXsCalculator.hh:92
double real_type
Numerical type for real numbers.
Definition: corecel/Types.hh:35

Member Function Documentation

◆ operator()()

CELER_FUNCTION real_type celeritas::SplineXsCalculator::operator() ( Energy  energy) const
inline

Calculate the cross section.

If needed, we can add a "log(energy/MeV)" accessor if we constantly reuse that value and don't want to repeat the std::log operation.


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