diff options
author | 2022-05-23 09:02:50 -0700 | |
---|---|---|
committer | 2022-05-23 09:02:50 -0700 | |
commit | c5ddd74a8ed9192d8260960a2f6df6e7ae929aad (patch) | |
tree | 2f5cf2b3cf93358269e0830a9867a39be0c1ddd3 /Source/Diagnostics/Diagnostics.cpp | |
parent | cf22fcd7258007598b48d9973470dd0b080ef803 (diff) | |
download | WarpX-c5ddd74a8ed9192d8260960a2f6df6e7ae929aad.tar.gz WarpX-c5ddd74a8ed9192d8260960a2f6df6e7ae929aad.tar.zst WarpX-c5ddd74a8ed9192d8260960a2f6df6e7ae929aad.zip |
Add `do_average` option to the particle fields diagnostic (#3067)
* Added do_average option to the particle fields diagnostic
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Updated CI benchmark files
* Updated CI benchmark files
* Fix ParticleReductionFunctor comment
* Changed maps to vector for code simplification
* Change do_average to bool
Co-authored-by: Hannah Klion <klion@lbl.gov>
Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
* Fix from the merge
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Hannah Klion <klion@lbl.gov>
Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>
Diffstat (limited to 'Source/Diagnostics/Diagnostics.cpp')
-rw-r--r-- | Source/Diagnostics/Diagnostics.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/Diagnostics/Diagnostics.cpp b/Source/Diagnostics/Diagnostics.cpp index 6e2ed12d4..998d21f69 100644 --- a/Source/Diagnostics/Diagnostics.cpp +++ b/Source/Diagnostics/Diagnostics.cpp @@ -97,7 +97,7 @@ Diagnostics::BaseReadParameters () m_varnames_fields.end()); } - // Get names of particle quantities to average at each grid point + // Get names of particle field diagnostic quantities to calculate at each grid point const bool pfield_varnames_specified = pp_diag_name.queryarr("particle_fields_to_plot", m_pfield_varnames); if (!pfield_varnames_specified){ m_pfield_varnames = {}; @@ -109,13 +109,15 @@ Diagnostics::BaseReadParameters () ); #endif - // Get parser strings for particle fields and generate map of parsers std::string parser_str; std::string filter_parser_str = ""; bool do_parser_filter; amrex::ParmParse pp_diag_pfield(m_diag_name + ".particle_fields"); for (const auto& var : m_pfield_varnames) { + bool do_average = true; + pp_diag_pfield.query((var + ".do_average").c_str(), do_average); + m_pfield_do_average.push_back(do_average); Store_parserString(pp_diag_pfield, (var + "(x,y,z,ux,uy,uz)").c_str(), parser_str); WARPX_ALWAYS_ASSERT_WITH_MESSAGE( @@ -124,13 +126,13 @@ Diagnostics::BaseReadParameters () + m_diag_name + ".particle_fields." + var + "(x,y,z,ux,uy,uz) is required" ); - m_pfield_strings.insert({var, parser_str}); + m_pfield_strings.push_back(parser_str); // Look for and record filter functions. If one is not found, the empty string will be // stored as the filter string, and will be ignored. do_parser_filter = pp_diag_pfield.query((var + ".filter(x,y,z,ux,uy,uz)").c_str(), filter_parser_str); - m_pfield_dofilter.insert({var, do_parser_filter}); - m_pfield_filter_strings.insert({var, filter_parser_str}); + m_pfield_dofilter.push_back(do_parser_filter); + m_pfield_filter_strings.push_back(filter_parser_str); } // Names of all species in the simulation |