Celeritas 0.6.0-rc.2.13+develop.285b9112
Loading...
Searching...
No Matches
Classes | Functions
FindInterp.hh File Reference
#include "corecel/Assert.hh"
#include "corecel/Macros.hh"
#include "corecel/Types.hh"
This graph shows which files directly or indirectly include this file:

Classes

struct  celeritas::FindInterp< T >
 Result of finding a point on a grid for interpolating. More...
 

Functions

template<class T >
CELER_FUNCTION celeritas::FindInterp (size_type, T) -> FindInterp< T >
 
template<class Grid >
CELER_FUNCTION auto celeritas::find_interp (Grid const &grid, typename Grid::value_type value)
 Find the index of the value and its fraction between neighboring points.
 

Function Documentation

◆ find_interp()

template<class Grid >
CELER_FUNCTION auto celeritas::find_interp ( Grid const grid,
typename Grid::value_type  value 
)
inline

Find the index of the value and its fraction between neighboring points.

The grid class should have a floating point value and must have methods find, front, back, and operator[] .

The value must be bounded by the grid and less than the final value. The result will always have an index such that its neighbor to the right is a valid point on the grid, and the fraction between neghbors may be zero (in the case where the value is exactly on a grid point) but is always less than one. If the requested point is exactly on a coincident grid point, the lower point and a fraction of zero will result.