A shallow static class for doing various kinds of particle-related operations.
More...
|
| 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.
|
| |
| static IntVect | getParticleCellIndex (const RealVect &a_particlePosition, const RealVect &a_probLo, const RealVect &a_dx) noexcept |
| | Get the cell index corresponding to the particle position.
|
| |
| template<typename P , typename Traits > |
| static void | getPhysicalParticlesPerCell (EBAMRCellData &a_ppc, const ParticleContainer< P, Traits > &a_src) noexcept |
| | Get the number of physical particles per cell (SoA overload).
|
| |
| template<typename P , typename Traits > |
| static void | getComputationalParticlesPerCell (EBAMRCellData &a_ppc, const ParticleContainer< P, Traits > &a_src) noexcept |
| | Get the number of computational particles per cell (SoA overload).
|
| |
| static IntVect | getParticleGridCell (const RealVect &a_particlePosition, const RealVect &a_probLo, const RealVect &a_dx) noexcept |
| | Get the grid cell where the particle lives.
|
| |
| 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.
|
| |
| 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 algorithm.
|
| |
| 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 algorithm.
|
| |
| template<typename P , typename Traits > |
| static void | copyDestructive (ParticleContainer< P, Traits > &a_dst, ParticleContainer< P, Traits > &a_src) noexcept |
| | Move all particles from a_src into a_dst (per leaf), emptying a_src. SoA overload.
|
| |
| template<typename P , typename Traits > |
| static Real | sum (const ParticleContainer< P, Traits > &a_particles) noexcept |
| | Global sum of the container-owned weight column (SoA overload).
|
| |
| template<typename P , typename Traits > |
| static void | setData (ParticleContainer< P, Traits > &a_particles, const std::function< void(ParticleSoA< P, Traits > &, std::size_t)> &a_functor) noexcept |
| | Set value function for SoA containers. Lets the user set particle parameters via a (leaf, index) callback.
|
| |
A shallow static class for doing various kinds of particle-related operations.
template<typename P , typename Traits >
Move all particles from a_src into a_dst (per leaf), emptying a_src. SoA overload.
Both containers must be defined over the same grids. Per patch, a_dst's leaf is replaced by a_src's (via clear + catenate – an O(1) arena swap when a_dst's leaf is empty), and a_src is emptied.
- Parameters
-
| [in,out] | a_dst | Destination container (its leaves are overwritten). |
| [in,out] | a_src | Source container (emptied). |
- Template Parameters
-
| P | Payload type. |
| Traits | Column descriptor for the payload. |
| bool ParticleOps::domainIntersection |
( |
const RealVect & |
a_oldPos, |
|
|
const RealVect & |
a_newPos, |
|
|
const RealVect & |
a_probLo, |
|
|
const RealVect & |
a_probHi, |
|
|
Real & |
a_s |
|
) |
| |
|
inlinestatic |
Compute the intersection point between a particle path and a domain side.
If the particle crossed the domain side, the output argument a_s determines the intersection point by x(s) = x0 + s*(x1-x0) where x0 is the starting position (a_oldPos), x1 is the end position (a_newPos), and x(s) is the intersection point with the boundary.
- Parameters
-
| [in] | a_oldPos | Particle starting position |
| [in] | a_newPos | Particle end position |
| [in] | a_probLo | Lower-left corner in physical coordinates |
| [in] | a_probHi | Upper-right corner in physical coordinates |
| [out] | a_s | Relative length along the path |
- Returns
- Returns true if the particle crossed the domain boundary.
| bool ParticleOps::ebIntersectionBisect |
( |
const RefCountedPtr< BaseIF > & |
a_impFunc, |
|
|
const RealVect & |
a_oldPos, |
|
|
const RealVect & |
a_newPos, |
|
|
const Real & |
a_bisectStep, |
|
|
Real & |
a_s |
|
) |
| |
|
inlinestatic |
Compute the intersection point between a particle path and an implicit function using a bisection algorithm.
This routine will bisect the particle path into intervals of length a_bisectStep. Each interval is examined for a crossing with the implicit function and if the particle crossed the into the EB, the output argument a_s determines the intersection point by x(s) = x0 + s*(x1-x0) where x0 is the starting position (a_oldPos), x1 is the end position (a_newPos), and x(s) is the intersection point with the geometry.
- Parameters
-
| [in] | a_impFunc | Implicit function. |
| [in] | a_oldPos | Particle starting position |
| [in] | a_newPos | Particle end position |
| [in] | a_bisectStep | Bisection step length |
| [out] | a_s | Relative length along the path |
- Returns
- Returns true if the particle crossed into the EB.
| bool ParticleOps::ebIntersectionRaycast |
( |
const RefCountedPtr< BaseIF > & |
a_impFunc, |
|
|
const RealVect & |
a_oldPos, |
|
|
const RealVect & |
a_newPos, |
|
|
const Real & |
a_tolerance, |
|
|
Real & |
a_s |
|
) |
| |
|
inlinestatic |
Compute the intersection point between a particle path and an implicit function using a ray-casting algorithm.
This routine will assume that a_impcFunc is an approximation to the signed distance function and compute the intersection point using ray-marching. Starting on the starting position we compute the distance to the EB and move the particle the compute distance along the particle trajectory. If the particle comes too close to the EB (within a_tolerance) we consider it to be absorbed. In that case the output argument a_s determines the intersection point by x(s) = x0 + s*(x1-x0) where x0 is the starting position (a_oldPos), x1 is the end position (a_newPos), and x(s) is the intersection point with the geometry.
- Parameters
-
| [in] | a_impFunc | Implicit function. |
| [in] | a_oldPos | Particle starting position |
| [in] | a_newPos | Particle end position |
| [out] | a_s | Relative length along the path |
- Returns
- Returns true if the particle crossed into the EB.
- Parameters
-