https://mooseframework.inl.gov
SplineInterpolation.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
13 #include <string>
14 
21 {
22 public:
33  SplineInterpolation(const std::vector<Real> & x,
34  const std::vector<Real> & y,
35  Real yp1 = _deriv_bound,
36  Real ypn = _deriv_bound);
37 
38  virtual ~SplineInterpolation() = default;
39 
43  void setData(const std::vector<Real> & x,
44  const std::vector<Real> & y,
45  Real yp1 = _deriv_bound,
46  Real ypn = _deriv_bound);
47 
48  void errorCheck();
49 
54  Real sample(Real x) const;
55  ADReal sample(const ADReal & x) const;
56 
57  Real sampleDerivative(Real x) const;
58 
59  Real sample2ndDerivative(Real x) const;
60 
65  unsigned int getSampleSize();
66 
67  Real domain(int i) const;
68  Real range(int i) const;
69 
70 protected:
71  std::vector<Real> _x;
72  std::vector<Real> _y;
76  std::vector<Real> _y2;
77 
78  void solve();
79 
80  static int _file_number;
81 };
Real sample(Real x) const
This function will take an independent variable input and will return the dependent variable based on...
Real _yp1
boundary conditions
DualNumber< Real, DNDerivativeType, true > ADReal
Definition: ADRealForward.h:47
void setData(const std::vector< Real > &x, const std::vector< Real > &y, Real yp1=_deriv_bound, Real ypn=_deriv_bound)
Set the x-, y- values and first derivatives.
Real domain(int i) const
unsigned int getSampleSize()
This function returns the size of the array holding the points, i.e.
std::vector< Real > _y2
Second derivatives.
std::vector< Real > _x
std::vector< Real > _y
Real sample2ndDerivative(Real x) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real sampleDerivative(Real x) const
Real range(int i) const
virtual ~SplineInterpolation()=default
This class interpolates tabulated functions with cubic splines.