Skip to content

Commit

Permalink
Add abort for adaptive time-stepping
Browse files Browse the repository at this point in the history
Currently, we do not yet support the newly implemented adaptive time-stepping
mode of electrostatic solvers together with time-averaged diagnostics.
  • Loading branch information
n01r committed Sep 24, 2024
1 parent fef38be commit 063f151
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Source/Diagnostics/FullDiagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> 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") {
Expand Down

0 comments on commit 063f151

Please sign in to comment.