diff options
author | 2023-06-27 08:44:12 -0700 | |
---|---|---|
committer | 2023-06-27 08:44:12 -0700 | |
commit | 3dbfff2cf50dab64aa33ba2feda44a9934efb4a7 (patch) | |
tree | a03653e26510ac9a24ee4db657ca80e45caae5bb /Source/Diagnostics/ReducedDiags/FieldReduction.cpp | |
parent | d1277b05620bf5f43e0d6bc7b8988be00c755559 (diff) | |
download | WarpX-3dbfff2cf50dab64aa33ba2feda44a9934efb4a7.tar.gz WarpX-3dbfff2cf50dab64aa33ba2feda44a9934efb4a7.tar.zst WarpX-3dbfff2cf50dab64aa33ba2feda44a9934efb4a7.zip |
Adding current density to Field Reduction reduced diagnostic (#3980)
* 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 <lzcorrales@kong.dhcp.lbl.gov>
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>
Diffstat (limited to 'Source/Diagnostics/ReducedDiags/FieldReduction.cpp')
-rw-r--r-- | Source/Diagnostics/ReducedDiags/FieldReduction.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Source/Diagnostics/ReducedDiags/FieldReduction.cpp b/Source/Diagnostics/ReducedDiags/FieldReduction.cpp index f4b521c10..32c8c9653 100644 --- a/Source/Diagnostics/ReducedDiags/FieldReduction.cpp +++ b/Source/Diagnostics/ReducedDiags/FieldReduction.cpp @@ -44,14 +44,16 @@ FieldReduction::FieldReduction (std::string rd_name) // resize data array m_data.resize(noutputs, 0.0_rt); + BackwardCompatibility(); + const amrex::ParmParse pp_rd_name(rd_name); // read reduced function with parser std::string parser_string = ""; - utils::parser::Store_parserString(pp_rd_name,"reduced_function(x,y,z,Ex,Ey,Ez,Bx,By,Bz)", + utils::parser::Store_parserString(pp_rd_name,"reduced_function(x,y,z,Ex,Ey,Ez,Bx,By,Bz,jx,jy,jz)", parser_string); m_parser = std::make_unique<amrex::Parser>( - utils::parser::makeParser(parser_string,{"x","y","z","Ex","Ey","Ez","Bx","By","Bz"})); + utils::parser::makeParser(parser_string,{"x","y","z","Ex","Ey","Ez","Bx","By","Bz","jx","jy","jz"})); // Replace all newlines and possible following whitespaces with a single whitespace. This // should avoid weird formatting when the string is written in the header of the output file. @@ -85,6 +87,18 @@ FieldReduction::FieldReduction (std::string rd_name) } // end constructor +void FieldReduction::BackwardCompatibility () +{ + amrex::ParmParse pp_rd_name(m_rd_name); + std::vector<std::string> backward_strings; + WARPX_ALWAYS_ASSERT_WITH_MESSAGE( + !pp_rd_name.queryarr("reduced_function(x,y,z,Ex,Ey,Ez,Bx,By,Bz)", backward_strings), + "<reduced_diag_name>.reduced_function(x,y,z,Ex,Ey,Ez,Bx,By,Bz) is no longer a valid option. " + "Please use the renamed option <reduced_diag_name>.reduced_function(x,y,z,Ex,Ey,Ez,Bx,By,Bz,jx,jy,jz) instead." + ); +} + + // function that does an arbitrary reduction of the electromagnetic fields void FieldReduction::ComputeDiags (int step) { |