https://mooseframework.inl.gov
Loading...
Searching...
No Matches
TrilinearInterpolation.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#include <vector>
13#include "Moose.h"
14
15using libMesh::Real;
16
59{
60public:
68 TrilinearInterpolation(const std::vector<Real> & x,
69 const std::vector<Real> & y,
70 const std::vector<Real> & z,
71 const std::vector<Real> & data);
72
73 virtual ~TrilinearInterpolation() = default;
74
83 Real sample(Real x, Real y, Real z) const;
84
85protected:
87 std::vector<Real> _x_axis;
88
90 std::vector<Real> _y_axis;
91
93 std::vector<Real> _z_axis;
94
96 std::vector<Real> _fxyz;
97
106 void
107 getCornerIndices(const std::vector<Real> & v, Real x, int & lower, int & upper, Real & d) const;
108
117 Real getCornerValues(int x, int y, int z) const;
118};
This class interpolates a function of three values (f(x,y,z)).
std::vector< Real > _x_axis
vector of x-values
std::vector< Real > _z_axis
vector of z-values
std::vector< Real > _fxyz
vector of function values, f(x,y,z)
virtual ~TrilinearInterpolation()=default
std::vector< Real > _y_axis
vector of y-values
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...
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...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real