From 6889e24e4fe0c6c8f940175c7ea24c01e565533a Mon Sep 17 00:00:00 2001 From: Jooheon Yoo Date: Thu, 15 Aug 2024 14:42:39 -0400 Subject: [PATCH] Add lower bound of zero for TildeTau in FixConservative for zero B --- .../Systems/GrMhd/ValenciaDivClean/FixConservatives.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FixConservatives.cpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FixConservatives.cpp index 81d24c9fd02d4..d3ea940d996e7 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/FixConservatives.cpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/FixConservatives.cpp @@ -327,6 +327,14 @@ bool FixConservatives::operator()( } } + else { + if (const auto tilde_tau_mask = tau_tilde > 0.0 * tau_tilde; + simd::any(tilde_tau_mask)) { + needed_fixing = true; + tau_tilde = simd::select(tilde_tau_mask, 0.0 * tau_tilde, tau_tilde); + } + } + // Decrease momentum density if necessary auto s_tilde_squared = load(get(tilde_s_squared)); // Equation B.24 of Foucart