aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/ElementaryProcess/QEDInternals/SchwingerProcessWrapper.H
diff options
context:
space:
mode:
authorGravatar Luca Fedeli <luca.fedeli@cea.fr> 2020-09-21 12:42:02 +0200
committerGravatar GitHub <noreply@github.com> 2020-09-21 12:42:02 +0200
commitf9f3aa6e96e9c7827bef1f449fa2ce3d86505a23 (patch)
treec26ef7e8aa0517e1df521d245fbe6bf2a6809adf /Source/Particles/ElementaryProcess/QEDInternals/SchwingerProcessWrapper.H
parent789f0da95e409b035cfffcacbb75dc847243e30a (diff)
downloadWarpX-f9f3aa6e96e9c7827bef1f449fa2ce3d86505a23.tar.gz
WarpX-f9f3aa6e96e9c7827bef1f449fa2ce3d86505a23.tar.zst
WarpX-f9f3aa6e96e9c7827bef1f449fa2ce3d86505a23.zip
Coupling WarpX with an ✨improved✨ version of the QED library (#1198)
* Initial work to couple improved QED module to WarpX * WIP to couple with WarpX the new QED library * Continuing work to couple the new version of the QED library with WarpX * progress towards completing coupling with new version of QED library * WarpX coupled with new version of QED library * default behavior is to display table generation progress * some host device functions are now device only * fixed bug * bugfixing * updating tests * updated test * updated test * added initial version of tests (not working) * added check and updated a comment * fixed bug * added inputfiles and analysis script for new BW tests * test for BW process are ready * modified test * make lgtm happy * removed TABs * initial work to add QS tests (not working) * removed old tests * fixed bug in script * changed position of evolution of optical depth * progress with QSR tests * improved test * very low energy photons are always eliminated * added tests to regression suite * improved test * improved tests * removed redundant parameter * removed trailing white space * updated documentation * fix lgtm warnings * fixed missing check on chi parameter * fixed missing check on chi parameter & bugfixing * improved comments * increased tolerance in tests * updated units in test * now test succeds if the error is extremely small * updated checksums * fixed bug * fixed some unused or uninitialized variables warnings * now using ignore_unused instead of commenting out some variables * fixed warnings * partial fix of a test * fixed test * fixed test * added checksums * fixed tests * fixed benchmark for qed_schwinger2 * removed checksums for tests which do no exist anymore * fixed checksums for several qed tests * fixed checksums for several qed tests * fixed checksums * removed unwanted checksum * fixed checksum * removed files which should have been deleted * add some const * [skip ci] added some docstrings and some const * Update Source/Particles/ElementaryProcess/QEDInternals/BreitWheelerEngineWrapper.H Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/ElementaryProcess/QEDInternals/BreitWheelerEngineWrapper.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/ElementaryProcess/QEDInternals/QuantumSyncEngineWrapper.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * added some docstrings and some const * replaced ManagedVectors with DeviceVectors * Update Source/Particles/ElementaryProcess/QEDInternals/QedWrapperCommons.H Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * added some const * removed unwanted assert * updated comment * changed position of GPU synchronization directive * Update Docs/source/running_cpp/parameters.rst Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Examples/Modules/qed/quantum_synchrotron/analysis.py Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Examples/Modules/qed/quantum_synchrotron/analysis.py Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Examples/Modules/qed/breit_wheeler/analysis.py Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Examples/Modules/qed/breit_wheeler/analysis.py Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * add do_plot option to some analysis scripts * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * uncomment a line * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * simplified input scripts for BW tests * simplified input scripts for QS tests * removed unwanted files * simplified analysis script * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * reverted modification to schwinger analysis script * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * remove outdated comment * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Particles/MultiParticleContainer.cpp Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * fix warnings * made test more robust * reset benchmark for qed_breit_wheeler_2d * fixed bug in test * make test more robust * made test more robust * Update Examples/Modules/qed/quantum_synchrotron/analysis.py Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update Examples/Modules/qed/quantum_synchrotron/analysis.py Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> * Update run_test.sh Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: Tools <warpx@lbl.gov> Co-authored-by: NeilZaim <49716072+NeilZaim@users.noreply.github.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to 'Source/Particles/ElementaryProcess/QEDInternals/SchwingerProcessWrapper.H')
-rw-r--r--Source/Particles/ElementaryProcess/QEDInternals/SchwingerProcessWrapper.H37
1 files changed, 16 insertions, 21 deletions
diff --git a/Source/Particles/ElementaryProcess/QEDInternals/SchwingerProcessWrapper.H b/Source/Particles/ElementaryProcess/QEDInternals/SchwingerProcessWrapper.H
index 46960fa00..910ea5e1d 100644
--- a/Source/Particles/ElementaryProcess/QEDInternals/SchwingerProcessWrapper.H
+++ b/Source/Particles/ElementaryProcess/QEDInternals/SchwingerProcessWrapper.H
@@ -10,10 +10,7 @@
#include "QedWrapperCommons.H"
-//#define PXRMP_CORE_ONLY allows importing only the 'core functions' of the
-//Schwinger process engine of the QED PICSAR library.
-#define PXRMP_CORE_ONLY
-#include <schwinger_pair_engine.hpp>
+#include <physics/schwinger/schwinger_pair_engine_core.hpp>
#include <AMReX_Random.H>
#include <cmath>
@@ -22,7 +19,8 @@
* the number of Schwinger pairs created at a given timestep and in a given
* cell as a function of the EM field in that cell.
*
- * @param[in] dVdt Volume of the cell multiplied by temporal step.
+ * @param[in] dV Volume of the cell.
+ * @param[in] dt temporal step.
* @param[in] Ex x-component of the electric field on the cell.
* @param[in] Ey y-component of the electric field on the cell.
* @param[in] Ez z-component of the electric field on the cell.
@@ -33,33 +31,30 @@
* pairs is below this parameter, a Poisson distribution is used
* to draw the number of created pairs. Otherwise a Gaussian
* distribution is used.
+ * @return the number of pairs generated via the Schwinger process
*/
-AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real
-getSchwingerProductionNumber (const amrex::Real dVdt,
+AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
+amrex::Real
+getSchwingerProductionNumber (const amrex::Real dV, const amrex::Real dt,
const amrex::Real Ex, const amrex::Real Ey, const amrex::Real Ez,
const amrex::Real Bx, const amrex::Real By, const amrex::Real Bz,
const amrex::Real PoissonToGaussianThreshold)
{
using namespace amrex;
- using namespace picsar::multi_physics;
+ namespace pxr_p = picsar::multi_physics::phys;
+ namespace pxr_sh = picsar::multi_physics::phys::schwinger;
- //If SI units are used, PICSAR QED does not use a reference length.
- // However, a "lambda" parameter must still be passed to some functions.
- const auto dummy_lambda = 1._rt;
-
- const auto expectedPairNumber = dVdt *
- schwinger_pair_engine<Real,QedUtils::DummyStruct>::
- internal_compute_schwinger_pair_production_rate(
- Ex, Ey, Ez, Bx, By, Bz, dummy_lambda);
+ const auto expectedPairNumber =
+ pxr_sh::expected_pair_number<amrex::Real, pxr_p::unit_system::SI>(
+ Ex, Ey, Ez, Bx, By, Bz, dV, dt);
if (expectedPairNumber <= PoissonToGaussianThreshold) {
- return RandomPoisson(expectedPairNumber);
- }
- else {
- const auto numpairs = RandomNormal(expectedPairNumber,sqrt(expectedPairNumber));
+ return amrex::RandomPoisson(expectedPairNumber);
+ } else {
+ const auto numpairs =
+ amrex::RandomNormal(expectedPairNumber,sqrt(expectedPairNumber));
return numpairs > 0._rt ? numpairs : 0._rt;
}
-
}
#endif // WARPX_schwinger_process_wrapper_h_