source: src/base/interpolate_polynomial.hpp@ a150d0

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

Fix energy calculation.

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

  • Property mode set to 100644
File size: 887 bytes
Line 
1#ifndef INTERPOLATE_POLYNOMIAL_HPP_
2#define INTERPOLATE_POLYNOMIAL_HPP_
3
4#include <base/vector.hpp>
5
6namespace VMG
7{
8
9class Grid;
10class Index;
11
12class InterpolatePolynomial
13{
14public:
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
23private:
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.