diff --git a/include/samurai/mr/adapt.hpp b/include/samurai/mr/adapt.hpp index 8cbe5b880..8d832e38e 100644 --- a/include/samurai/mr/adapt.hpp +++ b/include/samurai/mr/adapt.hpp @@ -174,11 +174,11 @@ namespace samurai } update_ghost_mr(m_fields); + auto mesh_old = mesh; old_fields_t old_fields; if constexpr (keep_previous) { - auto mesh_old = mesh; - old_fields = detail::copy_fields(mesh_old, m_fields); + old_fields = detail::copy_fields(mesh_old, m_fields); } for (std::size_t i = 0; i < max_level - min_level; ++i)