From 15634bc0377dc2a8e29af52c6dca188205f4fbb0 Mon Sep 17 00:00:00 2001 From: SimonCan Date: Mon, 15 Apr 2024 17:11:41 +0100 Subject: [PATCH] Throw a descriptive error message if the equations of subtype AbstractIdealGlmMhdEquations are not included in the list of semidiscretizations of AbstractIdealGlmMhdEquations. --- src/callbacks_step/glm_speed.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/callbacks_step/glm_speed.jl b/src/callbacks_step/glm_speed.jl index 437170f0640..d9604a7bd68 100644 --- a/src/callbacks_step/glm_speed.jl +++ b/src/callbacks_step/glm_speed.jl @@ -99,6 +99,13 @@ end u_modified!(integrator, false) end + # Check that all MHD semidiscretizations received a GLM clening speed update. + for (semi_index, semi) in enumerate(semis) + if (typeof(semi.equations) <: AbstractIdealGlmMhdEquations && !(semi_index in semi_indices)) + throw("Equation of semidiscretization $semi_index needs to be included in 'semi_indices' of 'GlmSpeedCallback'.") + end + end + return nothing end