aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/ReducedDiags/FieldReduction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Diagnostics/ReducedDiags/FieldReduction.cpp')
-rw-r--r--Source/Diagnostics/ReducedDiags/FieldReduction.cpp18
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)
{