diff options
Diffstat (limited to 'Source/QED/BreitWheelerEngineWrapper.h')
-rw-r--r-- | Source/QED/BreitWheelerEngineWrapper.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Source/QED/BreitWheelerEngineWrapper.h b/Source/QED/BreitWheelerEngineWrapper.h index e9c8f2f72..aaa94c0ec 100644 --- a/Source/QED/BreitWheelerEngineWrapper.h +++ b/Source/QED/BreitWheelerEngineWrapper.h @@ -9,6 +9,22 @@ using WarpXBreitWheelerWrapper = picsar::multi_physics::breit_wheeler_engine<amrex::Real, DummyStruct>; +using WarpXBreitWheelerWrapperCtrl = + picsar::multi_physics::breit_wheeler_engine_ctrl<amrex::Real>; + +// Struct to hold engine data ================ + +struct BreitWheelerEngineInnards +{ + // Control parameters + WarpXBreitWheelerWrapperCtrl ctrl; + + //Lookup table data + amrex::Gpu::ManagedDeviceVector<amrex::Real> TTfunc_coords; + amrex::Gpu::ManagedDeviceVector<amrex::Real> TTfunc_data; + //______ +}; + // Functors ================================== // These functors provide the core elementary functions of the library @@ -27,6 +43,26 @@ public: }; //____________________________________________ +// Evolution of the optical depth (returns true if +// an event occurs) +class BreitWheelerEvolveOpticalDepth +{ +public: + BreitWheelerEvolveOpticalDepth( + BreitWheelerEngineInnards* _innards): + innards{_innards}{}; + + AMREX_GPU_DEVICE + bool operator()( + amrex::Real px, amrex::Real py, amrex::Real pz, + amrex::Real ex, amrex::Real ey, amrex::Real ez, + amrex::Real bx, amrex::Real by, amrex::Real bz, + amrex::Real dt, amrex::Real& opt_depth) const; + +private: + BreitWheelerEngineInnards* innards; +}; + // Factory class ============================= /* \brief Wrapper for the Breit Wheeler engine of the PICSAR library */ @@ -37,6 +73,25 @@ public: /* \brief Builds the functor to initialize the optical depth */ BreitWheelerGetOpticalDepth build_optical_depth_functor (); + + /* \brief Builds the functor to evolve the optical depth */ + BreitWheelerEvolveOpticalDepth build_evolve_functor (); + + /* \brief Computes the Lookup tables using the default settings + * provided by the PICSAR library */ + void computes_lookup_tables_default (); + + /* \brief Checks if lookup tables are properly initialized */ + bool are_lookup_tables_initialized () const; + +private: + bool lookup_tables_initialized = false; + + BreitWheelerEngineInnards innards; + + //Private function which actually computes the lookup tables + void computes_lookup_tables ( + WarpXBreitWheelerWrapperCtrl ctrl); }; //============================================ |