chombo-discharge
|
A shallow static class for doing various kinds of particle-related operations. More...
#include <CD_ParticleOps.H>
Static Public Member Functions | |
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. More... | |
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. More... | |
template<typename P , const Real &(P::*)() const weight> | |
static void | getPhysicalParticlesPerCell (EBAMRCellData &a_ppc, const ParticleContainer< P > &a_src) noexcept |
Get the number of physical particles per cell. More... | |
template<typename P > | |
static void | getComputationalParticlesPerCell (EBAMRCellData &a_ppc, const ParticleContainer< P > &a_src) noexcept |
Get the number of computational particles per cell. More... | |
static IntVect | getParticleGridCell (const RealVect &a_particlePosition, const RealVect &a_probLo, const RealVect &a_dx) noexcept |
Get the grid cell where the particle lives. More... | |
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. More... | |
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. More... | |
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. More... | |
template<typename P > | |
static void | copy (ParticleContainer< P > &a_dst, const ParticleContainer< P > &a_src) noexcept |
Copy all the particles from the a_src to a_dst. More... | |
template<typename P > | |
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. More... | |
template<typename P , const Real &(P::*)() const scalarQuantity> | |
static Real | sum (const ParticleContainer< P > &a_particles) noexcept |
Perform a sum of some particle quantity. More... | |
template<typename P , Real(P::*)() scalarQuantity> | |
static Real | sum (const ParticleContainer< P > &a_particles) noexcept |
Perform a sum of some particle quantity. More... | |
template<typename P > | |
static void | removeParticles (ParticleContainer< P > &a_particles, const std::function< bool(const P &)> &a_removeCriterion) noexcept |
Remove particles if they fulfill certain removal criterion. More... | |
template<typename P > | |
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 and puts them in a_dstParticles. More... | |
template<typename P > | |
static void | setData (ParticleContainer< P > &a_particles, const std::function< void(P &)> &a_functor) noexcept |
Set value function. Lets the user set particle parameters. More... | |
template<typename P , Real &(P::*)() particleScalarField> | |
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, &P::weight>(particles, 0.0) etc. More... | |
template<typename P , RealVect &(P::*)() particleVectorField> | |
static void | setValue (ParticleContainer< P > &a_particles, const RealVect a_value) noexcept |
Set value function. Lets the user set scalar particle quantity. Use with e.g. setValue<P, &P::velocity>(particles, RealVect::Unit) etc. More... | |
A shallow static class for doing various kinds of particle-related operations.
|
inlinestaticnoexcept |
Copy all the particles from the a_src to a_dst.
[out] | a_dst | Copy of original particles. |
[out] | a_src | Source particles |
|
inlinestaticnoexcept |
Copy all the particles from the a_src to a_dst. This destroys the source particles.
[out] | a_dst | Copy of original particles. |
[out] | a_src | Source particles |
|
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.
[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 |
|
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.
[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 |
|
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.
[in] | a_impFunc | Implicit function. |
[in] | a_oldPos | Particle starting position |
[in] | a_newPos | Particle end position |
[in] | a_tolerace | Tolerance for intersectinon method. If the distance to the EB is less than this, the particle is absorbed. |
[out] | a_s | Relative length along the path |
|
inlinestaticnoexcept |
Get the number of computational particles per cell.
[out] | a_ppc | Physical particles per cell |
[in] | a_src | Particle source container. |
|
inlinestaticnoexcept |
Get the cell index corresponding to the particle position.
[in] | a_particlePosition | Particle position |
[in] | a_probLo | Lower-left corner of computational domain |
[in] | a_dx | Grid resolution |
|
inlinestaticnoexcept |
Get the cell index corresponding to the particle position.
[in] | a_particlePosition | Particle position |
[in] | a_probLo | Lower-left corner of computational domain |
[in] | a_dx | Grid resolution |
|
inlinestaticnoexcept |
Get the grid cell where the particle lives.
[in] | a_particlePosition | Physical particle position |
[in] | a_probLo | Lower-left physical corner of simulation domain |
[in] | a_dx | Grid resolution. |
|
inlinestaticnoexcept |
Get the number of physical particles per cell.
[out] | a_ppc | Physical particles per cell |
[in] | a_src | Particle source container. |
The second template parameter is a pointer to a member function in P that provides the number of physical particles for the computational particles. If P has a function const Real& P::weight() const, we can call this as
ParticleOps::getPhysicalParticlesPerCell<P, &P::weight>(...)
|
inlinestaticnoexcept |
Remove particles if they fulfill certain removal criterion.
[in,out] | a_particles | Particles |
[in] | a_removeCriterion | Removal criterion. |
|
inlinestaticnoexcept |
Set value function. Lets the user set particle parameters.
[in,out] | a_particles | Particles |
[in] | a_functor | Lambda for setting particle values |
|
inlinestaticnoexcept |
Set value function. Lets the user set scalar particle quantity. Use with e.g. setValue<P, &P::weight>(particles, 0.0) etc.
[in,out] | a_particles | Particles |
[in] | a_value | Value to set |
|
inlinestaticnoexcept |
Set value function. Lets the user set scalar particle quantity. Use with e.g. setValue<P, &P::velocity>(particles, RealVect::Unit) etc.
[in,out] | a_particles | Particles |
[in] | a_value | Value to set |
|
inlinestaticnoexcept |
Perform a sum of some particle quantity.
[in] | a_particles | Particles |
|
inlinestaticnoexcept |
Perform a sum of some particle quantity.
[in] | a_particles | Particles |
|
inlinestaticnoexcept |
Transfer particles if they fulfill a certain removal criterion. Takes particles from a_srcParticles and puts them in a_dstParticles.
[in,out] | a_dstParticles | Destination particle data holder |
[in,out] | a_srcParticles | Source particle data holder |
[in] | a_removeCriterion | Removal criterion. |