https://mooseframework.inl.gov
Public Member Functions | Public Attributes | List of all members
BidimensionalInterpolation Class Referenceabstract

This class interpolates tabulated data with a Bidimension function (either bicubic or bilinear). More...

#include <BidimensionalInterpolation.h>

Inheritance diagram for BidimensionalInterpolation:
[legend]

Public Member Functions

 BidimensionalInterpolation (const std::vector< Real > &x1, const std::vector< Real > &x2)
 
virtual ~BidimensionalInterpolation ()=default
 
virtual Real sample (const Real x1, const Real x2) const =0
 Samples value at point (x1, x2) More...
 
virtual ADReal sample (const ADReal &x1, const ADReal &x2) const =0
 
virtual ChainedReal sample (const ChainedReal &x1, const ChainedReal &x2) const =0
 
virtual Real sampleDerivative (const Real, const Real, unsigned int) const
 Samples first derivative at point (x1, x2) More...
 
virtual ADReal sampleDerivative (const ADReal &, const ADReal &, unsigned int) const
 
virtual ChainedReal sampleDerivative (const ChainedReal &, const ChainedReal &, unsigned int) const
 
virtual Real sample2ndDerivative (Real, Real, unsigned int) const
 Samples second derivative at point (x1, x2) More...
 
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 value and derivatives, as it minimizes the amount of time spent locating the point in the tabulated data. More...
 
virtual void sampleValueAndDerivatives (const ADReal &, const ADReal &, ADReal &, ADReal &, ADReal &) const
 
virtual void sampleValueAndDerivatives (const ChainedReal &, const ChainedReal &, ChainedReal &, ChainedReal &, ChainedReal &) const
 

Public Attributes

std::vector< Real_x1
 Independent values in the x1 direction. More...
 
std::vector< Real_x2
 Independent values in the x2 direction. More...
 

Detailed Description

This class interpolates tabulated data with a Bidimension function (either bicubic or bilinear).

In order to minimize the computational expense of each sample, the coefficients at each point in the tabulated data are computed once in advance, and then accessed during the interpolation.

Adapted from Numerical Recipes in C (section 3.6). The terminology used is consistent with that used in Numerical Recipes, where moving over a column corresponds to moving over the x1 coord. Likewise, moving over a row means moving over the x2 coord.

Definition at line 29 of file BidimensionalInterpolation.h.

Constructor & Destructor Documentation

◆ BidimensionalInterpolation()

BidimensionalInterpolation::BidimensionalInterpolation ( const std::vector< Real > &  x1,
const std::vector< Real > &  x2 
)

Definition at line 12 of file BidimensionalInterpolation.C.

14  : _x1(x1), _x2(x2)
15 {
16 }
std::vector< Real > _x1
Independent values in the x1 direction.
std::vector< Real > _x2
Independent values in the x2 direction.

◆ ~BidimensionalInterpolation()

virtual BidimensionalInterpolation::~BidimensionalInterpolation ( )
virtualdefault

Member Function Documentation

◆ sample() [1/3]

virtual Real BidimensionalInterpolation::sample ( const Real  x1,
const Real  x2 
) const
pure virtual

Samples value at point (x1, x2)

Implemented in BilinearInterpolation, and BicubicInterpolation.

◆ sample() [2/3]

virtual ADReal BidimensionalInterpolation::sample ( const ADReal x1,
const ADReal x2 
) const
pure virtual

◆ sample() [3/3]

virtual ChainedReal BidimensionalInterpolation::sample ( const ChainedReal x1,
const ChainedReal x2 
) const
pure virtual

◆ sample2ndDerivative()

virtual Real BidimensionalInterpolation::sample2ndDerivative ( Real  ,
Real  ,
unsigned int   
) const
inlinevirtual

Samples second derivative at point (x1, x2)

Reimplemented in BicubicInterpolation.

Definition at line 73 of file BidimensionalInterpolation.h.

74  {
75  mooseError("sample2ndDerivative is not implemented for this interpolation class");
76  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ sampleDerivative() [1/3]

virtual Real BidimensionalInterpolation::sampleDerivative ( const Real  ,
const Real  ,
unsigned int   
) const
inlinevirtual

Samples first derivative at point (x1, x2)

Reimplemented in BicubicInterpolation, and BilinearInterpolation.

Definition at line 52 of file BidimensionalInterpolation.h.

53  {
54  mooseError("sampleDerivative for Real numbers is not implemented for this interpolation class");
55  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ sampleDerivative() [2/3]

virtual ADReal BidimensionalInterpolation::sampleDerivative ( const ADReal ,
const ADReal ,
unsigned int   
) const
inlinevirtual

Reimplemented in BilinearInterpolation.

Definition at line 57 of file BidimensionalInterpolation.h.

58  {
59  mooseError(
60  "sampleDerivative for ADReal numbers is not implemented for this interpolation class");
61  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ sampleDerivative() [3/3]

virtual ChainedReal BidimensionalInterpolation::sampleDerivative ( const ChainedReal ,
const ChainedReal ,
unsigned int   
) const
inlinevirtual

Reimplemented in BilinearInterpolation.

Definition at line 62 of file BidimensionalInterpolation.h.

65  {
66  mooseError(
67  "sampleDerivative for ChainedReal numbers is not implemented for this interpolation class");
68  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ sampleValueAndDerivatives() [1/3]

virtual void BidimensionalInterpolation::sampleValueAndDerivatives ( Real  ,
Real  ,
Real ,
Real ,
Real  
) const
inlinevirtual

Samples value and first derivatives at point (x1, x2) Use this function for speed when computing both value and derivatives, as it minimizes the amount of time spent locating the point in the tabulated data.

Reimplemented in BilinearInterpolation, and BicubicInterpolation.

Definition at line 84 of file BidimensionalInterpolation.h.

86  {
87  mooseError("sampleValueAndDerivatives for Real numbers is not implemented for this "
88  "interpolation class");
89  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ sampleValueAndDerivatives() [2/3]

virtual void BidimensionalInterpolation::sampleValueAndDerivatives ( const ADReal ,
const ADReal ,
ADReal ,
ADReal ,
ADReal  
) const
inlinevirtual

Reimplemented in BicubicInterpolation.

Definition at line 90 of file BidimensionalInterpolation.h.

95  {
96  mooseError("sampleValueAndDerivatives for ADReal numbers is not implemented for this "
97  "interpolation class");
98  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ sampleValueAndDerivatives() [3/3]

virtual void BidimensionalInterpolation::sampleValueAndDerivatives ( const ChainedReal ,
const ChainedReal ,
ChainedReal ,
ChainedReal ,
ChainedReal  
) const
inlinevirtual

Reimplemented in BicubicInterpolation.

Definition at line 99 of file BidimensionalInterpolation.h.

104  {
105  mooseError("sampleValueAndDerivatives for ChainedReal numbers is not implemented for this "
106  "interpolation class");
107  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

Member Data Documentation

◆ _x1

std::vector<Real> BidimensionalInterpolation::_x1

◆ _x2

std::vector<Real> BidimensionalInterpolation::_x2

The documentation for this class was generated from the following files: