ls1-MarDyn
ls1-MarDyn molecular dynamics code
DttNode.h
1#ifndef DTTNODE_H_
2#define DTTNODE_H_
3
4#include "PseudoParticleContainer.h"
6#include "bhfmm/utils/Vector3.h"
7
8#include <vector>
9#include "utils/mardyn_assert.h"
10#include <array>
11
12class DttNodeTest;
13
14namespace bhfmm {
15class DttNode;
16}
17
19 friend class ::DttNodeTest;
20
21public:
22 DttNode(int o) :
23 _mpCell(o) {
24 }
25
26 DttNode(const std::vector<Molecule *>& particles, int threshold, Vector3<double> ctr,
27 Vector3<double> domLen, int order, int depth = 0, bool srcOnly = false);
28
29 ~~DttNode() {
30 for (unsigned int i = 0; i < _children.size(); i++) {
31 delete _children[i];
32 }
33 }
34
35 bool get_children(std::vector<DttNode*> & ch) {
36 ch = _children;
37 return not _isLeafNode;
38 }
39
40 void upwardPass();
41 void downwardPass();
42 void p2p(VectorizedChargeP2PCellProcessor * v_c_p2p_c_p);
43 void p2p(std::vector<ParticleCellPointers> leafParticlesFar,
45 Vector3<double> shift);
46 void m2l(const SHMultipoleParticle& multipole,
47 Vector3<double> periodicShift);
48
49 std::vector<ParticleCellPointers> getLeafParticleCells();
50 int getMaxDepth() const;
51 void printSplitable(bool print) const;
52
53 bool isEmpty() const {
54 return _mpCell.occ == 0;
55 }
56
57 bool isOccupied() const {
58 return not isEmpty();
59 }
60
61 Vector3<double> getCenter() const {
62 return _ctr;
63 }
64 Vector3<double> getSize() const {
65 return _domLen;
66 }
67 double getSize(int d) const {
68 mardyn_assert(d < 2 and d >= 0);
69 return _domLen[d];
70 }
71 MpCell& getMpCell() {
72 return _mpCell;
73 }
74
75private:
76 Vector3<double> _ctr, _domLen;
77 MpCell _mpCell;
78 ParticleCellPointers _leafParticles;
79
80 double _threshold;
81 int _order;
82 bool _isLeafNode;
83 std::vector<DttNode*> _children;
84 int _depth;
85 bool _srcOnly;
86 //void initTree(ParticleCellPointers particles);
87 void divideParticles(const std::vector<Molecule *>& particles,
88 std::array<std::vector<Molecule *>, 8>& cell_container) const;
89};
90
91#endif /* DTTNODE_H_ */
VectorizedChargeP2PCellProcessor.h.
Definition: DttNode.h:18
Definition: PseudoParticleContainer.h:22
Definition: ParticleCellPointers.h:44
Definition: SHMultipoleParticle.h:17
Definition: Vector3.h:34
Vectorized calculation of the force.
Definition: VectorizedChargeP2PCellProcessor.h:32
Definition: L2PCellProcessor.cpp:15