From 314acff8ddd7ca7af3af9a65c43908acc266533f Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Tue, 17 Mar 2020 15:25:42 +0100 Subject: Add QED particle creaction routines (#698) * Initial work to add back QED particle generation * Work in progress: port old QED routines * Add two distinct CopyFuncs * modified getMFItInfo and CopyFunc (not working) * bugfixing & work to add back QED particle creation routines * bugfixing * added back quantum photon emission * bugfixing * bugfixing * added back pair generation (still some bugs in photon emission) * removed unwanted check * bugfixing * bugfixing * bugfixing * Moved QED folder * added comments + some refactoring * added comments * remove some virtual functions to make lgtm happy * updated tests * added PhysicalParticleType * bugfixing * added copyright * improved comments * improved comments * Update Source/Particles/ElementaryProcess/QEDPairGeneration.H Co-Authored-By: Axel Huebl * Update Source/Particles/ElementaryProcess/QEDPairGeneration.H Co-Authored-By: Axel Huebl * Update Source/Particles/ElementaryProcess/QEDPairGeneration.H Co-Authored-By: Axel Huebl * Update Source/Particles/ElementaryProcess/QEDPairGeneration.H Co-Authored-By: Axel Huebl * Update Source/Particles/ElementaryProcess/QEDPairGeneration.H Co-Authored-By: Axel Huebl * Update Source/Particles/ElementaryProcess/QEDPairGeneration.H Co-Authored-By: Axel Huebl * Update Source/Particles/ElementaryProcess/QEDPairGeneration.H Co-Authored-By: Axel Huebl * Update Source/Particles/ElementaryProcess/QEDPairGeneration.H Co-Authored-By: Axel Huebl * Update Source/Particles/ElementaryProcess/QEDPairGeneration.H Co-Authored-By: Axel Huebl * moved inclusion of QEDInternals folder * moved some inclusion directives between Make files * moved some inclusion directives between Make files (forgot to add a file) * Update Source/Particles/PhysicalParticleContainer.H Co-Authored-By: Axel Huebl * Update Source/Particles/PhysicalParticleContainer.H Co-Authored-By: Axel Huebl * Update Source/Particles/PhysicalParticleContainer.H Co-Authored-By: Axel Huebl * Update Source/Particles/PhysicalParticleContainer.H Co-Authored-By: Axel Huebl * Update Source/Particles/PhysicalParticleContainer.H Co-Authored-By: Axel Huebl * Update Source/Particles/MultiParticleContainer.cpp Co-Authored-By: Axel Huebl * Update Source/Particles/ElementaryProcess/QEDPhotonEmission.H Co-Authored-By: Axel Huebl * Update Source/Particles/ElementaryProcess/QEDPhotonEmission.H Co-Authored-By: Axel Huebl * Update Source/Particles/ElementaryProcess/QEDPhotonEmission.H Co-Authored-By: Axel Huebl * Update Source/Particles/ElementaryProcess/QEDPhotonEmission.H Co-Authored-By: Axel Huebl * Update Source/Particles/ElementaryProcess/QEDPhotonEmission.H Co-Authored-By: Axel Huebl * Update Source/Particles/MultiParticleContainer.cpp Co-Authored-By: MaxThevenet * Update Source/Particles/MultiParticleContainer.cpp Co-Authored-By: MaxThevenet * Update Source/Particles/ElementaryProcess/QEDPhotonEmission.H Co-Authored-By: Axel Huebl * Update Source/Particles/ElementaryProcess/QEDPhotonEmission.H Co-Authored-By: Axel Huebl * Update Source/Particles/MultiParticleContainer.cpp Co-Authored-By: MaxThevenet * Update Source/Particles/MultiParticleContainer.cpp Co-Authored-By: MaxThevenet * Update Source/Particles/MultiParticleContainer.cpp Co-Authored-By: MaxThevenet * Update Source/Particles/MultiParticleContainer.H Co-Authored-By: Axel Huebl * corrected alignment * Update Source/Particles/ElementaryProcess/QEDPairGeneration.H Co-Authored-By: Axel Huebl * removed some unnecessary amrex:: * add missing comment * Replaced BL_PROFILE with WARPX_PROFILE * bugfixing and making some variables const * removed some moves * removed some moves * started to change tau into optical_depth_BW or optical_depth_QSR * Using initialization policy to initialize optical depth * bugfixing * forgot to add a file * fixed bug * Revert "fixed bug" This reverts commit a3fb98d10cc30327635aeaa71451a05ca2229ff4. * Update Source/Particles/ElementaryProcess/QEDPairGeneration.H Co-Authored-By: MaxThevenet * Update Source/Particles/MultiParticleContainer.cpp Co-Authored-By: MaxThevenet * Added doQEDEvents to OneStep_sub1 * add a bunch of const * add _rt suffix * Update Source/Particles/MultiParticleContainer.cpp Co-Authored-By: MaxThevenet * added path to included files * Introduced a templated AmIA function using physical_species * Update Source/Particles/ElementaryProcess/QEDPhotonEmission.H Co-Authored-By: MaxThevenet * Update Source/Particles/ElementaryProcess/QEDPhotonEmission.H Co-Authored-By: MaxThevenet * Update Source/Particles/ElementaryProcess/QEDPhotonEmission.H Co-Authored-By: MaxThevenet * added paths to included headers * updated documentation * updated examples * bugfixing * bugfixing * fixing examples * fixed example * fixed example * correct a misprint in error message * fixed issue related to 1./mass for photons * Update Source/Particles/MultiParticleContainer.cpp Co-Authored-By: MaxThevenet * Update Source/Particles/MultiParticleContainer.cpp Co-Authored-By: MaxThevenet * Update Source/Particles/MultiParticleContainer.cpp Co-Authored-By: MaxThevenet * Update Source/Particles/ElementaryProcess/QEDPhotonEmission.H Co-Authored-By: MaxThevenet * make the use of energy_threshold more transparent * remove unnecessary checks * bigfixing * added comment * separate checks for QED processes * added a CheckIonizationProductSpecies for consistency * bugfixing * now using a new variable for photon energy creation threshold * removed unwanted comment * added option to set a user-defined threshold for photon creation * bugfixing * updated documentation * updated example to include new option * updated doc * fixed merge conflict * correct bug in example * reorganized function Co-authored-by: Axel Huebl Co-authored-by: MaxThevenet --- .../QEDInternals/QuantumSyncEngineTableBuilder.cpp | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Source/Particles/ElementaryProcess/QEDInternals/QuantumSyncEngineTableBuilder.cpp (limited to 'Source/Particles/ElementaryProcess/QEDInternals/QuantumSyncEngineTableBuilder.cpp') diff --git a/Source/Particles/ElementaryProcess/QEDInternals/QuantumSyncEngineTableBuilder.cpp b/Source/Particles/ElementaryProcess/QEDInternals/QuantumSyncEngineTableBuilder.cpp new file mode 100644 index 000000000..c4e500122 --- /dev/null +++ b/Source/Particles/ElementaryProcess/QEDInternals/QuantumSyncEngineTableBuilder.cpp @@ -0,0 +1,64 @@ +/* Copyright 2019 Luca Fedeli + * + * This file is part of WarpX. + * + * License: BSD-3-Clause-LBNL + */ +#include "QuantumSyncEngineTableBuilder.H" + +//Include the full Quantum Synchrotron engine with table generation support +//(after some consistency tests). This requires to have a recent version +// of the Boost library. +#ifdef PXRMP_CORE_ONLY + #error The Table Builder is incompatible with PXRMP_CORE_ONLY +#endif + +#ifdef __PICSAR_MULTIPHYSICS_BREIT_WHEELER_ENGINE__ + #warning quantum_sync_engine.hpp should not have been included before reaching this point. +#endif +#include +//_______________________________________________ + +//Some handy aliases +using PicsarQuantumSynchrotronEngine = picsar::multi_physics:: + quantum_synchrotron_engine; + +using PicsarQuantumSynchrotronCtrl = + picsar::multi_physics::quantum_synchrotron_engine_ctrl; +//_______________________________________________ + +void +QuantumSynchrotronEngineTableBuilder::compute_table + (PicsarQuantumSynchrotronCtrl ctrl, + QuantumSynchrotronEngineInnards& innards) const +{ + PicsarQuantumSynchrotronEngine qs_engine( + std::move(QedUtils::DummyStruct()), 1.0, ctrl); + + qs_engine.compute_dN_dt_lookup_table(); + qs_engine.compute_cumulative_phot_em_table(); + + auto qs_innards_picsar = qs_engine.export_innards(); + + //Copy data in a GPU-friendly data-structure + innards.ctrl = qs_innards_picsar.qs_ctrl; + innards.KKfunc_coords.assign(qs_innards_picsar.KKfunc_table_coords_ptr, + qs_innards_picsar.KKfunc_table_coords_ptr + + qs_innards_picsar.KKfunc_table_coords_how_many); + innards.KKfunc_data.assign(qs_innards_picsar.KKfunc_table_data_ptr, + qs_innards_picsar.KKfunc_table_data_ptr + + qs_innards_picsar.KKfunc_table_data_how_many); + innards.cum_distrib_coords_1.assign( + qs_innards_picsar.cum_distrib_table_coords_1_ptr, + qs_innards_picsar.cum_distrib_table_coords_1_ptr + + qs_innards_picsar.cum_distrib_table_coords_1_how_many); + innards.cum_distrib_coords_2.assign( + qs_innards_picsar.cum_distrib_table_coords_2_ptr, + qs_innards_picsar.cum_distrib_table_coords_2_ptr + + qs_innards_picsar.cum_distrib_table_coords_2_how_many); + innards.cum_distrib_data.assign( + qs_innards_picsar.cum_distrib_table_data_ptr, + qs_innards_picsar.cum_distrib_table_data_ptr + + qs_innards_picsar.cum_distrib_table_data_how_many); + //____ +} -- cgit v1.2.3