diff --git a/include/samurai/algorithm.hpp b/include/samurai/algorithm.hpp index 7f29fa85..d3db254e 100644 --- a/include/samurai/algorithm.hpp +++ b/include/samurai/algorithm.hpp @@ -485,17 +485,16 @@ namespace samurai cell_t cell; for (std::size_t level = min_level; level <= max_level; ++level) { - auto cell_length = mesh.cell_length(level); - cell.indices = xt::floor((cartesian_coords - mesh.origin_point()) / cell_length); - auto offset = find(mesh[mesh_id_t::cells][level], cell.indices); + auto length = mesh.cell_length(level); + cell.indices = xt::floor((cartesian_coords - mesh.origin_point()) / length); + auto offset = find(mesh[mesh_id_t::cells][level], cell.indices); if (offset >= 0) { auto interval = mesh[mesh_id_t::cells][level][0][static_cast(offset)]; cell.index = interval.index + cell.indices[0]; cell.level = level; - cell.length = cell_length; + cell.length = length; cell.origin_point = mesh.origin_point(); - std::cout << cell.corner() << ", " << cell.corner() + cell_length << std::endl; return cell; } }