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