Skip to content

Commit a28b20a

Browse files
authored
Fix a runtime parameter issue in time-averaged diagnostics (BLAST-WarpX#5753)
Use `utils::parser::queryWithParser` instead of vanilla `amrex::Parser`, because latter does not know WarpX's constants unless it's informed. Fix BLAST-WarpX#5751
1 parent 07eed07 commit a28b20a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Source/Diagnostics/FullDiagnostics.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "FlushFormats/FlushFormat.H"
1717
#include "Particles/MultiParticleContainer.H"
1818
#include "Utils/Algorithms/IsIn.H"
19+
#include "Utils/Parser/ParserUtils.H"
1920
#include "Utils/TextMsg.H"
2021
#include "Utils/WarpXAlgorithmSelection.H"
2122
#include "WarpX.H"
@@ -132,7 +133,6 @@ FullDiagnostics::ReadParameters ()
132133
const amrex::ParmParse pp_warpx("warpx");
133134
std::vector<std::string> dt_interval_vec = {"-1"};
134135
const bool timestep_may_vary = pp_warpx.queryarr("dt_update_interval", dt_interval_vec);
135-
amrex::Print() << Utils::TextMsg::Warn("Time step varies?" + std::to_string(timestep_may_vary));
136136
if (timestep_may_vary) {
137137
WARPX_ABORT_WITH_MESSAGE(
138138
"Time-averaged diagnostics (encountered in: "
@@ -155,9 +155,8 @@ FullDiagnostics::ReadParameters ()
155155
const bool averaging_period_steps_specified = pp_diag_name.query(
156156
"average_period_steps", m_average_period_steps
157157
);
158-
const bool averaging_period_time_specified = pp_diag_name.queryWithParser(
159-
"average_period_time", m_average_period_time
160-
);
158+
const bool averaging_period_time_specified = utils::parser::queryWithParser
159+
(pp_diag_name, "average_period_time", m_average_period_time);
161160

162161
if (m_time_average_mode == TimeAverageType::Static) {
163162
// This fails if users do not specify a start.

0 commit comments

Comments
 (0)