https://mooseframework.inl.gov
Loading...
Searching...
No Matches
BilinearInterpolation.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
12// MOOSE includes
13#include "ColumnMajorMatrix.h"
15
16// C++ includes
17#include <vector>
18
38{
39public:
46 BilinearInterpolation(const std::vector<Real> & xaxis,
47 const std::vector<Real> & yaxis,
48 const ColumnMajorMatrix & zsurface);
49
50 virtual ~BilinearInterpolation() = default;
51
56 Real sample(const Real s1, const Real s2) const override;
57 ADReal sample(const ADReal & s1, const ADReal & s2) const override;
58 ChainedReal sample(const ChainedReal & s1, const ChainedReal & s2) const override;
59
63 Real sampleDerivative(const Real s1, const Real s2, unsigned int deriv_var) const override;
64 ADReal
65 sampleDerivative(const ADReal & s1, const ADReal & s2, unsigned int deriv_var) const override;
67 const ChainedReal & s2,
68 unsigned int deriv_var) const override;
69
72 Real s1, Real s2, Real & y, Real & dy_ds1, Real & dy_ds2) const override;
73
74 void getNeighborIndices(const std::vector<Real> & inArr,
75 Real x,
76 unsigned int & lowerX,
77 unsigned int & upperX) const;
78
79private:
81 template <typename T>
82 T sampleInternal(const T & s1, const T & s2) const;
83
84 template <typename T>
85 T sampleDerivativeInternal(const T s1, const T s2, const unsigned int deriv_var) const;
86
88 static int _file_number;
89};
DualNumber< Real, DNDerivativeType, true > ADReal
DualNumber< Real, Real > ChainedReal
Definition ChainedReal.h:30
This class interpolates tabulated data with a Bidimension function (either bicubic or bilinear).
virtual void sampleValueAndDerivatives(Real, Real, Real &, Real &, Real &) const
Samples value and first derivatives at point (x1, x2) Use this function for speed when computing both...
This class applies the Least Squares algorithm to a set of points to provide a smooth curve for sampl...
Real sample(const Real s1, const Real s2) const override
This function will take an independent variable input and will return the dependent variable based on...
void getNeighborIndices(const std::vector< Real > &inArr, Real x, unsigned int &lowerX, unsigned int &upperX) const
T sampleDerivativeInternal(const T s1, const T s2, const unsigned int deriv_var) const
void sampleValueAndDerivatives(Real s1, Real s2, Real &y, Real &dy_ds1, Real &dy_ds2) const override
Samples value and first derivatives at point (x1, x2) Use this function for speed when computing both...
Real sampleDerivative(const Real s1, const Real s2, unsigned int deriv_var) const override
Samples first derivative at point (s1, s2)
virtual ~BilinearInterpolation()=default
T sampleInternal(const T &s1, const T &s2) const
sampleInternal only used by BilinearInterpolation, hence made private