13#ifndef CD_PARTICLEMANAGEMENTIMPLEM_H
14#define CD_PARTICLEMANAGEMENTIMPLEM_H
26#include <CD_NamespaceHeader.H>
30 template <
class P, Real& (P::*weight)(), const RealVect& (P::*position)() const>
93 const Real&
pw = (p.*weight)();
108 const long long Nr =
N / 2;
109 const long long Nl =
N -
Nr;
115 if (
dwl > 0.0 &&
dwr > 0.0) {
127 (
il.*weight)() =
dwl;
128 (
ir.*weight)() =
dwr;
136 else if (
dwl > 0.0 &&
dwr == 0.0) {
144 (
il.*weight)() =
dwl;
147 else if (
dwl == 0.0 &&
dwr > 0.0) {
155 (
ir.*weight)() =
dwr;
161 MayDay::Abort(
"ParticleManagement::partitionAndSplitEqualWeightKD - logic bust");
195 for (
auto&
l :
a_node.getLeft()->getParticles()) {
201 for (
auto&
r :
a_node.getRight()->getParticles()) {
212 template <
class P, Real& (P::*weight)(), const RealVect& (P::*position)() const>
218 CH_TIME(
"ParticleManagement::recursivePartitionAndSplitEqualWeightKD");
231 bool keepGoing =
true;
239 if (
l->weight() > 2.0 - std::numeric_limits<Real>::min()) {
240 ParticleManagement::partitionAndSplitEqualWeightKD<P, weight, position>(*
l,
a_particleReconcile);
263 template <
typename P,
typename T,
typename>
267 CH_TIME(
"ParticleManagement::removePhysicalParticles");
273 MayDay::Error(
"ParticleManagement::removePhysicalParticles - 'a_numPhysPartoToRemove < 0'");
297 lit().weight() -= 1.0 *
r;
326 lit().weight() -= 1.0 *
w;
348 template <
typename P>
352 CH_TIME(
"ParticleManagement::deleteParticles");
364 template <
typename T,
typename>
371 constexpr T one = (
T)1;
398 template <
typename T,
typename>
418 template <
typename P,
typename T,
typename>
435 template <
typename P,
typename T,
typename>
442 CH_TIME(
"ParticleManagement::drawSphereParticles");
467 template <
typename P,
typename T,
typename>
474 CH_TIME(
"ParticleManagement::drawBoxParticles");
487 template <
typename P,
typename T,
typename>
494 CH_TIME(
"ParticleManagement::drawGaussianParticles");
506#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:40
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:217
static RealVect getDirection()
Get a random direction in space.
Definition CD_RandomImplem.H:180
static Real getUniformReal11()
Get a uniform real number on the interval [-1,1].
Definition CD_RandomImplem.H:164
static Real getUniformReal01()
Get a uniform real number on the interval [0,1].
Definition CD_RandomImplem.H:156
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
virtual ParticleContainer< P > & getParticles()
Get all particles.
Definition CD_TracerParticleSolverImplem.H:663
RealVect position(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:21
Namespace for various particle management tools.
Definition CD_ParticleManagement.H:32