WarpX
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
VelocityCoincidenceThinning Class Reference

This class implements a particle merging scheme wherein particles are clustered in phase space and particles in the same cluster is merged into two remaining particles. The scheme conserves linear momentum and kinetic energy within each cluster. More...

#include <VelocityCoincidenceThinning.H>

Inheritance diagram for VelocityCoincidenceThinning:
ResamplingAlgorithm

Classes

struct  HeapSort
 This merging routine requires functionality to sort a GPU vector based on another GPU vector's values. The heap-sort functions below were obtained from https://www.geeksforgeeks.org/iterative-heap-sort/ and modified for the current purpose. It achieves the same as. More...
 
struct  VelocityBinCalculator
 Struct used to assign velocity space bin numbers to a given set of particles. More...
 

Public Types

enum class  VelocityGridType { Spherical = 0 , Cartesian = 1 }
 

Public Member Functions

 VelocityCoincidenceThinning ()=default
 Default constructor of the VelocityCoincidenceThinning class. More...
 
 VelocityCoincidenceThinning (const std::string &species_name)
 Constructor of the VelocityCoincidenceThinning class. More...
 
void operator() (WarpXParIter &pti, int lev, WarpXParticleContainer *pc) const final
 A method that performs merging for the considered species. More...
 
- Public Member Functions inherited from ResamplingAlgorithm
virtual ~ResamplingAlgorithm ()=default
 Virtual destructor of the abstract ResamplingAlgorithm class. More...
 
 ResamplingAlgorithm ()=default
 
 ResamplingAlgorithm (ResamplingAlgorithm const &)=default
 
ResamplingAlgorithmoperator= (ResamplingAlgorithm const &)=default
 
 ResamplingAlgorithm (ResamplingAlgorithm &&)=default
 
ResamplingAlgorithmoperator= (ResamplingAlgorithm &&)=default
 

Private Attributes

VelocityGridType m_velocity_grid_type
 
int m_min_ppc = 1
 
int m_ntheta
 
int m_nphi
 
amrex::ParticleReal m_delta_ur
 
amrex::Vector< amrex::ParticleReal > m_delta_u
 

Detailed Description

This class implements a particle merging scheme wherein particles are clustered in phase space and particles in the same cluster is merged into two remaining particles. The scheme conserves linear momentum and kinetic energy within each cluster.

Member Enumeration Documentation

◆ VelocityGridType

Enumerator
Spherical 
Cartesian 

Constructor & Destructor Documentation

◆ VelocityCoincidenceThinning() [1/2]

VelocityCoincidenceThinning::VelocityCoincidenceThinning ( )
default

Default constructor of the VelocityCoincidenceThinning class.

◆ VelocityCoincidenceThinning() [2/2]

VelocityCoincidenceThinning::VelocityCoincidenceThinning ( const std::string &  species_name)

Constructor of the VelocityCoincidenceThinning class.

Parameters
[in]species_namethe name of the resampled species

Member Function Documentation

◆ operator()()

void VelocityCoincidenceThinning::operator() ( WarpXParIter pti,
int  lev,
WarpXParticleContainer pc 
) const
finalvirtual

A method that performs merging for the considered species.

Parameters
[in]ptiWarpX particle iterator of the particles to resample.
[in]levthe index of the refinement level.
[in]pca pointer to the particle container.

Implements ResamplingAlgorithm.

Member Data Documentation

◆ m_delta_u

amrex::Vector<amrex::ParticleReal> VelocityCoincidenceThinning::m_delta_u
private

◆ m_delta_ur

amrex::ParticleReal VelocityCoincidenceThinning::m_delta_ur
private

◆ m_min_ppc

int VelocityCoincidenceThinning::m_min_ppc = 1
private

◆ m_nphi

int VelocityCoincidenceThinning::m_nphi
private

◆ m_ntheta

int VelocityCoincidenceThinning::m_ntheta
private

◆ m_velocity_grid_type

VelocityGridType VelocityCoincidenceThinning::m_velocity_grid_type
private

The documentation for this class was generated from the following files: