|
WarpX
|
#include <WarpXParticleContainer.H>
Public Types | |
| using | DiagnosticParticleData = amrex::StructOfArrays< DiagIdx::nattribs, 0 > |
| using | DiagnosticParticles = amrex::Vector< std::map< std::pair< int, int >, DiagnosticParticleData > > |
| using | PairIndex = std::pair< int, int > |
| using | TmpParticleTile = std::array< amrex::Gpu::DeviceVector< amrex::ParticleReal >, TmpIdx::nattribs > |
| using | TmpParticles = amrex::Vector< std::map< PairIndex, TmpParticleTile > > |
Public Member Functions | |
| WarpXParticleContainer (amrex::AmrCore *amr_core, int ispecies) | |
| virtual | ~WarpXParticleContainer () |
| virtual void | InitData ()=0 |
| virtual void | Evolve (int lev, const amrex::MultiFab &Ex, const amrex::MultiFab &Ey, const amrex::MultiFab &Ez, const amrex::MultiFab &Bx, const amrex::MultiFab &By, const amrex::MultiFab &Bz, const amrex::MultiFab &Ex_avg, const amrex::MultiFab &Ey_avg, const amrex::MultiFab &Ez_avg, const amrex::MultiFab &Bx_avg, const amrex::MultiFab &By_avg, const amrex::MultiFab &Bz_avg, amrex::MultiFab &jx, amrex::MultiFab &jy, amrex::MultiFab &jz, amrex::MultiFab *cjx, amrex::MultiFab *cjy, amrex::MultiFab *cjz, amrex::MultiFab *rho, amrex::MultiFab *crho, const amrex::MultiFab *cEx, const amrex::MultiFab *cEy, const amrex::MultiFab *cEz, const amrex::MultiFab *cBx, const amrex::MultiFab *cBy, const amrex::MultiFab *cBz, amrex::Real t, amrex::Real dt, DtType a_dt_type=DtType::Full)=0 |
| virtual void | PostRestart ()=0 |
| virtual void | GetParticleSlice (const int, const amrex::Real, const amrex::Real, const amrex::Real, const amrex::Real, const amrex::Real, DiagnosticParticles &) |
| void | AllocData () |
| void | PushX (amrex::Real dt) |
| void | PushX (int lev, amrex::Real dt) |
| virtual void | PushP (int lev, amrex::Real dt, const amrex::MultiFab &Ex, const amrex::MultiFab &Ey, const amrex::MultiFab &Ez, const amrex::MultiFab &Bx, const amrex::MultiFab &By, const amrex::MultiFab &Bz)=0 |
| void | DepositCharge (amrex::Vector< std::unique_ptr< amrex::MultiFab > > &rho, bool local=false, bool reset=false, bool do_rz_volume_scaling=false) |
| std::unique_ptr< amrex::MultiFab > | GetChargeDensity (int lev, bool local=false) |
| virtual void | DepositCharge (WarpXParIter &pti, RealVector &wp, const int *const ion_lev, amrex::MultiFab *rho, int icomp, const long offset, const long np_to_depose, int thread_num, int lev, int depos_lev) |
| virtual void | DepositCurrent (WarpXParIter &pti, RealVector &wp, RealVector &uxp, RealVector &uyp, RealVector &uzp, const int *const ion_lev, amrex::MultiFab *jx, amrex::MultiFab *jy, amrex::MultiFab *jz, const long offset, const long np_to_depose, int thread_num, int lev, int depos_lev, amrex::Real dt) |
| virtual void | ContinuousInjection (const amrex::RealBox &) |
| virtual void | UpdateContinuousInjectionPosition (amrex::Real) |
| amrex::Real | sumParticleCharge (bool local=false) |
| std::array< amrex::Real, 3 > | meanParticleVelocity (bool local=false) |
| amrex::Real | maxParticleVelocity (bool local=false) |
| void | AddNParticles (int lev, int n, const amrex::ParticleReal *x, const amrex::ParticleReal *y, const amrex::ParticleReal *z, const amrex::ParticleReal *vx, const amrex::ParticleReal *vy, const amrex::ParticleReal *vz, int nattr, const amrex::ParticleReal *attr, int uniqueparticles, amrex::Long id=-1) |
| virtual void | ReadHeader (std::istream &is) |
| virtual void | WriteHeader (std::ostream &os) const |
| virtual void | ConvertUnits (ConvertDirection) |
| void | ApplyBoundaryConditions (ParticleBC boundary_conditions) |
| Apply particle BC. More... | |
| void | AddRealComp (const std::string &name, bool comm=true) |
| void | AddIntComp (const std::string &name, bool comm=true) |
| int | doBackTransformedDiagnostics () const |
| std::map< std::string, int > | getParticleComps () const noexcept |
| std::map< std::string, int > | getParticleiComps () const noexcept |
| std::map< std::string, int > | getParticleRuntimeComps () const noexcept |
| std::map< std::string, int > | getParticleRuntimeiComps () const noexcept |
| amrex::ParticleReal | getCharge () const |
| amrex::ParticleReal | getMass () const |
| int | DoFieldIonization () const |
| int | DoQED () const |
| virtual bool | has_quantum_sync () const |
| virtual bool | has_breit_wheeler () const |
| template<PhysicalSpecies PhysSpec> | |
| bool | AmIA () const noexcept |
| amrex::Array< amrex::Real, 3 > | get_v_galilean () |
| virtual void | resample (const int) |
| Virtual method to resample the species. Overriden by PhysicalParticleContainer only. Empty body is here because making the method purely virtual would mean that we need to override the method for every derived class. Note that in practice this function is never called because resample() is only called for PhysicalParticleContainers. More... | |
Static Public Member Functions | |
| static void | ReadParameters () |
| static void | BackwardCompatibility () |
Public Attributes | |
| friend | MultiParticleContainer |
| bool | do_splitting = false |
| bool | initialize_self_fields = false |
| amrex::Real | self_fields_required_precision = 1.e-11 |
| int | split_type = 0 |
| bool | m_do_random_filter = false |
| bool | m_do_uniform_filter = false |
| bool | m_do_parser_filter = false |
| amrex::Real | m_random_fraction = 1.0 |
| int | m_uniform_stride = 1 |
| std::unique_ptr< ParserWrapper< 7 > > | m_particle_filter_parser |
Protected Member Functions | |
| virtual void | set_breit_wheeler_engine_ptr (std::shared_ptr< BreitWheelerEngine >) |
| virtual void | set_quantum_sync_engine_ptr (std::shared_ptr< QuantumSynchrotronEngine >) |
| void | defineAllParticleTiles () noexcept |
Protected Attributes | |
| amrex::Array< amrex::Real, 3 > | m_v_galilean = {{0}} |
| std::map< std::string, int > | particle_comps |
| std::map< std::string, int > | particle_icomps |
| std::map< std::string, int > | particle_runtime_comps |
| std::map< std::string, int > | particle_runtime_icomps |
| int | species_id |
| amrex::Real | charge |
| amrex::Real | mass |
| PhysicalSpecies | physical_species |
| bool | m_deposit_on_main_grid = false |
| instead of depositing (current, charge) on the finest patch level, deposit to the coarsest grid More... | |
| bool | m_gather_from_main_grid = false |
| instead of gathering fields from the finest patch level, gather from the coarsest More... | |
| int | do_not_push = 0 |
| int | do_not_deposit = 0 |
| int | do_not_gather = 0 |
| int | do_continuous_injection = 0 |
| int | do_field_ionization = 0 |
| int | ionization_product |
| std::string | ionization_product_name |
| int | ion_atomic_number |
| int | ionization_initial_level = 0 |
| amrex::Gpu::DeviceVector< amrex::Real > | ionization_energies |
| amrex::Gpu::DeviceVector< amrex::Real > | adk_power |
| amrex::Gpu::DeviceVector< amrex::Real > | adk_prefactor |
| amrex::Gpu::DeviceVector< amrex::Real > | adk_exp_prefactor |
| std::string | physical_element |
| int | do_resampling = 0 |
| int | do_back_transformed_diagnostics = 1 |
| bool | m_do_qed = false |
| int | m_qed_breit_wheeler_ele_product |
| std::string | m_qed_breit_wheeler_ele_product_name |
| int | m_qed_breit_wheeler_pos_product |
| std::string | m_qed_breit_wheeler_pos_product_name |
| int | m_qed_quantum_sync_phot_product |
| std::string | m_qed_quantum_sync_phot_product_name |
| amrex::Vector< amrex::FArrayBox > | local_rho |
| amrex::Vector< amrex::FArrayBox > | local_jx |
| amrex::Vector< amrex::FArrayBox > | local_jy |
| amrex::Vector< amrex::FArrayBox > | local_jz |
| TmpParticles | tmp_particle_data |
Private Member Functions | |
| virtual void | particlePostLocate (ParticleType &p, const amrex::ParticleLocData &pld, const int lev) override |
Friends | |
| class | WarpXOpenPMDPlot |
WarpXParticleContainer is the base polymorphic class from which all concrete particle container classes (that store a collection of particles) derive. Derived classes can be used for plasma particles, photon particles, or non-physical particles (e.g., for the laser antenna). It derives from amrex::ParticleContainer<0,0,PIdx::nattribs>, where the template arguments stand for the number of int and amrex::Real SoA and AoS data in amrex::Particle.
WarpXParticleContainer contains the main functions for initialization, interaction with the grid (field gather and current deposition) and particle push.
Note: many functions are pure virtual (meaning they MUST be defined in derived classes, e.g., Evolve) or actual functions (e.g. CurrentDeposition).
| using WarpXParticleContainer::DiagnosticParticleData = amrex::StructOfArrays<DiagIdx::nattribs, 0> |
| using WarpXParticleContainer::DiagnosticParticles = amrex::Vector<std::map<std::pair<int, int>, DiagnosticParticleData> > |
| using WarpXParticleContainer::PairIndex = std::pair<int, int> |
| using WarpXParticleContainer::TmpParticles = amrex::Vector<std::map<PairIndex, TmpParticleTile> > |
| using WarpXParticleContainer::TmpParticleTile = std::array<amrex::Gpu::DeviceVector<amrex::ParticleReal>, TmpIdx::nattribs> |
| WarpXParticleContainer::WarpXParticleContainer | ( | amrex::AmrCore * | amr_core, |
| int | ispecies | ||
| ) |
|
inlinevirtual |
|
inline |
| void WarpXParticleContainer::AddNParticles | ( | int | lev, |
| int | n, | ||
| const amrex::ParticleReal * | x, | ||
| const amrex::ParticleReal * | y, | ||
| const amrex::ParticleReal * | z, | ||
| const amrex::ParticleReal * | vx, | ||
| const amrex::ParticleReal * | vy, | ||
| const amrex::ParticleReal * | vz, | ||
| int | nattr, | ||
| const amrex::ParticleReal * | attr, | ||
| int | uniqueparticles, | ||
| amrex::Long | id = -1 |
||
| ) |
nattr is unused below: false sense of safety
|
inline |
| void WarpXParticleContainer::AllocData | ( | ) |
|
inlinenoexcept |
| void WarpXParticleContainer::ApplyBoundaryConditions | ( | ParticleBC | boundary_conditions | ) |
Apply particle BC.
| [in] | boundary_conditions | Type of boundary conditions. For now, only absorbing or none are supported |
|
static |
|
inlinevirtual |
Reimplemented in PhysicalParticleContainer, and LaserParticleContainer.
|
inlinevirtual |
Reimplemented in PhysicalParticleContainer.
|
protectednoexcept |
When using runtime components, AMReX requires to touch all tiles in serial and create particles tiles with runtime components if they do not exist (or if they were defined by default, i.e., without runtime component).
| void WarpXParticleContainer::DepositCharge | ( | amrex::Vector< std::unique_ptr< amrex::MultiFab > > & | rho, |
| bool | local = false, |
||
| bool | reset = false, |
||
| bool | do_rz_volume_scaling = false |
||
| ) |
|
virtual |
|
virtual |
Reimplemented in PhotonParticleContainer.
|
inline |
|
inline |
|
inline |
|
pure virtual |
Evolve is the central WarpXParticleContainer function that advances particles for a time dt (typically one timestep). It is a pure virtual function for flexibility.
Implemented in PhysicalParticleContainer, RigidInjectedParticleContainer, LaserParticleContainer, and PhotonParticleContainer.
|
inline |
|
inline |
| std::unique_ptr< MultiFab > WarpXParticleContainer::GetChargeDensity | ( | int | lev, |
| bool | local = false |
||
| ) |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinevirtual |
Reimplemented in PhysicalParticleContainer.
|
inlinevirtual |
Reimplemented in PhysicalParticleContainer.
|
inlinevirtual |
Reimplemented in PhysicalParticleContainer.
|
pure virtual |
Implemented in PhysicalParticleContainer, RigidInjectedParticleContainer, LaserParticleContainer, and PhotonParticleContainer.
| Real WarpXParticleContainer::maxParticleVelocity | ( | bool | local = false | ) |
| std::array< Real, 3 > WarpXParticleContainer::meanParticleVelocity | ( | bool | local = false | ) |
|
overrideprivatevirtual |
|
pure virtual |
Implemented in PhysicalParticleContainer, and LaserParticleContainer.
|
pure virtual |
This pushes the particle momenta by dt.
Implemented in PhysicalParticleContainer, RigidInjectedParticleContainer, PhotonParticleContainer, and LaserParticleContainer.
| void WarpXParticleContainer::PushX | ( | amrex::Real | dt | ) |
This pushes the particle positions by one half time step. It is used to desynchronize the particles after initializaton or when restarting from a checkpoint.
| void WarpXParticleContainer::PushX | ( | int | lev, |
| amrex::Real | dt | ||
| ) |
|
virtual |
Reimplemented in RigidInjectedParticleContainer.
|
static |
|
inlinevirtual |
Virtual method to resample the species. Overriden by PhysicalParticleContainer only. Empty body is here because making the method purely virtual would mean that we need to override the method for every derived class. Note that in practice this function is never called because resample() is only called for PhysicalParticleContainers.
Reimplemented in PhysicalParticleContainer.
|
inlineprotectedvirtual |
Reimplemented in PhysicalParticleContainer.
|
inlineprotectedvirtual |
Reimplemented in PhysicalParticleContainer.
| Real WarpXParticleContainer::sumParticleCharge | ( | bool | local = false | ) |
This returns the total charge for all the particles in this ParticleContainer. This is needed when solving Poisson's equation with periodic boundary conditions.
|
inlinevirtual |
Reimplemented in LaserParticleContainer.
|
virtual |
Reimplemented in RigidInjectedParticleContainer.
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| bool WarpXParticleContainer::do_splitting = false |
| bool WarpXParticleContainer::initialize_self_fields = false |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
instead of depositing (current, charge) on the finest patch level, deposit to the coarsest grid
| bool WarpXParticleContainer::m_do_parser_filter = false |
|
protected |
| bool WarpXParticleContainer::m_do_random_filter = false |
| bool WarpXParticleContainer::m_do_uniform_filter = false |
|
protected |
instead of gathering fields from the finest patch level, gather from the coarsest
| std::unique_ptr<ParserWrapper<7> > WarpXParticleContainer::m_particle_filter_parser |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| amrex::Real WarpXParticleContainer::m_random_fraction = 1.0 |
| int WarpXParticleContainer::m_uniform_stride = 1 |
|
protected |
|
protected |
| friend WarpXParticleContainer::MultiParticleContainer |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| amrex::Real WarpXParticleContainer::self_fields_required_precision = 1.e-11 |
|
protected |
| int WarpXParticleContainer::split_type = 0 |
|
protected |
1.8.13