#ifndef INTERPOLATION_HPP_ #define INTERPOLATION_HPP_ #include #include "base/index.hpp" #include "base/vector.hpp" namespace VMG { class Grid; namespace Particle { class Particle; class Interpolation { public: Interpolation(const unsigned int& degree); ~Interpolation(); void ComputeCoefficients(const Grid& grid, const Index& index); void Evaluate(Particle& p); vmg_float EvaluatePotentialLR(const Particle& p); private: vmg_float& _access_coeff(const Index& index) { return coeff[index.Z() + deg_1 * (index.Y() + deg_1 * index.X())]; } vmg_float& _access_coeff(const int& i, const int& j, const int& k) { return coeff[k + deg_1 * (j + deg_1 * i)]; } void _compute_coefficients_1d(const Index& index, const unsigned int& direction); vmg_float* coeff; vmg_float* coeff_buffer; unsigned int deg, deg_1; Vector pos_begin; Vector h; std::vector buffer; std::vector< std::vector > buffer_diff; }; } } #endif /* INTERPOLATION_HPP_ */