From 943c02f7f45dda9a8debc1bf58c97f116b235ac6 Mon Sep 17 00:00:00 2001 From: Nicolas Aunai Date: Wed, 16 Oct 2024 10:00:39 +0200 Subject: [PATCH] cleaner --- src/amr/tagging/default_hybrid_tagger_strategy.hpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/amr/tagging/default_hybrid_tagger_strategy.hpp b/src/amr/tagging/default_hybrid_tagger_strategy.hpp index ffac48b93..b9a016f7d 100644 --- a/src/amr/tagging/default_hybrid_tagger_strategy.hpp +++ b/src/amr/tagging/default_hybrid_tagger_strategy.hpp @@ -108,10 +108,15 @@ 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 + 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 delta_2x = std::abs(F(ix + 2, iy) - F(ix, iy)); + auto const delta_2y = std::abs(F(ix, iy + 2) - F(ix, iy)); + auto const delta_x = std::abs(F(ix + 1, iy) - F(ix, iy)); + auto const delta_y = std::abs(F(ix, iy + 1) - F(ix, iy)); + + auto const criter_x = delta_2x / (1 + delta_x); + auto const criter_y = delta_2y / (1 + delta_y); + + return std::make_tuple(criter_x, criter_y); }; auto const& [Bx_x, Bx_y] = field_diff(Bx);