Kindfield
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Friends Pages
hermiteexpansioncoefficient.h
Go to the documentation of this file.
1 #ifndef HERMITEEXPANSIONCOEFFICIENT_H
2 #define HERMITEEXPANSIONCOEFFICIENT_H
3 
4 #include <math/vector3.h>
5 #include <armadillo>
6 
7 using namespace arma;
8 using namespace std;
9 
11 {
12 public:
13  explicit HermiteExpansionCoefficient(int dimension);
14 
15  void reset(int dimension);
16  void set(double a, double b, const Vector3 &A, const Vector3 &B, int iA, int iB, int jA, int jB, int kA, int kB);
17 
18  const cube &operator [](const uword row) const;
19  cube &operator[](const uword row);
20  void setupE(int iA, int iB, int jA, int jB, int kA, int kB);
21  bool checkIndexCombinationForE(int iA, int iB, int t);
22  double operator ()(int iA, int jA, int kA, int iB, int jB, int kB, const uword t, const uword u, const uword v) const;
23 protected:
24  double m_a;
25  double m_b;
29  cube m_E[3]; // t, i, j
34 };
35 
36 inline const cube &HermiteExpansionCoefficient::operator[](const uword dimension) const {
37  return m_E[dimension];
38 }
39 
40 inline cube &HermiteExpansionCoefficient::operator[](const uword row)
41 {
42  return const_cast<cube&>(static_cast<const HermiteExpansionCoefficient&>(*this)[row]);
43 }
44 
45 inline double HermiteExpansionCoefficient::operator()(int iA, int jA, int kA, int iB, int jB, int kB, const uword t, const uword u, const uword v) const {
46  return m_E[0](iA, iB, t) * m_E[1](jA, jB, u) * m_E[2](kA, kB, v);
47 }
48 
49 #endif // HERMITEEXPANSIONCOEFFICIENT_H