14 const std::vector<Real> & y,
15 const std::vector<Real> & z,
16 const std::vector<Real> & data)
17 : _x_axis(x), _y_axis(y), _z_axis(z), _fxyz(data)
20 mooseError(
"x vector has zero elements. At least one element is required.");
22 mooseError(
"y vector has zero elements. At least one element is required.");
24 mooseError(
"z vector has zero elements. At least one element is required.");
28 ") does not match the supplied dimensions (",
39 const std::vector<Real> & v, Real x,
int & lower,
int & upper, Real & d)
const 41 unsigned int N = v.size();
47 else if (x >= v[
N - 1])
54 for (
unsigned int i = 0; i <
N - 1; i++)
56 if (x > v[i] && x < v[i + 1])
60 d = (x - v[lower]) / (v[upper] - v[lower]);
79 return _fxyz[x * nY * nZ + y * nZ + z];
111 Real f00 = (f100 - f000) * Dx + f000;
112 Real f10 = (f110 - f010) * Dx + f010;
113 Real f01 = (f101 - f001) * Dx + f001;
114 Real f11 = (f111 - f011) * Dx + f011;
115 Real f0 = (f10 - f00) * Dy + f00;
116 Real f1 = (f11 - f01) * Dy + f01;
118 return (f1 - f0) * Dz + f0;
std::vector< Real > _y_axis
vector of y-values
Real getCornerValues(int x, int y, int z) const
Searches the function value vector for the value at a given corner coordinate from the getCornerIndic...
std::vector< Real > _x_axis
vector of x-values
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
std::vector< Real > _fxyz
vector of function values, f(x,y,z)
void getCornerIndices(const std::vector< Real > &v, Real x, int &lower, int &upper, Real &d) const
Finds the indices of the cube that point (x,y,z) is in.
Real sample(Real x, Real y, Real z) const
Interpolates for the desired (x,y,z) coordinate and returns the value based on the function values ve...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
TrilinearInterpolation(const std::vector< Real > &x, const std::vector< Real > &y, const std::vector< Real > &z, const std::vector< Real > &data)
Constructor initializes data for interpolation.
std::vector< Real > _z_axis
vector of z-values