aboutsummaryrefslogtreecommitdiff
path: root/Examples/Tests/particle_boundary_scrape/analysis_scrape.py
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/Tests/particle_boundary_scrape/analysis_scrape.py')
-rwxr-xr-xExamples/Tests/particle_boundary_scrape/analysis_scrape.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/Examples/Tests/particle_boundary_scrape/analysis_scrape.py b/Examples/Tests/particle_boundary_scrape/analysis_scrape.py
new file mode 100755
index 000000000..bf1de62bf
--- /dev/null
+++ b/Examples/Tests/particle_boundary_scrape/analysis_scrape.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python3
+
+from pathlib import Path
+
+import yt
+
+# This test shoots a beam of electrons at cubic embedded boundary geometry
+# At time step 40, none of the particles have hit the boundary yet. At time
+# step 60, all of them should have been absorbed by the boundary. In the
+# absence of the cube, none of the particles would have had time to exit
+# the problem domain yet.
+
+# all particles are still there
+if Path("particle_scrape_plt000040").is_dir():
+ filename = "particle_scrape_plt000040"
+else:
+ filename = "Python_particle_scrape_plt000040"
+ds40 = yt.load(filename)
+np40 = ds40.index.particle_headers['electrons'].num_particles
+assert(np40 == 612)
+
+# all particles have been removed
+if Path("particle_scrape_plt000060").is_dir():
+ filename = "particle_scrape_plt000060"
+else:
+ filename = "Python_particle_scrape_plt000060"
+ds60 = yt.load(filename)
+np60 = ds60.index.particle_headers['electrons'].num_particles
+assert(np60 == 0)