aboutsummaryrefslogtreecommitdiff
path: root/Examples/Tests/openpmd_rz/analysis_openpmd_rz.py
diff options
context:
space:
mode:
authorGravatar Ryan Sandberg <RSandberg@lbl.gov> 2022-03-22 12:10:23 -0400
committerGravatar GitHub <noreply@github.com> 2022-03-22 09:10:23 -0700
commitcb2ddd3269debcbe99fad0bf75e2ef7b2c13b7c3 (patch)
treef6441a6fdaad6196cce312e758ff7b14cf62a252 /Examples/Tests/openpmd_rz/analysis_openpmd_rz.py
parentbe559b9988e90ffb7b8b18ef68cf942c4e3f36df (diff)
downloadWarpX-cb2ddd3269debcbe99fad0bf75e2ef7b2c13b7c3.tar.gz
WarpX-cb2ddd3269debcbe99fad0bf75e2ef7b2c13b7c3.tar.zst
WarpX-cb2ddd3269debcbe99fad0bf75e2ef7b2c13b7c3.zip
openPMD RZ modes dumped in thetaMode (#2878)
* [Draft] openPMD: RZ Modes * Change 'theta' to 't' and 'J' to 'j' * Docs: openPMD rz notes * editing docs openPMD RZ note * erase cartesian E,B,j from openPMD rz diags list * openpmd rz: theta->t, exclude xyz dumps * openpmd rz: axes r,z, save as comp[mode][r][z] * catch logic bugs tracking when in rz mode * change return type to c++17 tuple in helper fn * allow divB functor to store in theta mode * tuple bindings / account for theta mode variables * only r,t,z componets in RZ, separate rz field init * separate rz field init, arbitrary diags in RZ * docs: xyz comps in cartesian, rtz in rz geometry * docs : remove mention of dump_rz_modes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * clarify documentation of InitializeFieldFunctorsRZ * n_rz_modes = 1 if not in RZ * style change for brackets * style, documentation, clarify magic constants * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add helper getVec * transpose RZ openPMD data for proper viewing * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * safe for 2d and rz * fix transpose order of limits, add tinyProfiler * document transpose function, lack of optimization * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix divB num components * keeping changes to openPMD+RZ, not general RZ * divB made more similar to divE * eliminate or document unused variables * fix openPMD+RZ documentation * change thetaMode parser to regex * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * replace n_rz_azimuthal_modes with warpx variable ncomps * Ignore Unused Var in Cartesian * add rz openpmd analysis * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix warnings: unused vars * clarify documentation of dump_rz_modes * cleaning up before sending to PR * remove divB, divE, test in a different PR * Update Source/Diagnostics/WarpXOpenPMD.cpp fix Dxygen strings Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * clean up doxygen, note issue in divB * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixing rz_opmd test, still not passing * Fix: Unused <diag>.dump_rz_modes * updating openPMD+rz analysis * Regression Setup: set `outputFile` * Use HDF5 Backend This is most likely installed by all developers, so we use it for tests. * Code Style Updates * simplify test and reduce code redundancy * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * reduce redundancy 1 less line * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Keep HDF5 HDF5 is easier to install for developers and provided in CI. * Style fixes * Style fix Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Diffstat (limited to 'Examples/Tests/openpmd_rz/analysis_openpmd_rz.py')
-rwxr-xr-xExamples/Tests/openpmd_rz/analysis_openpmd_rz.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/Examples/Tests/openpmd_rz/analysis_openpmd_rz.py b/Examples/Tests/openpmd_rz/analysis_openpmd_rz.py
new file mode 100755
index 000000000..0a15173b6
--- /dev/null
+++ b/Examples/Tests/openpmd_rz/analysis_openpmd_rz.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+
+import openpmd_api as io
+
+series = io.Series("LaserAccelerationRZ_opmd_plt/openpmd_%T.h5", io.Access.read_only)
+
+assert len(series.iterations) == 3, 'improper number of iterations stored'
+
+ii = series.iterations[20]
+
+assert len(ii.meshes) == 7, 'improper number of meshes'
+
+jt = ii.meshes['j']['t']
+(Nm, Nr, Nz) = jt.shape
+
+assert Nm == 3, 'Wrong number of angular modes stored or possible incorrect ordering when flushed'
+assert Nr == 64, 'Wrong number of radial points stored or possible incorrect ordering when flushed'
+assert Nz == 512, 'Wrong number of z points stored or possible incorrect ordering when flushed'
+
+assert ii.meshes['part_per_grid'][io.Mesh_Record_Component.SCALAR].shape == [64,512], 'problem with part_per_grid'
+assert ii.meshes['rho_electrons'][io.Mesh_Record_Component.SCALAR].shape == [3, 64, 512], 'problem with rho_electrons'