Skip to content

Commit

Permalink
tagging better (#903)
Browse files Browse the repository at this point in the history
fix tagging (missing absolute value)
  • Loading branch information
nicolasaunai authored Oct 18, 2024
1 parent 2fa9a75 commit a69bcf0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/amr/tagging/default_hybrid_tagger_strategy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,15 @@ void DefaultHybridTaggerStrategy<HybridModel>::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)));
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);
Expand Down

0 comments on commit a69bcf0

Please sign in to comment.