| Line | |
|---|
| 1 | #ifndef INTERPOLATE_POLYNOMIAL_HPP_
|
|---|
| 2 | #define INTERPOLATE_POLYNOMIAL_HPP_
|
|---|
| 3 |
|
|---|
| 4 | #include <base/vector.hpp>
|
|---|
| 5 |
|
|---|
| 6 | namespace VMG
|
|---|
| 7 | {
|
|---|
| 8 |
|
|---|
| 9 | class Grid;
|
|---|
| 10 | class Index;
|
|---|
| 11 |
|
|---|
| 12 | class InterpolatePolynomial
|
|---|
| 13 | {
|
|---|
| 14 | public:
|
|---|
| 15 | InterpolatePolynomial(const unsigned int& degree);
|
|---|
| 16 | ~InterpolatePolynomial();
|
|---|
| 17 |
|
|---|
| 18 | void ComputeCoefficients(const Grid& grid, const Index& index);
|
|---|
| 19 |
|
|---|
| 20 | vmg_float Evaluate(const Vector& pos);
|
|---|
| 21 | Vector EvaluateGradient(const Vector& pos);
|
|---|
| 22 |
|
|---|
| 23 | private:
|
|---|
| 24 | vmg_float& _access_coeff(const Index& index)
|
|---|
| 25 | {
|
|---|
| 26 | return coeff[index.Z() + deg_1 * (index.Y() + deg_1 * index.X())];
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | vmg_float& _access_coeff(const int& i, const int& j, const int& k)
|
|---|
| 30 | {
|
|---|
| 31 | return coeff[k + deg_1 * (j + deg_1 * i)];
|
|---|
| 32 | }
|
|---|
| 33 |
|
|---|
| 34 | void _compute_coefficients_1d(const Index& index, const unsigned int& direction);
|
|---|
| 35 |
|
|---|
| 36 | vmg_float* coeff;
|
|---|
| 37 | unsigned int deg_1;
|
|---|
| 38 | Vector pos_begin;
|
|---|
| 39 | Vector h;
|
|---|
| 40 | };
|
|---|
| 41 |
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
| 44 | #endif /* INTERPOLATE_POLYNOMIAL_HPP_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.