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

Find and do bilinear interpolation on a nonuniform 2D grid of reals. More...

#include <TwodGridCalculator.hh>

Public Types

Type aliases
using Point = Array< real_type, 2 >
 
using Values = Collection< real_type, Ownership::const_reference, MemSpace::native >
 

Public Member Functions

CELER_FUNCTION TwodGridCalculator (TwodGridData const &grid, Values const &storage)
 Construct with grids and node-centered data.
 
CELER_FUNCTION real_type operator() (Point const &xy) const
 Calculate the value at the given (x, y) coordinates. More...
 
CELER_FUNCTION TwodSubgridCalculator operator() (real_type x) const
 Get an interpolator for a preselected x value.
 

Detailed Description

Find and do bilinear interpolation on a nonuniform 2D grid of reals.

Values should be node-centered, at the intersection of the two grids.

TwodGridCalculator calc(grid, params.reals);
real_type interpolated = calc({energy.value(), exit});
// Or if the incident energy is reused...
auto calc2 = calc(energy.value());
interpolated = calc2(exit);
CELER_FUNCTION TwodGridCalculator(TwodGridData const &grid, Values const &storage)
Construct with grids and node-centered data.
Definition: TwodGridCalculator.hh:65
double real_type
Numerical type for real numbers.
Definition: corecel/Types.hh:35

Member Function Documentation

◆ operator()()

CELER_FUNCTION real_type celeritas::TwodGridCalculator::operator() ( Point const &  inp) const
inline

Calculate the value at the given (x, y) coordinates.

The coordinates must be inside \(0 <= x < x_\mathrm{max}\) and \(0 <= y < y_\mathrm{max}\).

Todo:
We may need to add logic inside the axis loop to account for points outside the grid.

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