aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/PhotonParticleContainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Particles/PhotonParticleContainer.cpp')
-rw-r--r--Source/Particles/PhotonParticleContainer.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/Source/Particles/PhotonParticleContainer.cpp b/Source/Particles/PhotonParticleContainer.cpp
index 399892959..e6712657a 100644
--- a/Source/Particles/PhotonParticleContainer.cpp
+++ b/Source/Particles/PhotonParticleContainer.cpp
@@ -43,6 +43,11 @@ void PhotonParticleContainer::InitData()
{
AddParticles(0); // Note - add on level 0
+#ifdef WARPX_QED
+ if(do_qed_breit_wheeler)
+ InitTauBreitWheeler();
+#endif
+
if (maxLevel() > 0) {
Redistribute(); // We then redistribute
}
@@ -118,3 +123,23 @@ PhotonParticleContainer::Evolve (int lev,
t, dt);
}
+
+#ifdef WARPX_QED
+// A function to initialize the Tau component according to the BW engine
+void PhotonParticleContainer::InitTauBreitWheeler()
+{
+ BL_PROFILE("PhotonParticleContainer::InitOpticalDepth");
+//Looping over all the particles
+int num_levels = finestLevel() + 1;
+for (int lev=0; lev < num_levels; ++lev)
+ for (WarpXParIter pti(*this, lev); pti.isValid(); ++pti){
+ auto taus = pti.GetAttribs(particle_comps["tau"]).dataPtr();
+ amrex::ParallelFor(
+ pti.numParticles(),
+ [=] AMREX_GPU_DEVICE (long i) {
+ taus[i] = warpx_breit_wheeler_get_optical_depth();
+ }
+ );
+ }
+}
+#endif