12#ifndef CD_ParticleManagementImplem_H
13#define CD_ParticleManagementImplem_H
25#include <CD_NamespaceHeader.H>
29 template <
class P, Real& (P::*weight)(), const RealVect& (P::*position)() const>
92 const Real&
pw = (p.*weight)();
107 const long long Nr =
N / 2;
108 const long long Nl =
N -
Nr;
114 if (
dwl > 0.0 &&
dwr > 0.0) {
126 (
il.*weight)() =
dwl;
127 (
ir.*weight)() =
dwr;
135 else if (
dwl > 0.0 &&
dwr == 0.0) {
143 (
il.*weight)() =
dwl;
146 else if (
dwl == 0.0 &&
dwr > 0.0) {
154 (
ir.*weight)() =
dwr;
160 MayDay::Abort(
"ParticleManagement::partitionAndSplitEqualWeightKD - logic bust");
194 for (
auto&
l :
a_node.getLeft()->getParticles()) {
200 for (
auto&
r :
a_node.getRight()->getParticles()) {
211 template <
class P, Real& (P::*weight)(), const RealVect& (P::*position)() const>
217 CH_TIME(
"ParticleManagement::recursivePartitionAndSplitEqualWeightKD");
238 if (
l->weight() > 2.0 - std::numeric_limits<Real>::min()) {
239 ParticleManagement::partitionAndSplitEqualWeightKD<P, weight, position>(*
l,
a_particleReconcile);
262 template <
typename P,
typename T,
typename>
266 CH_TIME(
"ParticleManagement::removePhysicalParticles");
268 constexpr T
zero = (T)0;
272 MayDay::Error(
"ParticleManagement::removePhysicalParticles - 'a_numPhysPartoToRemove < 0'");
281 T
minWeight = std::numeric_limits<T>::max();
296 lit().weight() -= 1.0 *
r;
325 lit().weight() -= 1.0 *
w;
347 template <
typename P>
351 CH_TIME(
"ParticleManagement::deleteParticles");
363 template <
typename T,
typename>
369 constexpr T
zero = (T)0;
370 constexpr T
one = (T)1;
397 template <
typename T,
typename>
417 template <
typename P,
typename T,
typename>
434 template <
typename P,
typename T,
typename>
441 CH_TIME(
"ParticleManagement::drawSphereParticles");
466 template <
typename P,
typename T,
typename>
473 CH_TIME(
"ParticleManagement::drawBoxParticles");
486 template <
typename P,
typename T,
typename>
493 CH_TIME(
"ParticleManagement::drawGaussianParticles");
505#include <CD_NamespaceFooter.H>
Namespace containing various particle management utilities.
File containing some useful static methods related to random number generation.
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
static Real get(T &a_distribution)
For getting a random number from a user-supplied distribution. T must be a distribution for which we ...
Definition CD_RandomImplem.H:221
static RealVect getDirection()
Get a random direction in space.
Definition CD_RandomImplem.H:182
static Real getUniformReal11()
Get a uniform real number on the interval [-1,1].
Definition CD_RandomImplem.H:162
static Real getUniformReal01()
Get a uniform real number on the interval [0,1].
Definition CD_RandomImplem.H:152
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
virtual ParticleContainer< P > & getParticles()
Get all particles.
Definition CD_TracerParticleSolverImplem.H:662
RealVect position(const Location::Cell a_location, const VolIndex &a_vof, const EBISBox &a_ebisbox, const Real &a_dx)
Compute the position (ignoring the "origin) of a Vof.
Definition CD_LocationImplem.H:20
Namespace for various particle management tools.
Definition CD_ParticleManagement.H:31