chombo-discharge
Loading...
Searching...
No Matches
CD_KDNode.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
13#ifndef CD_KDNODE_H
14#define CD_KDNODE_H
15
16// Std includes
17#include <memory>
18#include <vector>
19
20// Chombo includes
21#include <RealVect.H>
22#include <List.H>
23
24// Our includes
25#include <CD_NamespaceHeader.H>
26
32template <class P>
33class KDNode
34{
35public:
41
45 KDNode(const KDNode&) = delete;
46
50 KDNode(const KDNode&&) = delete;
51
55 KDNode&
56 operator=(const KDNode&) = delete;
57
61 KDNode&
62 operator=(const KDNode&&) = delete;
63
67 KDNode();
68
75
79 virtual ~KDNode();
80
85 inline const Real&
87
94
101
108
113 inline bool
115
120 inline bool
122
129
138
145
152
158
163
168
173
178 inline void
180
187 inline void
189};
190
191#include <CD_NamespaceFooter.H>
192
193#include <CD_KDNodeImplem.H>
194
195#endif
Implementation of CD_KDNode.H.
Node in a particle-merging KD-tree.
Definition CD_KDNode.H:34
ParticleList moveParticles() noexcept
Move the particles list further down in the subtree into this vector.
Definition CD_KDNodeImplem.H:106
const Real & weight() const noexcept
Get the node weight.
Definition CD_KDNodeImplem.H:53
const ParticleList & getParticles() const noexcept
Get particles in this node.
Definition CD_KDNodeImplem.H:39
KDNode()
Default constructor.
Definition CD_KDNodeImplem.H:25
std::shared_ptr< KDNode< P > > & getRight() noexcept
Get the right node.
Definition CD_KDNodeImplem.H:139
std::shared_ptr< KDNode > m_right
Right KD-node.
Definition CD_KDNode.H:162
ParticleList gatherParticles() const noexcept
Gather particles further down in the subtree and return all particles (in the leaf nodes)
Definition CD_KDNodeImplem.H:81
virtual ~KDNode()
Destructor. Does nothing.
Definition CD_KDNodeImplem.H:34
ParticleList m_particles
List of particles.
Definition CD_KDNode.H:172
Real m_weight
Node weight.
Definition CD_KDNode.H:167
std::shared_ptr< KDNode< P > > & getLeft() noexcept
Get the left node.
Definition CD_KDNodeImplem.H:132
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:40
bool isLeafNode() const noexcept
Is leaf node or not.
Definition CD_KDNodeImplem.H:67
KDNode(const KDNode &&)=delete
Disallowed constructor.
std::shared_ptr< KDNode > m_left
Left KD-node.
Definition CD_KDNode.H:157
KDNode(const KDNode &)=delete
Disallowed constructor.
bool isInteriorNode() const noexcept
Is leaf node or not.
Definition CD_KDNodeImplem.H:74
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:38
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:26