Skip to content

Commit

Permalink
core: p3m: Assert that interpolation is inside the local mesh patch. (#…
Browse files Browse the repository at this point in the history
…3715)

Description of changes:
- Assert that points are in the locale mesh patch in p3m interpolation.
  • Loading branch information
kodiakhq[bot] authored May 15, 2020
2 parents 5d8e7a5 + 75aa3b4 commit f6df110
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/electrostatics_magnetostatics/p3m_interpolation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ p3m_calculate_interpolation_weights(const Utils::Vector3d &position,
/* 3d-array index of nearest mesh point */
ret.ind = Utils::get_linear_index(nmp, local_mesh.dim,
Utils::MemoryOrder::ROW_MAJOR);

assert((nmp + Utils::Vector3i::broadcast(cao)) <= local_mesh.dim);
for (int i = 0; i < cao; i++) {
using Utils::bspline;

Expand Down

0 comments on commit f6df110

Please sign in to comment.