diff options
Diffstat (limited to 'Source/Particles/PhysicalParticleContainer.H')
-rw-r--r-- | Source/Particles/PhysicalParticleContainer.H | 165 |
1 files changed, 159 insertions, 6 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.H b/Source/Particles/PhysicalParticleContainer.H index b18c9b5f8..9e113a24b 100644 --- a/Source/Particles/PhysicalParticleContainer.H +++ b/Source/Particles/PhysicalParticleContainer.H @@ -10,6 +10,7 @@ #ifdef WARPX_QED #include <QuantumSyncEngineWrapper.H> #include <BreitWheelerEngineWrapper.H> + #include <QedChiFunctions.H> #endif #include <map> @@ -186,13 +187,38 @@ public: amrex::FArrayBox const * & byfab, amrex::FArrayBox const * & bzfab); #ifdef WARPX_QED + //Functions decleared in WarpXParticleContainer.H + //containers for which QED processes could be relevant + //are expected to override these functions + + /** + * Tells if this PhysicalParticleContainer has Quantum + * Synchrotron process enabled + * @return true if process is enabled + */ bool has_quantum_sync() override; + + /** + * Tells if this PhysicalParticleContainer has Breit + * Wheeler process enabled + * @return true if process is enabled + */ bool has_breit_wheeler() override; + /** + * Acquires a shared smart pointer to a BreitWheelerEngine + * @param[in] ptr the pointer + */ void set_breit_wheeler_engine_ptr - (std::shared_ptr<BreitWheelerEngine>) override; + (std::shared_ptr<BreitWheelerEngine> ptr) override; + + /** + * Acquires a shared smart pointer to a QuantumSynchrotronEngine + * @param[in] ptr the pointer + */ void set_quantum_sync_engine_ptr - (std::shared_ptr<QuantumSynchrotronEngine>) override; + (std::shared_ptr<QuantumSynchrotronEngine> ptr) override; + //__________ #endif protected: @@ -219,16 +245,143 @@ protected: #ifdef WARPX_QED // A flag to enable quantum_synchrotron process for leptons - bool do_qed_quantum_sync = false; + bool m_do_qed_quantum_sync = false; // A flag to enable breit_wheeler process [photons only!!] - bool do_qed_breit_wheeler = false; + bool m_do_qed_breit_wheeler = false; // A smart pointer to an instance of a Quantum Synchrotron engine - std::shared_ptr<QuantumSynchrotronEngine> shr_ptr_qs_engine; + std::shared_ptr<QuantumSynchrotronEngine> m_shr_p_qs_engine; // A smart pointer to an instance of a Breit Wheeler engine [photons only!] - std::shared_ptr<BreitWheelerEngine> shr_ptr_bw_engine; + std::shared_ptr<BreitWheelerEngine> m_shr_p_bw_engine; +#endif + +// PushPX and PushP has been split into two methods (classical and QED versions) +// these methods must be public to be compatible with CUDA) +public: + //Classical versions + + /** + * This function actually pushes momenta and positions when QED effects + * are disabled. + * @param[in,out] x,y,z positions + * @param[in,out] ux,uy,uz momenta + * @param[in] Ex,Ey,Ez electric fields + * @param[in] Bx,By,Bz magnetic fields + * @param[in] q charge + * @param[in] m mass + * @param[in,out] ion_lev ionization level + * @param[in] dt temporal step + * @param[in] num_particles number of particles + */ + void PushPX_classical( + amrex::ParticleReal* const AMREX_RESTRICT x, + amrex::ParticleReal* const AMREX_RESTRICT y, + amrex::ParticleReal* const AMREX_RESTRICT z, + amrex::ParticleReal* const AMREX_RESTRICT ux, + amrex::ParticleReal* const AMREX_RESTRICT uy, + amrex::ParticleReal* const AMREX_RESTRICT uz, + const amrex::ParticleReal* const AMREX_RESTRICT Ex, + const amrex::ParticleReal* const AMREX_RESTRICT Ey, + const amrex::ParticleReal* const AMREX_RESTRICT Ez, + const amrex::ParticleReal* const AMREX_RESTRICT Bx, + const amrex::ParticleReal* const AMREX_RESTRICT By, + const amrex::ParticleReal* const AMREX_RESTRICT Bz, + amrex::Real q, amrex::Real m, int* AMREX_RESTRICT ion_lev, + amrex::Real dt, long num_particles + ); + + /** + * This function actually pushes momenta when QED effects + * are disabled. + * @param[in,out] x,y,z positions + * @param[in,out] ux,uy,uz momenta + * @param[in] Expp,Eypp,Ezpp electric fields + * @param[in] Bxpp,Bypp,Bzpp magnetic fields + * @param[in] q charge + * @param[in] m mass + * @param[in,out] ion_lev ionization level + * @param[in] dt temporal step + * @param[in] num_particles number of particles + */ + void PushP_classical( + amrex::ParticleReal* const AMREX_RESTRICT ux, + amrex::ParticleReal* const AMREX_RESTRICT uy, + amrex::ParticleReal* const AMREX_RESTRICT uz, + const amrex::ParticleReal* const AMREX_RESTRICT Expp, + const amrex::ParticleReal* const AMREX_RESTRICT Eypp, + const amrex::ParticleReal* const AMREX_RESTRICT Ezpp, + const amrex::ParticleReal* const AMREX_RESTRICT Bxpp, + const amrex::ParticleReal* const AMREX_RESTRICT Bypp, + const amrex::ParticleReal* const AMREX_RESTRICT Bzpp, + amrex::Real q, amrex::Real m, int* AMREX_RESTRICT ion_lev, + amrex::Real dt, long num_particles + ); + //________________________ + + //QED versions +#ifdef WARPX_QED + + /** + * This function actually pushes momenta and positions when QED effects + * are enabled. + * @param[in,out] x,y,z positions + * @param[in,out] ux,uy,uz momenta + * @param[in] Ex,Ey,Ez electric fields + * @param[in] Bx,By,Bz magnetic fields + * @param[in] q charge + * @param[in] m mass + * @param[in,out] tau optical depth + * @param[in] dt temporal step + * @param[in] num_particles number of particles + */ + void PushPX_QedQuantumSynchrotron( + amrex::ParticleReal* const AMREX_RESTRICT x, + amrex::ParticleReal* const AMREX_RESTRICT y, + amrex::ParticleReal* const AMREX_RESTRICT z, + amrex::ParticleReal* const AMREX_RESTRICT ux, + amrex::ParticleReal* const AMREX_RESTRICT uy, + amrex::ParticleReal* const AMREX_RESTRICT uz, + const amrex::ParticleReal* const AMREX_RESTRICT Ex, + const amrex::ParticleReal* const AMREX_RESTRICT Ey, + const amrex::ParticleReal* const AMREX_RESTRICT Ez, + const amrex::ParticleReal* const AMREX_RESTRICT Bx, + const amrex::ParticleReal* const AMREX_RESTRICT By, + const amrex::ParticleReal* const AMREX_RESTRICT Bz, + amrex::Real q, amrex::Real m, + amrex::ParticleReal* const AMREX_RESTRICT tau, + amrex::Real dt, long num_particles + ); + + /** + * This function actually pushes momenta when QED effects + * are enabled. + * @param[in,out] x,y,z positions + * @param[in,out] ux,uy,uz momenta + * @param[in] Expp,Eypp,Ezpp electric fields + * @param[in] Bxpp,Bypp,Bzpp magnetic fields + * @param[in] q charge + * @param[in] m mass + * @param[in,out] tau optical depth + * @param[in] dt temporal step + * @param[in] num_particles number of particles + */ + void PushP_QedQuantumSynchrotron( + amrex::ParticleReal* const AMREX_RESTRICT ux, + amrex::ParticleReal* const AMREX_RESTRICT uy, + amrex::ParticleReal* const AMREX_RESTRICT uz, + const amrex::ParticleReal* const AMREX_RESTRICT Expp, + const amrex::ParticleReal* const AMREX_RESTRICT Eypp, + const amrex::ParticleReal* const AMREX_RESTRICT Ezpp, + const amrex::ParticleReal* const AMREX_RESTRICT Bxpp, + const amrex::ParticleReal* const AMREX_RESTRICT Bypp, + const amrex::ParticleReal* const AMREX_RESTRICT Bzpp, + amrex::Real q, amrex::Real m, + amrex::ParticleReal* const AMREX_RESTRICT tau, + amrex::Real dt, long num_particles + ); + //________________________ #endif }; |