From 0ed64e72b49e5396dee424b19e8c475495597fe3 Mon Sep 17 00:00:00 2001 From: Nicolas Aunai Date: Fri, 11 Oct 2024 09:35:04 +0200 Subject: [PATCH] tagging better --- src/amr/tagging/default_hybrid_tagger_strategy.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/amr/tagging/default_hybrid_tagger_strategy.hpp b/src/amr/tagging/default_hybrid_tagger_strategy.hpp index 2fb3ea9df..ffac48b93 100644 --- a/src/amr/tagging/default_hybrid_tagger_strategy.hpp +++ b/src/amr/tagging/default_hybrid_tagger_strategy.hpp @@ -108,9 +108,10 @@ void DefaultHybridTaggerStrategy::tag(HybridModel& model, { auto field_diff = [&](auto const& F) // { - return std::make_tuple( - std::abs((F(ix + 2, iy) - F(ix, iy)) / (1 + F(ix + 1, iy) - F(ix, iy))), - std::abs((F(ix, iy + 2) - F(ix, iy)) / (F(ix, iy + 1) - F(ix, iy) + 1))); + return std::make_tuple(std::abs((F(ix + 2, iy) - F(ix, iy)) + / (1 + std::abs(F(ix + 1, iy) - F(ix, iy)))), + std::abs(F(ix, iy + 2) - F(ix, iy)) + / (std::abs(F(ix, iy + 1) - F(ix, iy)) + 1)); }; auto const& [Bx_x, Bx_y] = field_diff(Bx);