chombo-discharge
Loading...
Searching...
No Matches
CD_KDNode.H
Go to the documentation of this file.
1/* chombo-discharge
2 * Copyright © 2022 SINTEF Energy Research.
3 * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4 */
5
12#ifndef CD_KDNode_H
13#define CD_KDNode_H
14
15// Std includes
16#include <memory>
17#include <vector>
18
19// Chombo includes
20#include <RealVect.H>
21#include <List.H>
22
23// Our includes
24#include <CD_NamespaceHeader.H>
25
31template <class P>
32class KDNode
33{
34public:
40
44 KDNode(const KDNode&) = delete;
45
49 KDNode(const KDNode&&) = delete;
50
54 KDNode&
55 operator=(const KDNode&) = delete;
56
60 KDNode&
61 operator=(const KDNode&&) = delete;
62
66 KDNode();
67
74
78 virtual ~KDNode();
79
83 inline const Real&
85
91
97
103
107 inline bool
109
113 inline bool
115
121
129
135
141
147
152
157
162
167 inline void
169
176 inline void
178};
179
180#include <CD_NamespaceFooter.H>
181
182#include <CD_KDNodeImplem.H>
183
184#endif
Implementation of CD_KDNode.H.
Node in a particle-merging KD-tree.
Definition CD_KDNode.H:33
ParticleList moveParticles() noexcept
Move the particles list further down in the subtree into this vector.
Definition CD_KDNodeImplem.H:105
const Real & weight() const noexcept
Get the node weight.
Definition CD_KDNodeImplem.H:52
const ParticleList & getParticles() const noexcept
Get particles in this node.
Definition CD_KDNodeImplem.H:38
KDNode()
Default constructor.
Definition CD_KDNodeImplem.H:24
std::shared_ptr< KDNode< P > > & getRight() noexcept
Get the right node.
Definition CD_KDNodeImplem.H:138
std::shared_ptr< KDNode > m_right
Right KD-node.
Definition CD_KDNode.H:151
ParticleList gatherParticles() const noexcept
Gather particles further down in the subtree and return all particles (in the leaf nodes)
Definition CD_KDNodeImplem.H:80
virtual ~KDNode()
Destructor. Does nothing.
Definition CD_KDNodeImplem.H:33
ParticleList m_particles
List of particles.
Definition CD_KDNode.H:161
Real m_weight
Node weight.
Definition CD_KDNode.H:156
std::shared_ptr< KDNode< P > > & getLeft() noexcept
Get the left node.
Definition CD_KDNodeImplem.H:131
std::vector< P > ParticleList
List of particles. This is aliased because the KD-tree construction may require both random access an...
Definition CD_KDNode.H:39
bool isLeafNode() const noexcept
Is leaf node or not.
Definition CD_KDNodeImplem.H:66
KDNode(const KDNode &&)=delete
Disallowed constructor.
std::shared_ptr< KDNode > m_left
Left KD-node.
Definition CD_KDNode.H:146
KDNode(const KDNode &)=delete
Disallowed constructor.
bool isInteriorNode() const noexcept
Is leaf node or not.
Definition CD_KDNodeImplem.H:73
KDNode & operator=(const KDNode &&)=delete
Disallowed assignment.
KDNode & operator=(const KDNode &)=delete
Disallowed assignment.
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:37
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:25