https://mooseframework.inl.gov
BidimensionalInterpolation.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"
14 #include "MooseTypes.h"
15 
16 // C++ includes
17 #include <vector>
18 
30 {
31 public:
32  BidimensionalInterpolation(const std::vector<Real> & x1, const std::vector<Real> & x2);
33 
34  virtual ~BidimensionalInterpolation() = default;
35 
37  std::vector<Real> _x1;
39  std::vector<Real> _x2;
40 
44  virtual Real sample(const Real x1, const Real x2) const = 0;
45  virtual ADReal sample(const ADReal & x1, const ADReal & x2) const = 0;
46  virtual ChainedReal sample(const ChainedReal & x1, const ChainedReal & x2) const = 0;
47 
51  virtual Real
52  sampleDerivative(const Real /*x1*/, const Real /*x2*/, unsigned int /*deriv_var*/) const
53  {
54  mooseError("sampleDerivative for Real numbers is not implemented for this interpolation class");
55  }
56  virtual ADReal
57  sampleDerivative(const ADReal & /*x1*/, const ADReal & /*x2*/, unsigned int /*deriv_var*/) const
58  {
59  mooseError(
60  "sampleDerivative for ADReal numbers is not implemented for this interpolation class");
61  }
62  virtual ChainedReal sampleDerivative(const ChainedReal & /*x1*/,
63  const ChainedReal & /*x2*/,
64  unsigned int /*deriv_var*/) const
65  {
66  mooseError(
67  "sampleDerivative for ChainedReal numbers is not implemented for this interpolation class");
68  }
69 
73  virtual Real sample2ndDerivative(Real /*x1*/, Real /*x2*/, unsigned int /*deriv_var*/) const
74  {
75  mooseError("sample2ndDerivative is not implemented for this interpolation class");
76  }
77 
85  Real /*x1*/, Real /*x2*/, Real & /* y*/, Real & /* dy1*/, Real & /* dy2*/) const
86  {
87  mooseError("sampleValueAndDerivatives for Real numbers is not implemented for this "
88  "interpolation class");
89  }
90  virtual void sampleValueAndDerivatives(const ADReal & /*x1*/,
91  const ADReal & /*x2*/,
92  ADReal & /* y*/,
93  ADReal & /* dy1*/,
94  ADReal & /* dy2*/) const
95  {
96  mooseError("sampleValueAndDerivatives for ADReal numbers is not implemented for this "
97  "interpolation class");
98  }
99  virtual void sampleValueAndDerivatives(const ChainedReal & /*x1*/,
100  const ChainedReal & /*x2*/,
101  ChainedReal & /* y*/,
102  ChainedReal & /* dy1*/,
103  ChainedReal & /* dy2*/) const
104  {
105  mooseError("sampleValueAndDerivatives for ChainedReal numbers is not implemented for this "
106  "interpolation class");
107  }
108 };
virtual Real sample(const Real x1, const Real x2) const =0
Samples value at point (x1, x2)
virtual ~BidimensionalInterpolation()=default
virtual void sampleValueAndDerivatives(const ChainedReal &, const ChainedReal &, ChainedReal &, ChainedReal &, ChainedReal &) const
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
DualNumber< Real, Real > ChainedReal
Definition: ChainedReal.h:30
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...
BidimensionalInterpolation(const std::vector< Real > &x1, const std::vector< Real > &x2)
DualNumber< Real, DNDerivativeType, true > ADReal
Definition: ADRealForward.h:47
std::vector< Real > _x1
Independent values in the x1 direction.
virtual void sampleValueAndDerivatives(const ADReal &, const ADReal &, ADReal &, ADReal &, ADReal &) const
virtual ADReal sampleDerivative(const ADReal &, const ADReal &, unsigned int) const
virtual ChainedReal sampleDerivative(const ChainedReal &, const ChainedReal &, unsigned int) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< Real > _x2
Independent values in the x2 direction.
virtual Real sampleDerivative(const Real, const Real, unsigned int) const
Samples first derivative at point (x1, x2)
virtual Real sample2ndDerivative(Real, Real, unsigned int) const
Samples second derivative at point (x1, x2)
This class interpolates tabulated data with a Bidimension function (either bicubic or bilinear)...