From 3dbfff2cf50dab64aa33ba2feda44a9934efb4a7 Mon Sep 17 00:00:00 2001 From: Lizzette Corrales <37250093+lzcorrales@users.noreply.github.com> Date: Tue, 27 Jun 2023 08:44:12 -0700 Subject: Adding current density to Field Reduction reduced diagnostic (#3980) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adding j in FieldReduction * Modiyfying input file with FieldReduced diag * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update Source/Diagnostics/ReducedDiags/FieldReduction.H * updating Field Reduction Docs to include current density * Update Source/Diagnostics/ReducedDiags/FieldReduction.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * adding cuurent density BackwardCompatibility to Field Reduction diagnostic * including E dot j density using the modifyed Field Reduction * fixing picmi interface * adding Edotj to automated python test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Lizzette Corrales Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> --- Examples/Tests/reduced_diags/analysis_reduced_diags_impl.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Examples/Tests/reduced_diags/analysis_reduced_diags_impl.py') diff --git a/Examples/Tests/reduced_diags/analysis_reduced_diags_impl.py b/Examples/Tests/reduced_diags/analysis_reduced_diags_impl.py index 76732aeec..93352d29f 100755 --- a/Examples/Tests/reduced_diags/analysis_reduced_diags_impl.py +++ b/Examples/Tests/reduced_diags/analysis_reduced_diags_impl.py @@ -166,6 +166,9 @@ def do_analysis(single_precision = False): Bx = ad[('mesh','Bx')].to_ndarray() By = ad[('mesh','By')].to_ndarray() Bz = ad[('mesh','Bz')].to_ndarray() + jx = ad[('mesh','jx')].to_ndarray() + jy = ad[('mesh','jy')].to_ndarray() + jz = ad[('mesh','jz')].to_ndarray() rho = ad[('boxlib','rho')].to_ndarray() rho_electrons = ad[('boxlib','rho_electrons')].to_ndarray() rho_protons = ad[('boxlib','rho_protons')].to_ndarray() @@ -203,6 +206,7 @@ def do_analysis(single_precision = False): values_yt['protons: maximum of |rho|'] = np.amax(np.abs(rho_protons)) values_yt['maximum of |B| from generic field reduction'] = np.amax(np.sqrt(Bx**2 + By**2 + Bz**2)) values_yt['minimum of x*Ey*Bz'] = np.amin(x*Ey*Bz) + values_yt['maximum of Edotj'] = np.amax(Ex*jx + Ey*jy + Ez*jz) #-------------------------------------------------------------------------------------------------- # Part 2: get results from reduced diagnostics (label '_rd') @@ -222,6 +226,7 @@ def do_analysis(single_precision = False): FR_Maxdata = np.genfromtxt('./diags/reducedfiles/FR_Max.txt') # Field Reduction using maximum FR_Mindata = np.genfromtxt('./diags/reducedfiles/FR_Min.txt') # Field Reduction using minimum FR_Integraldata = np.genfromtxt('./diags/reducedfiles/FR_Integral.txt') # Field Reduction using integral + Edotjdata = np.genfromtxt('./diags/reducedfiles/Edotj.txt') # E dot j maximum # First index "1" points to the values written at the last time step values_rd['field energy'] = EFdata[1][2] @@ -283,6 +288,7 @@ def do_analysis(single_precision = False): values_rd['photons: sum of weights'] = NPdata[1][9] values_rd['maximum of |B| from generic field reduction'] = FR_Maxdata[1][2] values_rd['minimum of x*Ey*Bz'] = FR_Mindata[1][2] + values_rd['maximum of Edotj'] = Edotjdata[1][2] #-------------------------------------------------------------------------------------------------- # Part 3: compare values from plotfiles and reduced diagnostics and print output -- cgit v1.2.3