source: src/base/interpolate_polynomial.hpp@ 1a92cf

Last change on this file since 1a92cf was 1a92cf, checked in by Julian Iseringhausen <isering@…>, 14 years ago

vmg: Prepared force calculation.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1765 5161e1c8-67bf-11de-9fd5-51895aff932f

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