WarpX
|
This functor creates particles produced from a binary collision and sets their initial properties (position, momentum, weight). More...
#include <ParticleCreationFunc.H>
Public Member Functions | |
ParticleCreationFunc ()=default | |
Default constructor of the ParticleCreationFunc class. More... | |
ParticleCreationFunc (const std::string &collision_name, MultiParticleContainer const *mypc) | |
Constructor of the ParticleCreationFunc class. More... | |
AMREX_INLINE amrex::Vector< int > | operator() (const index_type &n_total_pairs, const SoaData_type &soa_1, const SoaData_type &soa_2, const amrex::Vector< WarpXParticleContainer * > &pc_products, ParticleTileType **AMREX_RESTRICT tile_products, const amrex::ParticleReal &m1, const amrex::ParticleReal &m2, const amrex::Vector< amrex::ParticleReal > &products_mass, const index_type *AMREX_RESTRICT p_mask, const amrex::Vector< index_type > &products_np, const SmartCopy *AMREX_RESTRICT copy_species1, const SmartCopy *AMREX_RESTRICT copy_species2, const index_type *AMREX_RESTRICT p_pair_indices_1, const index_type *AMREX_RESTRICT p_pair_indices_2, const amrex::ParticleReal *AMREX_RESTRICT p_pair_reaction_weight) const |
operator() of the ParticleCreationFunc class. It creates new particles from binary collisions. One product particle is created at the position of each parent particle that collided, allowing for exact charge conservation. For example, in the nuclear reaction "proton + boron -> 3 alpha", we actually create 6 new alpha particles, 3 at the position of of the proton and 3 at the position of the boron. This function also sets the initial weight of the produced particles and subtracts it from the parent particles. If the weight of a parent particle becomes 0, then that particle is deleted. Finally, this function sets the initial momentum of the product particles, by calling a function specific to the considered binary collision. More... | |
Private Types | |
using | ParticleType = typename WarpXParticleContainer::ParticleType |
using | ParticleTileType = typename WarpXParticleContainer::ParticleTileType |
using | ParticleTileDataType = typename ParticleTileType::ParticleTileDataType |
using | ParticleBins = amrex::DenseBins< ParticleTileDataType > |
using | index_type = typename ParticleBins::index_type |
using | SoaData_type = typename WarpXParticleContainer::ParticleTileType::ParticleTileDataType |
Private Attributes | |
int | m_num_product_species |
amrex::Gpu::DeviceVector< int > | m_num_products_device |
amrex::Gpu::HostVector< int > | m_num_products_host |
CollisionType | m_collision_type |
This functor creates particles produced from a binary collision and sets their initial properties (position, momentum, weight).
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
default |
Default constructor of the ParticleCreationFunc class.
ParticleCreationFunc::ParticleCreationFunc | ( | const std::string & | collision_name, |
MultiParticleContainer const * | mypc | ||
) |
Constructor of the ParticleCreationFunc class.
[in] | collision_name | the name of the collision |
[in] | mypc | pointer to the MultiParticleContainer |
|
inline |
operator() of the ParticleCreationFunc class. It creates new particles from binary collisions. One product particle is created at the position of each parent particle that collided, allowing for exact charge conservation. For example, in the nuclear reaction "proton + boron -> 3 alpha", we actually create 6 new alpha particles, 3 at the position of of the proton and 3 at the position of the boron. This function also sets the initial weight of the produced particles and subtracts it from the parent particles. If the weight of a parent particle becomes 0, then that particle is deleted. Finally, this function sets the initial momentum of the product particles, by calling a function specific to the considered binary collision.
[in] | n_total_pairs | how many binary collisions have been performed in this tile |
[in,out] | soa_1 | struct of array data of the first colliding particle species |
[in,out] | soa_2 | struct of array data of the second colliding particle species |
[out] | tile_products | array containing tile data of the product particles. |
[in] | m1 | mass of the first colliding particle species |
[in] | m2 | mass of the second colliding particle species |
[in] | products_mass | array storing the mass of product particles |
[in] | p_mask | a mask that is 1 if binary collision has resulted in particle creation event, 0 otherwise. |
[in] | products_np | array storing the number of existing product particles in that tile |
[in] | copy_species1 | array of functors used to copy data from the first colliding particle species to the product particles and to default initialize product particle quantities. |
[in] | copy_species2 | array of functors used to copy data from the second colliding particle species to the product particles and to default initialize product particle quantities. |
[in] | p_pair_indices_1 | array that stores the indices of the particles of the first colliding species that were used in the binary collisions (i.e. particle with index p_pair_indices_1[i] took part in collision i) |
[in] | p_pair_indices_2 | array that stores the indices of the particles of the second colliding species that were used in the binary collisions (i.e. particle with index p_pair_indices_2[i] took part in collision i) |
[in] | p_pair_reaction_weight | array that stores the weight of the binary collisions. This weight is removed from the parent particles and given to the product particles. |
|
private |
|
private |
|
private |
|
private |