WarpX
Loading...
Searching...
No Matches
PhotonCreationFunc Class Reference

This functor creates photons produced from a binary collision and sets their initial properties (position, momentum, weight). More...

#include <PhotonCreationFunc.H>

Public Member Functions

 PhotonCreationFunc ()=default
 Default constructor of the PhotonCreationFunc class.
 
 PhotonCreationFunc (const std::string &collision_name, MultiParticleContainer const *mypc)
 Constructor of the PhotonCreationFunc class.
 
AMREX_INLINE amrex::Vector< int > operator() (const index_type &n_total_pairs, ParticleTileType &ptile1, ParticleTileType &ptile2, const amrex::Vector< WarpXParticleContainer * > &pc_products, ParticleTileType **AMREX_RESTRICT tile_products, const amrex::ParticleReal &m1, const amrex::ParticleReal &m2, const amrex::Vector< amrex::ParticleReal > &, const index_type *AMREX_RESTRICT p_mask, const amrex::Vector< index_type > &products_np, const SmartCopy *AMREX_RESTRICT copy_species1, const SmartCopy *, 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 amrex::ParticleReal *AMREX_RESTRICT p_product_data) const
 operator() of the PhotonCreationFunc class. It creates new photon particles from binary collisions. One product particle is created at the position of the first parent particle that collided. For example, with the Bremsstrahlung collision between an electron and an ion, the new photon is created at the position of the electron. This function also sets the initial weight of the new photon to be the same as the weight of the first parent. This function sets the initial momentum of the product particles, by calling a function specific to the considered binary collision. Finally, this function subtracts the energy of the new photon from the first parent, i.e. the electron.
 

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
 
bool m_create_photons
 
CollisionType m_collision_type
 

Detailed Description

This functor creates photons produced from a binary collision and sets their initial properties (position, momentum, weight).

Member Typedef Documentation

◆ index_type

◆ ParticleBins

◆ ParticleTileDataType

using PhotonCreationFunc::ParticleTileDataType = typename ParticleTileType::ParticleTileDataType
private

◆ ParticleTileType

◆ ParticleType

◆ SoaData_type

using PhotonCreationFunc::SoaData_type = typename WarpXParticleContainer::ParticleTileType::ParticleTileDataType
private

Constructor & Destructor Documentation

◆ PhotonCreationFunc() [1/2]

PhotonCreationFunc::PhotonCreationFunc ( )
default

Default constructor of the PhotonCreationFunc class.

◆ PhotonCreationFunc() [2/2]

PhotonCreationFunc::PhotonCreationFunc ( const std::string & collision_name,
MultiParticleContainer const * mypc )

Constructor of the PhotonCreationFunc class.

Parameters
[in]collision_namethe name of the collision
[in]mypcpointer to the MultiParticleContainer

Member Function Documentation

◆ operator()()

AMREX_INLINE amrex::Vector< int > PhotonCreationFunc::operator() ( const index_type & n_total_pairs,
ParticleTileType & ptile1,
ParticleTileType & ptile2,
const amrex::Vector< WarpXParticleContainer * > & pc_products,
ParticleTileType **AMREX_RESTRICT tile_products,
const amrex::ParticleReal & m1,
const amrex::ParticleReal & m2,
const amrex::Vector< amrex::ParticleReal > & ,
const index_type *AMREX_RESTRICT p_mask,
const amrex::Vector< index_type > & products_np,
const SmartCopy *AMREX_RESTRICT copy_species1,
const SmartCopy * ,
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 amrex::ParticleReal *AMREX_RESTRICT p_product_data ) const
inline

operator() of the PhotonCreationFunc class. It creates new photon particles from binary collisions. One product particle is created at the position of the first parent particle that collided. For example, with the Bremsstrahlung collision between an electron and an ion, the new photon is created at the position of the electron. This function also sets the initial weight of the new photon to be the same as the weight of the first parent. This function sets the initial momentum of the product particles, by calling a function specific to the considered binary collision. Finally, this function subtracts the energy of the new photon from the first parent, i.e. the electron.

Parameters
[in]n_total_pairshow many binary collisions have been performed in this tile
[in,out]ptile1,ptile2the particle tiles of the two colliding species
[out]pc_productsthe products particle container
[out]tile_productsarray containing tile data of the product particles.
[in]m1mass of the first colliding particle species
[in]m2mass of the second colliding particle species
[in]p_maska mask that is 1 if binary collision has resulted in particle creation event, 0 otherwise.
[in]products_nparray storing the number of existing product particles in that tile
[in]copy_species1array of functors used to copy data from the first colliding particle species to the product particles and to default initialize product particle quantities.
[in]p_pair_indices_1array 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_2array 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_weightarray that stores the photon weight
[in]p_product_dataarray that stores the photon energy

Member Data Documentation

◆ m_collision_type

CollisionType PhotonCreationFunc::m_collision_type
private

◆ m_create_photons

bool PhotonCreationFunc::m_create_photons
private

◆ m_num_product_species

int PhotonCreationFunc::m_num_product_species
private

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