5959FullDiagnostics::DerivedInitData () {
6060 if (m_diag_type == DiagTypes::TimeAveraged) {
6161 auto & warpx = WarpX::GetInstance ();
62- if (m_time_average_type == TimeAverageType::Dynamic) {
62+ if (m_time_average_mode == TimeAverageType::Dynamic) {
6363
6464 // already checked in ReadParameters that only one of the parameters is set
6565 // calculate the other averaging period parameter from the other one, respectively
@@ -128,11 +128,11 @@ FullDiagnostics::ReadParameters ()
128128 pp_diag_name.get (" time_average_mode" , m_time_average_mode_str);
129129
130130 if (m_time_average_mode_str == " fixed_start" ) {
131- m_time_average_type = TimeAverageType::Static;
131+ m_time_average_mode = TimeAverageType::Static;
132132 } else if (m_time_average_mode_str == " dynamic_start" ) {
133- m_time_average_type = TimeAverageType::Dynamic;
133+ m_time_average_mode = TimeAverageType::Dynamic;
134134 } else if (m_time_average_mode_str == " none" ) {
135- m_time_average_type = TimeAverageType::None;
135+ m_time_average_mode = TimeAverageType::None;
136136 } else {
137137 WARPX_ABORT_WITH_MESSAGE (
138138 " Unknown time averaging mode. Valid entries are: none, fixed_start, dynamic_start"
@@ -146,7 +146,7 @@ FullDiagnostics::ReadParameters ()
146146 " average_period_time" , m_average_period_time
147147 );
148148
149- if (m_time_average_type == TimeAverageType::Static) {
149+ if (m_time_average_mode == TimeAverageType::Static) {
150150 // This fails if users do not specify a start.
151151 pp_diag_name.get (" average_start_step" , m_average_start_step);
152152 if (m_average_start_step == 0 ) {
@@ -170,7 +170,7 @@ FullDiagnostics::ReadParameters ()
170170
171171 }
172172
173- if (m_time_average_type == TimeAverageType::Dynamic) {
173+ if (m_time_average_mode == TimeAverageType::Dynamic) {
174174 // one of the two averaging period options must be set but neither none nor both
175175 if (
176176 (averaging_period_steps_specified && averaging_period_time_specified)
@@ -238,7 +238,7 @@ FullDiagnostics::Flush ( int i_buffer, bool /* force_flush */ )
238238 // to accommodate a user workflow that only uses that type of diagnostic.
239239 // This allows for quicker turnaround in setup by avoiding having to set an additional instantaneous diagnostic.
240240 if (m_diag_type == DiagTypes::TimeAveraged && step > 0 ) {
241- if (m_time_average_type == TimeAverageType::Static || m_time_average_type == TimeAverageType::Dynamic) {
241+ if (m_time_average_mode == TimeAverageType::Static || m_time_average_mode == TimeAverageType::Dynamic) {
242242 // Loop over the output levels and divide by the number of steps in the averaging period
243243 for (int lev = 0 ; lev < nlev_output; ++lev) {
244244 m_sum_mf_output.at (i_buffer).at (lev).mult (1 ._rt /static_cast <amrex::Real>(m_average_period_steps));
@@ -251,7 +251,7 @@ FullDiagnostics::Flush ( int i_buffer, bool /* force_flush */ )
251251 m_file_min_digits, m_plot_raw_fields, m_plot_raw_fields_guards);
252252
253253 // Reset the values in the dynamic start time-averaged diagnostics after flush
254- if (m_time_average_type == TimeAverageType::Dynamic) {
254+ if (m_time_average_mode == TimeAverageType::Dynamic) {
255255 for (int lev = 0 ; lev < nlev_output; ++lev) {
256256 m_sum_mf_output.at (i_buffer).at (lev).setVal (0 .);
257257 }
@@ -298,12 +298,12 @@ FullDiagnostics::DoComputeAndPack (int step, bool force_flush)
298298
299299 if (step > 0 ) {
300300
301- if (m_time_average_type == TimeAverageType::Dynamic) {
301+ if (m_time_average_mode == TimeAverageType::Dynamic) {
302302 m_average_start_step = m_intervals.nextContains (step) - m_average_period_steps;
303303 // check that the periods do not overlap and that the start step is not negative
304304 if (m_average_start_step > 0 ) {
305305 // The start step cannot be on an interval step because then we would begin a new period and also output the old one
306- if (m_average_start_step <= m_intervals.previousContains (step)) {
306+ if (m_average_start_step < m_intervals.previousContains (step)) {
307307 WARPX_ABORT_WITH_MESSAGE (
308308 " Averaging periods may not overlap within a single diagnostic. "
309309 " Please create a second diagnostic for overlapping time averaging periods "
@@ -321,7 +321,7 @@ FullDiagnostics::DoComputeAndPack (int step, bool force_flush)
321321 if (step >= m_average_start_step && step <= m_intervals.nextContains (step)) {
322322 in_averaging_period = true ;
323323
324- if (m_time_average_type == TimeAverageType::Static) {
324+ if (m_time_average_mode == TimeAverageType::Static) {
325325 // Update time averaging period to current step
326326 m_average_period_steps = step - m_average_start_step;
327327 }
0 commit comments