aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/PhotonParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar Luca Fedeli <luca.fedeli@cea.fr> 2019-09-12 13:52:36 +0200
committerGravatar Luca Fedeli <luca.fedeli@cea.fr> 2019-09-12 13:52:36 +0200
commitd48db8b433b165a7822e914b8fda7636924f1c32 (patch)
tree3fd4d5643d129bf4c8f8df6a9a3c5f2a5b3db5c4 /Source/Particles/PhotonParticleContainer.cpp
parent9446ea37a95b79116ab78836b7a6a6f60ff4dbb2 (diff)
downloadWarpX-d48db8b433b165a7822e914b8fda7636924f1c32.tar.gz
WarpX-d48db8b433b165a7822e914b8fda7636924f1c32.tar.zst
WarpX-d48db8b433b165a7822e914b8fda7636924f1c32.zip
Added initialization of tau for photons via BW engine
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