Skip to content

Commit

Permalink
Fix cppcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
pmatalon committed Jan 23, 2025
1 parent 9c4bae6 commit e5bdfd2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions include/samurai/algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::size_t>(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;
}
}
Expand Down

0 comments on commit e5bdfd2

Please sign in to comment.