SpECTRE
v2025.03.17
|
Performs linear interpolation in arbitrary dimensions. The class is non-owning and expects a C-ordered array, (n, x, y, z). The variable index, n, varies fastest in memory. Note that this class is intentionally non-pupable. More...
#include <MultiLinearSpanInterpolation.hpp>
Classes | |
struct | Weight |
Public Member Functions | |
size_t | extents (const size_t which_dimension) const |
void | extrapolate_above_data (const size_t which_dimension, const bool value) |
void | extrapolate_below_data (const size_t which_dimension, const bool value) |
Weight< 1 > | get_weights (const double x1) const |
Compute interpolation weights for 1D tables. | |
Weight< 2 > | get_weights (const double x1, const double x2) const |
Compute interpolation weights for 2D tables. | |
Weight< 3 > | get_weights (const double x1, const double x2, const double x3) const |
Compute interpolation weights for 3D tables. | |
double | interpolate (const Weight< Dimension > &weights, const size_t which_variable=0) const |
template<size_t... variables_to_interpolate> | |
std::array< double, sizeof...(variables_to_interpolate)> | interpolate (const Weight< Dimension > &weights) const |
template<size_t NumberOfVariablesToInterpolate, typename... T, Requires<(std::is_floating_point_v< typename std::remove_cv_t< T > > and ...)> = nullptr> | |
std::array< double, NumberOfVariablesToInterpolate > | interpolate (std::array< size_t, NumberOfVariablesToInterpolate > &variables_to_interpolate, const T &... target_points) const |
template<size_t NumberOfVariablesToInterpolate, size_t... I> | |
std::array< double, NumberOfVariablesToInterpolate > | interpolate (std::array< size_t, NumberOfVariablesToInterpolate > &variables_to_interpolate, std::array< double, Dimension > &target_points, std::index_sequence< I... >) const |
template<size_t NumberOfVariablesToInterpolate> | |
std::array< double, NumberOfVariablesToInterpolate > | interpolate (std::array< size_t, NumberOfVariablesToInterpolate > &variables_to_interpolate, std::array< double, Dimension > &target_points) const |
MultiLinearSpanInterpolation (std::array< gsl::span< const double >, Dimension > x_, gsl::span< const double > y_, Index< Dimension > number_of_points__) | |
double | lower_bound (const size_t which_dimension) const |
double | upper_bound (const size_t which_dimension) const |
Performs linear interpolation in arbitrary dimensions. The class is non-owning and expects a C-ordered array, (n, x, y, z). The variable index, n, varies fastest in memory. Note that this class is intentionally non-pupable.
Dimension | dimensionality of the table |
NumberOfVariables | number of variables stored in the table |
UniformSpacing | indicated whether the table has uniform _spacing or not. This is useful for performance reasons in finding the appropriate table index. |