From ffb2c6a10bcfcf8c2b7a617f0d1ddb9fd8666aec Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Mon, 3 Jun 2019 15:24:54 +0200 Subject: Added function to initialize the optical depth (still crashing) --- Source/Particles/PhotonParticleContainer.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'Source/Particles/PhotonParticleContainer.cpp') diff --git a/Source/Particles/PhotonParticleContainer.cpp b/Source/Particles/PhotonParticleContainer.cpp index 9ea448ec8..6e6300bd1 100644 --- a/Source/Particles/PhotonParticleContainer.cpp +++ b/Source/Particles/PhotonParticleContainer.cpp @@ -11,6 +11,8 @@ #include #include +#include "breit_wheeler_engine_wrapper.h" + using namespace amrex; PhotonParticleContainer::PhotonParticleContainer (AmrCore* amr_core, int ispecies, @@ -37,10 +39,6 @@ void PhotonParticleContainer::InitData() { AddParticles(0); // Note - add on level 0 -#ifdef WARPX_QED - InitOpticalDepth(); -#endif - if (maxLevel() > 0) { Redistribute(); // We then redistribute } @@ -110,7 +108,12 @@ PhotonParticleContainer::Evolve (int lev, #ifdef WARPX_QED - void PhotonParticleContainer::InitOpticalDepth(){ - - } +void PhotonParticleContainer::InitOpticalDepth( + WarpXParIter& pti, + warpx_breit_wheeler_engine& engine) +{ + auto& taus = pti.GetAttribs(particle_comps["tau"]); + for(auto& tau: taus) + tau = engine.get_optical_depth(); +} #endif -- cgit v1.2.3