From 063f151ba771f459d5c3b5a0a8e5c22b9049b183 Mon Sep 17 00:00:00 2001 From: Marco Garten Date: Tue, 24 Sep 2024 12:06:23 -0700 Subject: [PATCH] Add abort for adaptive time-stepping Currently, we do not yet support the newly implemented adaptive time-stepping mode of electrostatic solvers together with time-averaged diagnostics. --- Source/Diagnostics/FullDiagnostics.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Source/Diagnostics/FullDiagnostics.cpp b/Source/Diagnostics/FullDiagnostics.cpp index 772e5c00171..eeca8ffdb44 100644 --- a/Source/Diagnostics/FullDiagnostics.cpp +++ b/Source/Diagnostics/FullDiagnostics.cpp @@ -129,6 +129,17 @@ FullDiagnostics::ReadParameters () */ pp_diag_name.get("time_average_mode", m_time_average_mode_str); + const amrex::ParmParse pp_warpx("warpx"); + std::vector dt_interval_vec = {"-1"}; + const bool timestep_may_vary = pp_warpx.queryarr("dt_update_interval", dt_interval_vec); + amrex::Print() << Utils::TextMsg::Warn("Time step varies?" + std::to_string(timestep_may_vary)); + if (timestep_may_vary) { + WARPX_ABORT_WITH_MESSAGE( + "Time-averaged diagnostics (encountered in: " + + m_diag_name + ") are currently not supported with adaptive time-stepping" + ); + } + if (m_time_average_mode_str == "fixed_start") { m_time_average_mode = TimeAverageType::Static; } else if (m_time_average_mode_str == "dynamic_start") {