12345678910111213141516171819202122232425 |
- #include <vector>
- /*
- Node class for the Barnes-Hut tree. The choice of pointers as opposed
- to references is driven by the necessity to interact with Numpy arrays
- using ctypes.
- */
- class Node{
- private:
- double COM[3]; // Center of mass
- double m; // Mass of the node
- double size; // Size of box, equal for all dimensions
- std::vector<Node*> children;
- public:
- double g[3]; // Gravitational acceleration on the node
- // Constructors
- Node(const std::vector<Node*> &pBodies, const double pSize,
- const double px, const double py, const double pz);
- Node(const double* pr_vec, const double pm);
- // Methods
- void treeWalk(const Node &node, const double thetamax, const double soft);
- };
|