13 #ifndef CD_ParticleOps_H
14 #define CD_ParticleOps_H
17 #include <RefCountedPtr.H>
23 #include <CD_NamespaceHeader.H>
38 getParticleCellIndex(
const RealVect& a_particlePosition,
const RealVect& a_probLo,
const Real& a_dx) noexcept;
47 getParticleCellIndex(
const RealVect& a_particlePosition,
const RealVect& a_probLo,
const RealVect& a_dx) noexcept;
58 template <
typename P, const Real& (P::*weight)() const>
78 getParticleGridCell(
const RealVect& a_particlePosition,
const RealVect& a_probLo,
const RealVect& a_dx) noexcept;
93 const RealVect& a_newPos,
94 const RealVect& a_probLo,
95 const RealVect& a_probHi,
112 const RealVect& a_oldPos,
113 const RealVect& a_newPos,
114 const Real& a_bisectStep,
132 const RealVect& a_oldPos,
133 const RealVect& a_newPos,
134 const Real& a_tolerance,
142 template <
typename P>
151 template <
typename P>
159 template <
typename P, const Real& (P::*scalarQuantity)() const>
168 template <
typename P, Real (P::*scalarQuantity)()>
177 template <
typename P>
187 template <
typename P>
191 const std::function<
bool(
const P&)>& a_transferCrit) noexcept;
198 template <
typename P>
207 template <
typename P, Real& (P::*particleScalarField)()>
216 template <
typename P, RealVect& (P::*particleVectorField)()>
230 template <
typename P>
232 scatterParticles(std::map<std::pair<unsigned int, unsigned int>, List<P>>& a_receivedParticles,
233 std::vector<std::map<std::pair<unsigned int, unsigned int>, List<P>>>& a_sentParticles) noexcept;
238 #include <CD_NamespaceFooter.H>
Declaration of a class for holding particles on an AMR hierarchy.
Implementation of CD_ParticleOps.H.
Templated class for holding particles on an AMR hierarchy with particle remapping.
Definition: CD_ParticleContainer.H:50
A shallow static class for doing various kinds of particle-related operations.
Definition: CD_ParticleOps.H:29
static void copy(ParticleContainer< P > &a_dst, const ParticleContainer< P > &a_src) noexcept
Copy all the particles from the a_src to a_dst.
Definition: CD_ParticleOpsImplem.H:268
static Real sum(const ParticleContainer< P > &a_particles) noexcept
Perform a sum of some particle quantity.
Definition: CD_ParticleOpsImplem.H:316
static void getComputationalParticlesPerCell(EBAMRCellData &a_ppc, const ParticleContainer< P > &a_src) noexcept
Get the number of computational particles per cell.
Definition: CD_ParticleOpsImplem.H:83
static void transferParticles(ParticleContainer< P > &a_dstParticles, ParticleContainer< P > &a_srcParticles, const std::function< bool(const P &)> &a_transferCrit) noexcept
Transfer particles if they fulfill a certain removal criterion. Takes particles from a_srcParticles a...
Definition: CD_ParticleOpsImplem.H:405
static bool ebIntersectionRaycast(const RefCountedPtr< BaseIF > &a_impFunc, const RealVect &a_oldPos, const RealVect &a_newPos, const Real &a_tolerance, Real &a_s)
Compute the intersection point between a particle path and an implicit function using a ray-casting a...
Definition: CD_ParticleOpsImplem.H:217
static bool ebIntersectionBisect(const RefCountedPtr< BaseIF > &a_impFunc, const RealVect &a_oldPos, const RealVect &a_newPos, const Real &a_bisectStep, Real &a_s)
Compute the intersection point between a particle path and an implicit function using a bisection alg...
Definition: CD_ParticleOpsImplem.H:173
static void setValue(ParticleContainer< P > &a_particles, const Real a_value) noexcept
Set value function. Lets the user set scalar particle quantity. Use with e.g. setValue<P,...
Definition: CD_ParticleOpsImplem.H:466
static void removeParticles(ParticleContainer< P > &a_particles, const std::function< bool(const P &)> &a_removeCriterion) noexcept
Remove particles if they fulfill certain removal criterion.
Definition: CD_ParticleOpsImplem.H:374
static Real sum(const ParticleContainer< P > &a_particles) noexcept
Perform a sum of some particle quantity.
static void getPhysicalParticlesPerCell(EBAMRCellData &a_ppc, const ParticleContainer< P > &a_src) noexcept
Get the number of physical particles per cell.
Definition: CD_ParticleOpsImplem.H:47
static void copyDestructive(ParticleContainer< P > &a_dst, ParticleContainer< P > &a_src) noexcept
Copy all the particles from the a_src to a_dst. This destroys the source particles.
Definition: CD_ParticleOpsImplem.H:291
static IntVect getParticleGridCell(const RealVect &a_particlePosition, const RealVect &a_probLo, const RealVect &a_dx) noexcept
Get the grid cell where the particle lives.
Definition: CD_ParticleOpsImplem.H:117
static IntVect getParticleCellIndex(const RealVect &a_particlePosition, const RealVect &a_probLo, const Real &a_dx) noexcept
Get the cell index corresponding to the particle position.
Definition: CD_ParticleOpsImplem.H:26
static void setData(ParticleContainer< P > &a_particles, const std::function< void(P &)> &a_functor) noexcept
Set value function. Lets the user set particle parameters.
Definition: CD_ParticleOpsImplem.H:441
static bool domainIntersection(const RealVect &a_oldPos, const RealVect &a_newPos, const RealVect &a_probLo, const RealVect &a_probHi, Real &a_s)
Compute the intersection point between a particle path and a domain side.
Definition: CD_ParticleOpsImplem.H:127