aboutsummaryrefslogtreecommitdiff
path: root/Examples/Modules/RigidInjection/analysis_rigid_injection_BoostedFrame.py
diff options
context:
space:
mode:
authorGravatar MaxThevenet <mthevenet@lbl.gov> 2019-08-15 11:42:10 -0700
committerGravatar MaxThevenet <mthevenet@lbl.gov> 2019-08-15 11:42:10 -0700
commitbebb5fe0bb2067f37705bdc85e9cb7986495694c (patch)
tree5f59ff84e6aabb5dac77bed3656da1af0fca7682 /Examples/Modules/RigidInjection/analysis_rigid_injection_BoostedFrame.py
parentac26af7ea220b08b011563794c0c6348a69bc303 (diff)
downloadWarpX-bebb5fe0bb2067f37705bdc85e9cb7986495694c.tar.gz
WarpX-bebb5fe0bb2067f37705bdc85e9cb7986495694c.tar.zst
WarpX-bebb5fe0bb2067f37705bdc85e9cb7986495694c.zip
add comments in analysis scripts
Diffstat (limited to 'Examples/Modules/RigidInjection/analysis_rigid_injection_BoostedFrame.py')
-rwxr-xr-xExamples/Modules/RigidInjection/analysis_rigid_injection_BoostedFrame.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Examples/Modules/RigidInjection/analysis_rigid_injection_BoostedFrame.py b/Examples/Modules/RigidInjection/analysis_rigid_injection_BoostedFrame.py
index 7522d1ab1..497a30097 100755
--- a/Examples/Modules/RigidInjection/analysis_rigid_injection_BoostedFrame.py
+++ b/Examples/Modules/RigidInjection/analysis_rigid_injection_BoostedFrame.py
@@ -1,5 +1,17 @@
#! /usr/bin/env python
+'''
+Analysis script of a WarpX simulation of rigid injection in a boosted frame.
+
+A Gaussian electron beam starts from -5 microns, propagates rigidly up to
+20 microns after which it expands due to emittance only (the focal position is
+20 microns). The beam width is measured after ~50 microns, and compared with
+the theory (with a 5% error allowed).
+
+The simulation runs in a boosted frame, and the analysis is done in the lab
+frame, i.e., on the back-transformed diagnostics.
+'''
+
import sys, os, yt, glob
import numpy as np
import scipy.constants as scc
@@ -35,5 +47,7 @@ wth = np.sqrt( w0**2 + (z-z0)**2*theta0**2 )
error = np.abs((w-wth)/wth)
# Print error and assert small error
+print("Beam position: " + str(z))
+print("Beam width : " + str(w))
print("error: " + str(error))
assert( error < 0.03 )