From 7f178a55df4d0973f6788d9c27fd10b128ad4571 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Tue, 8 Oct 2019 18:25:10 +0200 Subject: Heavy refactoring --- Source/QED/QuantumSyncEngineWrapper.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Source/QED/QuantumSyncEngineWrapper.cpp (limited to 'Source/QED/QuantumSyncEngineWrapper.cpp') diff --git a/Source/QED/QuantumSyncEngineWrapper.cpp b/Source/QED/QuantumSyncEngineWrapper.cpp new file mode 100644 index 000000000..ce130bb62 --- /dev/null +++ b/Source/QED/QuantumSyncEngineWrapper.cpp @@ -0,0 +1,29 @@ +#include "QuantumSyncEngineWrapper.h" +//This file provides a wrapper aroud the quantum_sync engine +//provided by the PICSAR library + +using namespace picsar::multi_physics; + +// Functors ================================== + +// Initialization of the optical depth + +AMREX_GPU_DEVICE +amrex::Real +QuantumSynchrotronGetOpticalDepth::operator() () const +{ + return WarpXQuantumSynchrotronWrapper:: + internal_get_optical_depth(amrex::Random()); +} +//____________________________________________ + +// Factory class ============================= + +QuantumSynchrotronEngine::QuantumSynchrotronEngine(){} + +QuantumSynchrotronGetOpticalDepth QuantumSynchrotronEngine::build_optical_depth_functor() +{ + return QuantumSynchrotronGetOpticalDepth(); +} + +//============================================ -- cgit v1.2.3 From 1dedc51ecb1c08bb97bdd9adce07bcd79d0b228b Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Thu, 10 Oct 2019 12:18:41 +0200 Subject: Style changes --- Source/QED/BreitWheelerEngineWrapper.cpp | 4 ++-- Source/QED/BreitWheelerEngineWrapper.h | 6 +++--- Source/QED/QuantumSyncEngineWrapper.cpp | 5 +++-- Source/QED/QuantumSyncEngineWrapper.h | 6 +++--- 4 files changed, 11 insertions(+), 10 deletions(-) (limited to 'Source/QED/QuantumSyncEngineWrapper.cpp') diff --git a/Source/QED/BreitWheelerEngineWrapper.cpp b/Source/QED/BreitWheelerEngineWrapper.cpp index b654cc9b0..fa32d04e3 100644 --- a/Source/QED/BreitWheelerEngineWrapper.cpp +++ b/Source/QED/BreitWheelerEngineWrapper.cpp @@ -18,9 +18,9 @@ BreitWheelerGetOpticalDepth::operator() () const // Factory class ============================= -BreitWheelerEngine::BreitWheelerEngine(){} +BreitWheelerEngine::BreitWheelerEngine (){} -BreitWheelerGetOpticalDepth BreitWheelerEngine::build_optical_depth_functor() +BreitWheelerGetOpticalDepth BreitWheelerEngine::build_optical_depth_functor () { return BreitWheelerGetOpticalDepth(); } diff --git a/Source/QED/BreitWheelerEngineWrapper.h b/Source/QED/BreitWheelerEngineWrapper.h index ebd589d3d..e9c8f2f72 100644 --- a/Source/QED/BreitWheelerEngineWrapper.h +++ b/Source/QED/BreitWheelerEngineWrapper.h @@ -19,7 +19,7 @@ using WarpXBreitWheelerWrapper = class BreitWheelerGetOpticalDepth { public: - BreitWheelerGetOpticalDepth() + BreitWheelerGetOpticalDepth () {}; AMREX_GPU_DEVICE @@ -33,10 +33,10 @@ public: class BreitWheelerEngine { public: - BreitWheelerEngine(); + BreitWheelerEngine (); /* \brief Builds the functor to initialize the optical depth */ - BreitWheelerGetOpticalDepth build_optical_depth_functor(); + BreitWheelerGetOpticalDepth build_optical_depth_functor (); }; //============================================ diff --git a/Source/QED/QuantumSyncEngineWrapper.cpp b/Source/QED/QuantumSyncEngineWrapper.cpp index ce130bb62..0eb000174 100644 --- a/Source/QED/QuantumSyncEngineWrapper.cpp +++ b/Source/QED/QuantumSyncEngineWrapper.cpp @@ -19,9 +19,10 @@ QuantumSynchrotronGetOpticalDepth::operator() () const // Factory class ============================= -QuantumSynchrotronEngine::QuantumSynchrotronEngine(){} +QuantumSynchrotronEngine::QuantumSynchrotronEngine (){} -QuantumSynchrotronGetOpticalDepth QuantumSynchrotronEngine::build_optical_depth_functor() +QuantumSynchrotronGetOpticalDepth +QuantumSynchrotronEngine::build_optical_depth_functor () { return QuantumSynchrotronGetOpticalDepth(); } diff --git a/Source/QED/QuantumSyncEngineWrapper.h b/Source/QED/QuantumSyncEngineWrapper.h index ca12f06a1..59c146915 100644 --- a/Source/QED/QuantumSyncEngineWrapper.h +++ b/Source/QED/QuantumSyncEngineWrapper.h @@ -19,7 +19,7 @@ using WarpXQuantumSynchrotronWrapper = class QuantumSynchrotronGetOpticalDepth { public: - QuantumSynchrotronGetOpticalDepth() + QuantumSynchrotronGetOpticalDepth () {}; AMREX_GPU_DEVICE @@ -33,10 +33,10 @@ public: class QuantumSynchrotronEngine { public: - QuantumSynchrotronEngine(); + QuantumSynchrotronEngine (); /* \brief Builds the functor to initialize the optical depth */ - QuantumSynchrotronGetOpticalDepth build_optical_depth_functor(); + QuantumSynchrotronGetOpticalDepth build_optical_depth_functor (); }; //============================================ -- cgit v1.2.3 From 96ea487480fc7ce60eb20895ca4cc20cbba5888d Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Thu, 10 Oct 2019 12:33:51 +0200 Subject: Style changes --- Source/QED/BreitWheelerEngineWrapper.cpp | 2 +- Source/QED/QuantumSyncEngineWrapper.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/QED/QuantumSyncEngineWrapper.cpp') diff --git a/Source/QED/BreitWheelerEngineWrapper.cpp b/Source/QED/BreitWheelerEngineWrapper.cpp index fa32d04e3..5c7187ea9 100644 --- a/Source/QED/BreitWheelerEngineWrapper.cpp +++ b/Source/QED/BreitWheelerEngineWrapper.cpp @@ -25,4 +25,4 @@ BreitWheelerGetOpticalDepth BreitWheelerEngine::build_optical_depth_functor () return BreitWheelerGetOpticalDepth(); } -//============================================ +//============================================ \ No newline at end of file diff --git a/Source/QED/QuantumSyncEngineWrapper.cpp b/Source/QED/QuantumSyncEngineWrapper.cpp index 0eb000174..6e57f8709 100644 --- a/Source/QED/QuantumSyncEngineWrapper.cpp +++ b/Source/QED/QuantumSyncEngineWrapper.cpp @@ -21,10 +21,10 @@ QuantumSynchrotronGetOpticalDepth::operator() () const QuantumSynchrotronEngine::QuantumSynchrotronEngine (){} -QuantumSynchrotronGetOpticalDepth +QuantumSynchrotronGetOpticalDepth QuantumSynchrotronEngine::build_optical_depth_functor () { return QuantumSynchrotronGetOpticalDepth(); } -//============================================ +//============================================ \ No newline at end of file -- cgit v1.2.3 From dc3d295acb0a1d4a2231664728bf1654886dca34 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Fri, 11 Oct 2019 10:05:29 +0200 Subject: Made QED engine wrapper headers .hpp files --- Source/Particles/MultiParticleContainer.H | 4 +-- Source/Particles/PhysicalParticleContainer.H | 4 +-- Source/Particles/WarpXParticleContainer.H | 4 +-- Source/QED/BreitWheelerEngineWrapper.cpp | 2 +- Source/QED/BreitWheelerEngineWrapper.h | 44 ---------------------------- Source/QED/BreitWheelerEngineWrapper.hpp | 44 ++++++++++++++++++++++++++++ Source/QED/Make.package | 4 +-- Source/QED/QuantumSyncEngineWrapper.cpp | 2 +- Source/QED/QuantumSyncEngineWrapper.h | 44 ---------------------------- Source/QED/QuantumSyncEngineWrapper.hpp | 44 ++++++++++++++++++++++++++++ 10 files changed, 98 insertions(+), 98 deletions(-) delete mode 100644 Source/QED/BreitWheelerEngineWrapper.h create mode 100644 Source/QED/BreitWheelerEngineWrapper.hpp delete mode 100644 Source/QED/QuantumSyncEngineWrapper.h create mode 100644 Source/QED/QuantumSyncEngineWrapper.hpp (limited to 'Source/QED/QuantumSyncEngineWrapper.cpp') diff --git a/Source/Particles/MultiParticleContainer.H b/Source/Particles/MultiParticleContainer.H index 6bf53d6ec..4f4c9898b 100644 --- a/Source/Particles/MultiParticleContainer.H +++ b/Source/Particles/MultiParticleContainer.H @@ -23,8 +23,8 @@ // #ifdef WARPX_QED - #include "BreitWheelerEngineWrapper.h" - #include "QuantumSyncEngineWrapper.h" + #include + #include #endif class MultiParticleContainer diff --git a/Source/Particles/PhysicalParticleContainer.H b/Source/Particles/PhysicalParticleContainer.H index 4fa621514..ff98d1de9 100644 --- a/Source/Particles/PhysicalParticleContainer.H +++ b/Source/Particles/PhysicalParticleContainer.H @@ -10,8 +10,8 @@ #include #ifdef WARPX_QED -#include -#include + #include + #include #endif class PhysicalParticleContainer diff --git a/Source/Particles/WarpXParticleContainer.H b/Source/Particles/WarpXParticleContainer.H index 9fe2cce2f..883f88f5b 100644 --- a/Source/Particles/WarpXParticleContainer.H +++ b/Source/Particles/WarpXParticleContainer.H @@ -7,8 +7,8 @@ #include #ifdef WARPX_QED -#include -#include + #include + #include #endif #include diff --git a/Source/QED/BreitWheelerEngineWrapper.cpp b/Source/QED/BreitWheelerEngineWrapper.cpp index 5c7187ea9..056ecaeb5 100644 --- a/Source/QED/BreitWheelerEngineWrapper.cpp +++ b/Source/QED/BreitWheelerEngineWrapper.cpp @@ -1,4 +1,4 @@ -#include "BreitWheelerEngineWrapper.h" +#include "BreitWheelerEngineWrapper.hpp" //This file provides a wrapper aroud the breit_wheeler engine //provided by the PICSAR library diff --git a/Source/QED/BreitWheelerEngineWrapper.h b/Source/QED/BreitWheelerEngineWrapper.h deleted file mode 100644 index 3c205fec1..000000000 --- a/Source/QED/BreitWheelerEngineWrapper.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef WARPX_breit_wheeler_engine_wrapper_h_ -#define WARPX_breit_wheeler_engine_wrapper_h_ - -#include "QedWrapperCommons.h" - -//BW ENGINE from PICSAR -#include "breit_wheeler_engine.hpp" - -using WarpXBreitWheelerWrapper = - picsar::multi_physics::breit_wheeler_engine; - -// Functors ================================== - -// These functors provide the core elementary functions of the library -// Can be included in GPU kernels - -/* \brief Functor to initialize the optical depth of photons for the -* Breit-Wheeler process */ -class BreitWheelerGetOpticalDepth -{ -public: - BreitWheelerGetOpticalDepth () - {}; - - AMREX_GPU_DEVICE - amrex::Real operator() () const; -}; -//____________________________________________ - -// Factory class ============================= - -/* \brief Wrapper for the Breit Wheeler engine of the PICSAR library */ -class BreitWheelerEngine -{ -public: - BreitWheelerEngine (); - - /* \brief Builds the functor to initialize the optical depth */ - BreitWheelerGetOpticalDepth build_optical_depth_functor (); -}; - -//============================================ - -#endif //WARPX_breit_wheeler_engine_wrapper_H_ diff --git a/Source/QED/BreitWheelerEngineWrapper.hpp b/Source/QED/BreitWheelerEngineWrapper.hpp new file mode 100644 index 000000000..3c205fec1 --- /dev/null +++ b/Source/QED/BreitWheelerEngineWrapper.hpp @@ -0,0 +1,44 @@ +#ifndef WARPX_breit_wheeler_engine_wrapper_h_ +#define WARPX_breit_wheeler_engine_wrapper_h_ + +#include "QedWrapperCommons.h" + +//BW ENGINE from PICSAR +#include "breit_wheeler_engine.hpp" + +using WarpXBreitWheelerWrapper = + picsar::multi_physics::breit_wheeler_engine; + +// Functors ================================== + +// These functors provide the core elementary functions of the library +// Can be included in GPU kernels + +/* \brief Functor to initialize the optical depth of photons for the +* Breit-Wheeler process */ +class BreitWheelerGetOpticalDepth +{ +public: + BreitWheelerGetOpticalDepth () + {}; + + AMREX_GPU_DEVICE + amrex::Real operator() () const; +}; +//____________________________________________ + +// Factory class ============================= + +/* \brief Wrapper for the Breit Wheeler engine of the PICSAR library */ +class BreitWheelerEngine +{ +public: + BreitWheelerEngine (); + + /* \brief Builds the functor to initialize the optical depth */ + BreitWheelerGetOpticalDepth build_optical_depth_functor (); +}; + +//============================================ + +#endif //WARPX_breit_wheeler_engine_wrapper_H_ diff --git a/Source/QED/Make.package b/Source/QED/Make.package index 7af5860ee..0756ccfa4 100644 --- a/Source/QED/Make.package +++ b/Source/QED/Make.package @@ -1,6 +1,6 @@ CEXE_headers += QedWrapperCommons.h -CEXE_headers += BreitWheelerEngineWrapper.h -CEXE_headers += QuantumSyncsEngineWrapper.h +CEXE_headers += BreitWheelerEngineWrapper.hpp +CEXE_headers += QuantumSyncsEngineWrapper.hpp CEXE_sources += BreitWheelerEngineWrapper.cpp CEXE_sources += QuantumSyncEngineWrapper.cpp diff --git a/Source/QED/QuantumSyncEngineWrapper.cpp b/Source/QED/QuantumSyncEngineWrapper.cpp index 6e57f8709..17ba7205b 100644 --- a/Source/QED/QuantumSyncEngineWrapper.cpp +++ b/Source/QED/QuantumSyncEngineWrapper.cpp @@ -1,4 +1,4 @@ -#include "QuantumSyncEngineWrapper.h" +#include "QuantumSyncEngineWrapper.hpp" //This file provides a wrapper aroud the quantum_sync engine //provided by the PICSAR library diff --git a/Source/QED/QuantumSyncEngineWrapper.h b/Source/QED/QuantumSyncEngineWrapper.h deleted file mode 100644 index d5cd2b979..000000000 --- a/Source/QED/QuantumSyncEngineWrapper.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef WARPX_quantum_sync_engine_wrapper_h_ -#define WARPX_quantum_sync_engine_wrapper_h_ - -#include "QedWrapperCommons.h" - -//QS ENGINE from PICSAR -#include "quantum_sync_engine.hpp" - -using WarpXQuantumSynchrotronWrapper = - picsar::multi_physics::quantum_synchrotron_engine; - -// Functors ================================== - -// These functors provide the core elementary functions of the library -// Can be included in GPU kernels - -/* \brief Functor to initialize the optical depth of leptons for the -* Quantum Synchrotron process */ -class QuantumSynchrotronGetOpticalDepth -{ -public: - QuantumSynchrotronGetOpticalDepth () - {}; - - AMREX_GPU_DEVICE - amrex::Real operator() () const; -}; -//____________________________________________ - -// Factory class ============================= - -/* \brief Wrapper for the Quantum Synchrotron engine of the PICSAR library */ -class QuantumSynchrotronEngine -{ -public: - QuantumSynchrotronEngine (); - - /* \brief Builds the functor to initialize the optical depth */ - QuantumSynchrotronGetOpticalDepth build_optical_depth_functor (); -}; - -//============================================ - -#endif //WARPX_quantum_sync_engine_wrapper_h_ diff --git a/Source/QED/QuantumSyncEngineWrapper.hpp b/Source/QED/QuantumSyncEngineWrapper.hpp new file mode 100644 index 000000000..d5cd2b979 --- /dev/null +++ b/Source/QED/QuantumSyncEngineWrapper.hpp @@ -0,0 +1,44 @@ +#ifndef WARPX_quantum_sync_engine_wrapper_h_ +#define WARPX_quantum_sync_engine_wrapper_h_ + +#include "QedWrapperCommons.h" + +//QS ENGINE from PICSAR +#include "quantum_sync_engine.hpp" + +using WarpXQuantumSynchrotronWrapper = + picsar::multi_physics::quantum_synchrotron_engine; + +// Functors ================================== + +// These functors provide the core elementary functions of the library +// Can be included in GPU kernels + +/* \brief Functor to initialize the optical depth of leptons for the +* Quantum Synchrotron process */ +class QuantumSynchrotronGetOpticalDepth +{ +public: + QuantumSynchrotronGetOpticalDepth () + {}; + + AMREX_GPU_DEVICE + amrex::Real operator() () const; +}; +//____________________________________________ + +// Factory class ============================= + +/* \brief Wrapper for the Quantum Synchrotron engine of the PICSAR library */ +class QuantumSynchrotronEngine +{ +public: + QuantumSynchrotronEngine (); + + /* \brief Builds the functor to initialize the optical depth */ + QuantumSynchrotronGetOpticalDepth build_optical_depth_functor (); +}; + +//============================================ + +#endif //WARPX_quantum_sync_engine_wrapper_h_ -- cgit v1.2.3 From a54806c61f36661ddc816ae99b45dc3a03f2e545 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Fri, 11 Oct 2019 10:43:45 +0200 Subject: Definition of the QED functors now in .hpp file --- Source/QED/BreitWheelerEngineWrapper.cpp | 12 ------------ Source/QED/BreitWheelerEngineWrapper.hpp | 9 +++++++-- Source/QED/QuantumSyncEngineWrapper.cpp | 13 ------------- Source/QED/QuantumSyncEngineWrapper.hpp | 7 ++++++- 4 files changed, 13 insertions(+), 28 deletions(-) (limited to 'Source/QED/QuantumSyncEngineWrapper.cpp') diff --git a/Source/QED/BreitWheelerEngineWrapper.cpp b/Source/QED/BreitWheelerEngineWrapper.cpp index 056ecaeb5..5d2da9c17 100644 --- a/Source/QED/BreitWheelerEngineWrapper.cpp +++ b/Source/QED/BreitWheelerEngineWrapper.cpp @@ -4,18 +4,6 @@ using namespace picsar::multi_physics; -// Functors ================================== - -// Initialization of the optical depth -AMREX_GPU_DEVICE -amrex::Real -BreitWheelerGetOpticalDepth::operator() () const -{ - return WarpXBreitWheelerWrapper:: - internal_get_optical_depth(amrex::Random()); -} -//____________________________________________ - // Factory class ============================= BreitWheelerEngine::BreitWheelerEngine (){} diff --git a/Source/QED/BreitWheelerEngineWrapper.hpp b/Source/QED/BreitWheelerEngineWrapper.hpp index 3c205fec1..2f4142732 100644 --- a/Source/QED/BreitWheelerEngineWrapper.hpp +++ b/Source/QED/BreitWheelerEngineWrapper.hpp @@ -22,8 +22,13 @@ public: BreitWheelerGetOpticalDepth () {}; - AMREX_GPU_DEVICE - amrex::Real operator() () const; + AMREX_GPU_DEVICE + AMREX_FORCE_INLINE + amrex::Real operator() () const + { + return WarpXBreitWheelerWrapper:: + internal_get_optical_depth(amrex::Random()); + } }; //____________________________________________ diff --git a/Source/QED/QuantumSyncEngineWrapper.cpp b/Source/QED/QuantumSyncEngineWrapper.cpp index 17ba7205b..d09b71c45 100644 --- a/Source/QED/QuantumSyncEngineWrapper.cpp +++ b/Source/QED/QuantumSyncEngineWrapper.cpp @@ -4,19 +4,6 @@ using namespace picsar::multi_physics; -// Functors ================================== - -// Initialization of the optical depth - -AMREX_GPU_DEVICE -amrex::Real -QuantumSynchrotronGetOpticalDepth::operator() () const -{ - return WarpXQuantumSynchrotronWrapper:: - internal_get_optical_depth(amrex::Random()); -} -//____________________________________________ - // Factory class ============================= QuantumSynchrotronEngine::QuantumSynchrotronEngine (){} diff --git a/Source/QED/QuantumSyncEngineWrapper.hpp b/Source/QED/QuantumSyncEngineWrapper.hpp index d5cd2b979..95d4e91f5 100644 --- a/Source/QED/QuantumSyncEngineWrapper.hpp +++ b/Source/QED/QuantumSyncEngineWrapper.hpp @@ -23,7 +23,12 @@ public: {}; AMREX_GPU_DEVICE - amrex::Real operator() () const; + AMREX_FORCE_INLINE + amrex::Real operator() () const + { + return WarpXQuantumSynchrotronWrapper:: + internal_get_optical_depth(amrex::Random()); + } }; //____________________________________________ -- cgit v1.2.3 From 491e67e1ecdbee3b6a521cbf37020494160c64c5 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Fri, 11 Oct 2019 17:31:13 +0200 Subject: replace .hpp with .H to comply with WarpX style --- Source/Particles/MultiParticleContainer.H | 10 +++--- Source/Particles/PhysicalParticleContainer.H | 8 ++--- Source/Particles/WarpXParticleContainer.H | 4 +-- Source/QED/BreitWheelerEngineWrapper.H | 49 ++++++++++++++++++++++++++++ Source/QED/BreitWheelerEngineWrapper.cpp | 2 +- Source/QED/BreitWheelerEngineWrapper.hpp | 49 ---------------------------- Source/QED/Make.package | 6 ++-- Source/QED/QedWrapperCommons.H | 16 +++++++++ Source/QED/QedWrapperCommons.h | 16 --------- Source/QED/QuantumSyncEngineWrapper.H | 49 ++++++++++++++++++++++++++++ Source/QED/QuantumSyncEngineWrapper.cpp | 2 +- Source/QED/QuantumSyncEngineWrapper.hpp | 49 ---------------------------- 12 files changed, 130 insertions(+), 130 deletions(-) create mode 100644 Source/QED/BreitWheelerEngineWrapper.H delete mode 100644 Source/QED/BreitWheelerEngineWrapper.hpp create mode 100644 Source/QED/QedWrapperCommons.H delete mode 100644 Source/QED/QedWrapperCommons.h create mode 100644 Source/QED/QuantumSyncEngineWrapper.H delete mode 100644 Source/QED/QuantumSyncEngineWrapper.hpp (limited to 'Source/QED/QuantumSyncEngineWrapper.cpp') diff --git a/Source/Particles/MultiParticleContainer.H b/Source/Particles/MultiParticleContainer.H index 4f4c9898b..58546a106 100644 --- a/Source/Particles/MultiParticleContainer.H +++ b/Source/Particles/MultiParticleContainer.H @@ -9,6 +9,11 @@ #include #include +#ifdef WARPX_QED + #include + #include +#endif + #include #include #include @@ -22,11 +27,6 @@ // concrete class derived from WarpXParticlContainer. // -#ifdef WARPX_QED - #include - #include -#endif - class MultiParticleContainer { diff --git a/Source/Particles/PhysicalParticleContainer.H b/Source/Particles/PhysicalParticleContainer.H index 84f46de5c..c953aa2d7 100644 --- a/Source/Particles/PhysicalParticleContainer.H +++ b/Source/Particles/PhysicalParticleContainer.H @@ -7,13 +7,13 @@ #include -#include - #ifdef WARPX_QED - #include - #include + #include + #include #endif +#include + class PhysicalParticleContainer : public WarpXParticleContainer { diff --git a/Source/Particles/WarpXParticleContainer.H b/Source/Particles/WarpXParticleContainer.H index 883f88f5b..879f4782e 100644 --- a/Source/Particles/WarpXParticleContainer.H +++ b/Source/Particles/WarpXParticleContainer.H @@ -7,8 +7,8 @@ #include #ifdef WARPX_QED - #include - #include + #include + #include #endif #include diff --git a/Source/QED/BreitWheelerEngineWrapper.H b/Source/QED/BreitWheelerEngineWrapper.H new file mode 100644 index 000000000..54467e6cb --- /dev/null +++ b/Source/QED/BreitWheelerEngineWrapper.H @@ -0,0 +1,49 @@ +#ifndef WARPX_breit_wheeler_engine_wrapper_h_ +#define WARPX_breit_wheeler_engine_wrapper_h_ + +#include "QedWrapperCommons.H" + +//BW ENGINE from PICSAR +#include "breit_wheeler_engine.hpp" + +using WarpXBreitWheelerWrapper = + picsar::multi_physics::breit_wheeler_engine; + +// Functors ================================== + +// These functors provide the core elementary functions of the library +// Can be included in GPU kernels + +/* \brief Functor to initialize the optical depth of photons for the +* Breit-Wheeler process */ +class BreitWheelerGetOpticalDepth +{ +public: + BreitWheelerGetOpticalDepth () + {}; + + AMREX_GPU_DEVICE + AMREX_FORCE_INLINE + amrex::Real operator() () const + { + return WarpXBreitWheelerWrapper:: + internal_get_optical_depth(amrex::Random()); + } +}; +//____________________________________________ + +// Factory class ============================= + +/* \brief Wrapper for the Breit Wheeler engine of the PICSAR library */ +class BreitWheelerEngine +{ +public: + BreitWheelerEngine (); + + /* \brief Builds the functor to initialize the optical depth */ + BreitWheelerGetOpticalDepth build_optical_depth_functor (); +}; + +//============================================ + +#endif //WARPX_breit_wheeler_engine_wrapper_H_ diff --git a/Source/QED/BreitWheelerEngineWrapper.cpp b/Source/QED/BreitWheelerEngineWrapper.cpp index 5d2da9c17..d6a5f5851 100644 --- a/Source/QED/BreitWheelerEngineWrapper.cpp +++ b/Source/QED/BreitWheelerEngineWrapper.cpp @@ -1,4 +1,4 @@ -#include "BreitWheelerEngineWrapper.hpp" +#include "BreitWheelerEngineWrapper.H" //This file provides a wrapper aroud the breit_wheeler engine //provided by the PICSAR library diff --git a/Source/QED/BreitWheelerEngineWrapper.hpp b/Source/QED/BreitWheelerEngineWrapper.hpp deleted file mode 100644 index 2f4142732..000000000 --- a/Source/QED/BreitWheelerEngineWrapper.hpp +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef WARPX_breit_wheeler_engine_wrapper_h_ -#define WARPX_breit_wheeler_engine_wrapper_h_ - -#include "QedWrapperCommons.h" - -//BW ENGINE from PICSAR -#include "breit_wheeler_engine.hpp" - -using WarpXBreitWheelerWrapper = - picsar::multi_physics::breit_wheeler_engine; - -// Functors ================================== - -// These functors provide the core elementary functions of the library -// Can be included in GPU kernels - -/* \brief Functor to initialize the optical depth of photons for the -* Breit-Wheeler process */ -class BreitWheelerGetOpticalDepth -{ -public: - BreitWheelerGetOpticalDepth () - {}; - - AMREX_GPU_DEVICE - AMREX_FORCE_INLINE - amrex::Real operator() () const - { - return WarpXBreitWheelerWrapper:: - internal_get_optical_depth(amrex::Random()); - } -}; -//____________________________________________ - -// Factory class ============================= - -/* \brief Wrapper for the Breit Wheeler engine of the PICSAR library */ -class BreitWheelerEngine -{ -public: - BreitWheelerEngine (); - - /* \brief Builds the functor to initialize the optical depth */ - BreitWheelerGetOpticalDepth build_optical_depth_functor (); -}; - -//============================================ - -#endif //WARPX_breit_wheeler_engine_wrapper_H_ diff --git a/Source/QED/Make.package b/Source/QED/Make.package index 0756ccfa4..d4bad3f18 100644 --- a/Source/QED/Make.package +++ b/Source/QED/Make.package @@ -1,6 +1,6 @@ -CEXE_headers += QedWrapperCommons.h -CEXE_headers += BreitWheelerEngineWrapper.hpp -CEXE_headers += QuantumSyncsEngineWrapper.hpp +CEXE_headers += QedWrapperCommons.H +CEXE_headers += BreitWheelerEngineWrapper.H +CEXE_headers += QuantumSyncsEngineWrapper.H CEXE_sources += BreitWheelerEngineWrapper.cpp CEXE_sources += QuantumSyncEngineWrapper.cpp diff --git a/Source/QED/QedWrapperCommons.H b/Source/QED/QedWrapperCommons.H new file mode 100644 index 000000000..821034c06 --- /dev/null +++ b/Source/QED/QedWrapperCommons.H @@ -0,0 +1,16 @@ +#ifndef WARPX_amrex_qed_wrapper_commons_h_ +#define WARPX_amrex_qed_wrapper_commons_h_ + +//Common definitions for the QED library wrappers + +#include + +//Sets the decorator for GPU +#define PXRMP_GPU AMREX_GPU_DEVICE +//Sets SI units in the library +#define PXRMP_WITH_SI_UNITS + +//An empty data type +struct DummyStruct{}; + +#endif //WARPX_amrex_qed_wrapper_commons_h_ diff --git a/Source/QED/QedWrapperCommons.h b/Source/QED/QedWrapperCommons.h deleted file mode 100644 index 821034c06..000000000 --- a/Source/QED/QedWrapperCommons.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef WARPX_amrex_qed_wrapper_commons_h_ -#define WARPX_amrex_qed_wrapper_commons_h_ - -//Common definitions for the QED library wrappers - -#include - -//Sets the decorator for GPU -#define PXRMP_GPU AMREX_GPU_DEVICE -//Sets SI units in the library -#define PXRMP_WITH_SI_UNITS - -//An empty data type -struct DummyStruct{}; - -#endif //WARPX_amrex_qed_wrapper_commons_h_ diff --git a/Source/QED/QuantumSyncEngineWrapper.H b/Source/QED/QuantumSyncEngineWrapper.H new file mode 100644 index 000000000..c6bf3a053 --- /dev/null +++ b/Source/QED/QuantumSyncEngineWrapper.H @@ -0,0 +1,49 @@ +#ifndef WARPX_quantum_sync_engine_wrapper_h_ +#define WARPX_quantum_sync_engine_wrapper_h_ + +#include "QedWrapperCommons.H" + +//QS ENGINE from PICSAR +#include "quantum_sync_engine.hpp" + +using WarpXQuantumSynchrotronWrapper = + picsar::multi_physics::quantum_synchrotron_engine; + +// Functors ================================== + +// These functors provide the core elementary functions of the library +// Can be included in GPU kernels + +/* \brief Functor to initialize the optical depth of leptons for the +* Quantum Synchrotron process */ +class QuantumSynchrotronGetOpticalDepth +{ +public: + QuantumSynchrotronGetOpticalDepth () + {}; + + AMREX_GPU_DEVICE + AMREX_FORCE_INLINE + amrex::Real operator() () const + { + return WarpXQuantumSynchrotronWrapper:: + internal_get_optical_depth(amrex::Random()); + } +}; +//____________________________________________ + +// Factory class ============================= + +/* \brief Wrapper for the Quantum Synchrotron engine of the PICSAR library */ +class QuantumSynchrotronEngine +{ +public: + QuantumSynchrotronEngine (); + + /* \brief Builds the functor to initialize the optical depth */ + QuantumSynchrotronGetOpticalDepth build_optical_depth_functor (); +}; + +//============================================ + +#endif //WARPX_quantum_sync_engine_wrapper_h_ diff --git a/Source/QED/QuantumSyncEngineWrapper.cpp b/Source/QED/QuantumSyncEngineWrapper.cpp index d09b71c45..bf06667f8 100644 --- a/Source/QED/QuantumSyncEngineWrapper.cpp +++ b/Source/QED/QuantumSyncEngineWrapper.cpp @@ -1,4 +1,4 @@ -#include "QuantumSyncEngineWrapper.hpp" +#include "QuantumSyncEngineWrapper.H" //This file provides a wrapper aroud the quantum_sync engine //provided by the PICSAR library diff --git a/Source/QED/QuantumSyncEngineWrapper.hpp b/Source/QED/QuantumSyncEngineWrapper.hpp deleted file mode 100644 index 95d4e91f5..000000000 --- a/Source/QED/QuantumSyncEngineWrapper.hpp +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef WARPX_quantum_sync_engine_wrapper_h_ -#define WARPX_quantum_sync_engine_wrapper_h_ - -#include "QedWrapperCommons.h" - -//QS ENGINE from PICSAR -#include "quantum_sync_engine.hpp" - -using WarpXQuantumSynchrotronWrapper = - picsar::multi_physics::quantum_synchrotron_engine; - -// Functors ================================== - -// These functors provide the core elementary functions of the library -// Can be included in GPU kernels - -/* \brief Functor to initialize the optical depth of leptons for the -* Quantum Synchrotron process */ -class QuantumSynchrotronGetOpticalDepth -{ -public: - QuantumSynchrotronGetOpticalDepth () - {}; - - AMREX_GPU_DEVICE - AMREX_FORCE_INLINE - amrex::Real operator() () const - { - return WarpXQuantumSynchrotronWrapper:: - internal_get_optical_depth(amrex::Random()); - } -}; -//____________________________________________ - -// Factory class ============================= - -/* \brief Wrapper for the Quantum Synchrotron engine of the PICSAR library */ -class QuantumSynchrotronEngine -{ -public: - QuantumSynchrotronEngine (); - - /* \brief Builds the functor to initialize the optical depth */ - QuantumSynchrotronGetOpticalDepth build_optical_depth_functor (); -}; - -//============================================ - -#endif //WARPX_quantum_sync_engine_wrapper_h_ -- cgit v1.2.3 From 22e80ff6c659895ebf6022f7049dfead89bb4fc4 Mon Sep 17 00:00:00 2001 From: MaxThevenet Date: Fri, 11 Oct 2019 09:25:41 -0700 Subject: EOF newline --- Source/QED/QuantumSyncEngineWrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/QED/QuantumSyncEngineWrapper.cpp') diff --git a/Source/QED/QuantumSyncEngineWrapper.cpp b/Source/QED/QuantumSyncEngineWrapper.cpp index bf06667f8..b55149187 100644 --- a/Source/QED/QuantumSyncEngineWrapper.cpp +++ b/Source/QED/QuantumSyncEngineWrapper.cpp @@ -14,4 +14,4 @@ QuantumSynchrotronEngine::build_optical_depth_functor () return QuantumSynchrotronGetOpticalDepth(); } -//============================================ \ No newline at end of file +//============================================ -- cgit v1.2.3