source:
src/units/particle/interpolation.hpp@
06e153
| Last change on this file since 06e153 was cd0fed, checked in by , 14 years ago | |
|---|---|
|
|
| File size: 999 bytes | |
| Rev | Line | |
|---|---|---|
| [f003a9] | 1 | #ifndef INTERPOLATION_HPP_ |
| 2 | #define INTERPOLATION_HPP_ | |
| [716da7] | 3 | |
| [1a92cf] | 4 | #include <vector> |
| 5 | ||
| 6 | #include "base/index.hpp" | |
| 7 | #include "base/vector.hpp" | |
| [716da7] | 8 | |
| 9 | namespace VMG | |
| 10 | { | |
| 11 | ||
| 12 | class Grid; | |
| 13 | ||
| [f003a9] | 14 | namespace Particle |
| 15 | { | |
| 16 | ||
| 17 | class Particle; | |
| 18 | ||
| 19 | class Interpolation | |
| [716da7] | 20 | { |
| 21 | public: | |
| [cd0fed] | 22 | Interpolation(const int& degree); |
| [f003a9] | 23 | ~Interpolation(); |
| [716da7] | 24 | |
| 25 | void ComputeCoefficients(const Grid& grid, const Index& index); | |
| [f003a9] | 26 | void Evaluate(Particle& p); |
| [716da7] | 27 | |
| [f003a9] | 28 | vmg_float EvaluatePotentialLR(const Particle& p); |
| [716da7] | 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; | |
| [1a92cf] | 44 | vmg_float* coeff_buffer; |
| [cd0fed] | 45 | int deg, deg_1; |
| [716da7] | 46 | Vector pos_begin; |
| 47 | Vector h; | |
| [1a92cf] | 48 | std::vector<Vector> buffer; |
| 49 | std::vector< std::vector<Vector> > buffer_diff; | |
| [716da7] | 50 | }; |
| 51 | ||
| 52 | } | |
| 53 | ||
| [f003a9] | 54 | } |
| 55 | ||
| 56 | #endif /* INTERPOLATION_HPP_ */ |
Note:
See TracBrowser
for help on using the repository browser.
