32 const std::vector<Real> & x2,
33 const std::vector<std::vector<Real>> & y,
34 const std::vector<Real> & yx11 = std::vector<Real>(),
35 const std::vector<Real> & yx1n = std::vector<Real>(),
36 const std::vector<Real> & yx21 = std::vector<Real>(),
37 const std::vector<Real> & yx2n = std::vector<Real>());
44 void setData(
const std::vector<Real> & x1,
45 const std::vector<Real> & x2,
46 const std::vector<std::vector<Real>> & y,
47 const std::vector<Real> & yx11 = std::vector<Real>(),
48 const std::vector<Real> & yx1n = std::vector<Real>(),
49 const std::vector<Real> & yx21 = std::vector<Real>(),
50 const std::vector<Real> & yx2n = std::vector<Real>());
91 std::vector<Real>
_x1;
93 std::vector<Real>
_x2;
95 std::vector<std::vector<Real>>
_y;
137 std::vector<Real> & spline_eval,
138 std::vector<Real> & spline_second_derivs,
147 std::vector<Real> & spline_eval,
148 std::vector<Real> & spline_second_derivs,
This class interpolates tabulated functions with a bi-cubic spline.
virtual ~BicubicSplineInterpolation()=default
void setData(const std::vector< Real > &x1, const std::vector< Real > &x2, const std::vector< std::vector< Real > > &y, const std::vector< Real > &yx11=std::vector< Real >(), const std::vector< Real > &yx1n=std::vector< Real >(), const std::vector< Real > &yx21=std::vector< Real >(), const std::vector< Real > &yx2n=std::vector< Real >())
Set the x1, x2 and y values, and first derivatives at the edges.
std::vector< std::vector< Real > > _y_trans
Transpose of _y.
std::vector< std::vector< Real > > _y2_rows
Second derivatives.
Real sample2ndDerivative(Real x1, Real x2, unsigned int deriv_var, Real yp1=_deriv_bound, Real ypn=_deriv_bound)
Samples second derivative at point (x1, x2)
std::vector< Real > _column_spline_second_derivs
void sampleValueAndDerivatives(Real x1, Real x2, Real &y, Real &dy1, Real &dy2, Real yx11=_deriv_bound, Real yx1n=_deriv_bound, Real yx21=_deriv_bound, Real yx2n=_deriv_bound)
Samples value and first derivatives at point (x1, x2) Use this function for speed when computing both...
void constructColumnSpline(Real x2, std::vector< Real > &spline_eval, std::vector< Real > &spline_second_derivs, Real yx21=_deriv_bound, Real yx2n=_deriv_bound)
Helper functions to evaluate row splines and construct column spline for the given point.
BicubicSplineInterpolation()
Real sampleDerivative(Real x1, Real x2, unsigned int deriv_var, Real yp1=_deriv_bound, Real ypn=_deriv_bound)
Samples first derivative at point (x1, x2)
static int _file_number
File number for data dump.
std::vector< Real > _yx1n
Real sample(Real x1, Real x2, Real yx11=_deriv_bound, Real yx1n=_deriv_bound)
Samples value at point (x1, x2)
std::vector< Real > _yx21
void errorCheck()
Sanity checks on input data.
std::vector< Real > _column_spline_eval
std::vector< std::vector< Real > > _y2_columns
std::vector< Real > _x1
Independent values in the x1 direction.
void solve()
Calculates the tables of second derivatives.
std::vector< Real > _yx2n
std::vector< Real > _row_spline_second_derivs
Vectors used during sampling.
std::vector< Real > _yx11
Boundary conditions.
std::vector< Real > _x2
Independent values in the x2 direction.
std::vector< Real > _row_spline_eval
std::vector< std::vector< Real > > _y
The dependent values at (x1, x2) points.
void constructRowSplineSecondDerivativeTable()
Precompute tables of row (column) spline second derivatives and store them to reduce computational de...
void constructRowSpline(Real x1, std::vector< Real > &spline_eval, std::vector< Real > &spline_second_derivs, Real yx11=_deriv_bound, Real yx1n=_deriv_bound)
Helper functions to evaluate column splines and construct row spline for the given point.
void constructColumnSplineSecondDerivativeTable()
static const Real _deriv_bound