Celeritas  0.5.0-56+6b053cd
Public Member Functions | List of all members
celeritas::TwodSubgridCalculator Class Reference

Do bilinear interpolation on a 2D grid with the x value preselected. More...

#include <TwodSubgridCalculator.hh>

Public Types

Type aliases
using Values = Collection< real_type, Ownership::const_reference, MemSpace::native >
 
using InterpT = FindInterp< real_type >
 

Public Member Functions

CELER_FUNCTION TwodSubgridCalculator (TwodGridData const &grid, Values const &storage, InterpT x_loc)
 Construct with grid data, backend values, and lower X data. More...
 
CELER_FUNCTION real_type operator() (real_type y) const
 Calculate the value at the given y coordinate for preselected x. More...
 
CELER_FORCEINLINE_FUNCTION size_type x_index () const
 Index of the preselected lower x value.
 
CELER_FORCEINLINE_FUNCTION real_type x_fraction () const
 Fraction between the lower and upper x grid values.
 

Detailed Description

Do bilinear interpolation on a 2D grid with the x value preselected.

This is usually not called directly but rather given as the return result of the TwodGridCalculator.

Constructor & Destructor Documentation

◆ TwodSubgridCalculator()

CELER_FUNCTION celeritas::TwodSubgridCalculator::TwodSubgridCalculator ( TwodGridData const &  grids,
Values const &  storage,
InterpT  x_loc 
)
inline

Construct with grid data, backend values, and lower X data.

This is typically constructed from a TwodGridCalculator. The interpolated x location could be extended to allow a fractional value of 1 to support interpolating on the highest value of the x grid.

Member Function Documentation

◆ operator()()

CELER_FUNCTION real_type celeritas::TwodSubgridCalculator::operator() ( real_type  y) const
inline

Calculate the value at the given y coordinate for preselected x.

This uses bilinear interpolation and and therefore exactly represents functions that are a linear combination of 1, x, y, and xy.


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