www.mooseframework.org
BicubicSplineInterpolation.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef BICUBICSPLINEINTERPOLATION_H
16 #define BICUBICSPLINEINTERPOLATION_H
17 
19 
29 {
30 public:
37  BicubicSplineInterpolation(const std::vector<Real> & x1,
38  const std::vector<Real> & x2,
39  const std::vector<std::vector<Real>> & y,
40  const std::vector<Real> & yx11 = std::vector<Real>(),
41  const std::vector<Real> & yx1n = std::vector<Real>(),
42  const std::vector<Real> & yx21 = std::vector<Real>(),
43  const std::vector<Real> & yx2n = std::vector<Real>());
44 
45  virtual ~BicubicSplineInterpolation() = default;
46 
50  void setData(const std::vector<Real> & x1,
51  const std::vector<Real> & x2,
52  const std::vector<std::vector<Real>> & y,
53  const std::vector<Real> & yx11 = std::vector<Real>(),
54  const std::vector<Real> & yx1n = std::vector<Real>(),
55  const std::vector<Real> & yx21 = std::vector<Real>(),
56  const std::vector<Real> & yx2n = std::vector<Real>());
57 
58  void errorCheck();
59 
60  Real sample(Real x1, Real x2, Real yx11 = _deriv_bound, Real yx1n = _deriv_bound);
61  Real sampleDerivative(
62  Real x1, Real x2, unsigned int deriv_var, Real yp1 = _deriv_bound, Real ypn = _deriv_bound);
64  Real x1, Real x2, unsigned int deriv_var, Real yp1 = _deriv_bound, Real ypn = _deriv_bound);
65 
66 protected:
67  std::vector<Real> _x1;
68  std::vector<Real> _x2;
69  std::vector<std::vector<Real>> _y;
71  std::vector<std::vector<Real>> _y_trans;
72 
79  std::vector<Real> _yx11;
80  std::vector<Real> _yx1n;
81  std::vector<Real> _yx21;
82  std::vector<Real> _yx2n;
83 
85  std::vector<std::vector<Real>> _y2_rows;
86  std::vector<std::vector<Real>> _y2_columns;
87 
90  void solve();
91 
92  static int _file_number;
93 };
94 
95 #endif
Real sample(Real x1, Real x2, Real yx11=_deriv_bound, Real yx1n=_deriv_bound)
virtual ~BicubicSplineInterpolation()=default
std::vector< std::vector< Real > > _y_trans
Transpose of _y.
std::vector< std::vector< Real > > _y
Real sampleDerivative(Real x1, Real x2, unsigned int deriv_var, Real yp1=_deriv_bound, Real ypn=_deriv_bound)
std::vector< Real > _yx11
Boundary conditions.
std::vector< std::vector< Real > > _y2_rows
Second derivatives.
This class interpolates tabulated functions with a bi-cubic spline.
Real sample2ndDerivative(Real x1, Real x2, unsigned int deriv_var, Real yp1=_deriv_bound, Real ypn=_deriv_bound)
std::vector< std::vector< Real > > _y2_columns
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, y- values and first derivatives.