aboutsummaryrefslogtreecommitdiff
path: root/Examples/Tests/particle_fields_diags/analysis_particle_diags_single.py
diff options
context:
space:
mode:
authorGravatar Hannah Klion <klion@lbl.gov> 2022-03-13 22:57:14 -0700
committerGravatar GitHub <noreply@github.com> 2022-03-13 22:57:14 -0700
commit7df47510e16b785ff70254ef27aaea6ea9770003 (patch)
tree957629844173373c0b33612c1b80783dd9199b8b /Examples/Tests/particle_fields_diags/analysis_particle_diags_single.py
parent98d65284abdc1330f86c9fe9a6563a0fba486860 (diff)
downloadWarpX-7df47510e16b785ff70254ef27aaea6ea9770003.tar.gz
WarpX-7df47510e16b785ff70254ef27aaea6ea9770003.tar.zst
WarpX-7df47510e16b785ff70254ef27aaea6ea9770003.zip
Add by-cell averages of particle properties (#2892)
* Add ParticleReductionFunctor * Adds a by-cell particle average diagnostic * Averaged quantity is given by an input parser in (x,y,z,ux,uy,uz) * Coordinates in these parsers are in the WarpX convention * Users specify which species the averages are calculated for. The averages are calculated for each given species individually. * If there are no particles in a cell, the average will be zero. * add documentation for ParticleReductionFunctor * add test for cell-averaged particle diagnostics * set benchmarks for praticle_fields_diags and particle_fields_diags_single_precision * small changes to parameter docs and test script (addressing David's comments) * Apply suggestions from code review * remove unnecessary comments in python test script * remove unused variable * fixed inaccurate comments * use static_cast<int> pattern * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add comment in ParticleReductionFunctor.H * warpx.serialize_ics -> warpx.serialize_initial_conditions * AMREX_SPACEDIM to WARPX_DIM_3D and WARPX_DIM_XZ * fix compile errors from dimensionality conditionals * fix compile errors * Apply suggestions from code review * clarify docs * add include headers * update docs Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to 'Examples/Tests/particle_fields_diags/analysis_particle_diags_single.py')
-rwxr-xr-xExamples/Tests/particle_fields_diags/analysis_particle_diags_single.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Examples/Tests/particle_fields_diags/analysis_particle_diags_single.py b/Examples/Tests/particle_fields_diags/analysis_particle_diags_single.py
new file mode 100755
index 000000000..56d98831e
--- /dev/null
+++ b/Examples/Tests/particle_fields_diags/analysis_particle_diags_single.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+
+# Copyright 2019-2022 Luca Fedeli, Yinjian Zhao, Hannah Klion
+#
+# This file is part of WarpX.
+#
+# License: BSD-3-Clause-LBNL
+
+# This script tests the reduced particle diagnostics.
+# The setup is a uniform plasma with electrons, protons and photons.
+# Various particle and field quantities are written to file using the reduced diagnostics
+# and compared with the corresponding quantities computed from the data in the plotfiles.
+
+import analysis_particle_diags_impl as an
+
+an.do_analysis(single_precision = True)