Skip to content

Commit

Permalink
wrap up from review, formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jhossbach committed Apr 8, 2022
1 parent d039c79 commit 7cefa16
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/core/CellStructure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,10 @@ struct CellStructure {
* @brief Run kernel on all particles inside cell and neighbors.
*
* @param p Particle to identify cell and neighbors
* @param kernel Function with signature <tt>double(Particle, Particle, Vector)</tt>
* @return false if cell is not found via @ref particle_to_cell, otherwise true
* @param kernel Function with signature <tt>double(Particle, Particle,
* Vector)</tt>
* @return false if cell is not found via @ref particle_to_cell, otherwise
* true
*/
template <class Kernel>
bool run_on_particle_short_range_neighbors(Particle const &p,
Expand Down Expand Up @@ -699,7 +701,7 @@ struct CellStructure {
Kernel &kernel, DistanceFunc const &df) {
/* Iterate over particles inside cell */
for (auto const &part : cell->particles()) {
if (&part == &p) {
if (part.id() == p.id()) {
continue;
}
auto const vec = df(p, part).vec21;
Expand Down
3 changes: 1 addition & 2 deletions src/core/energy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ double observable_compute_energy();
* energy contribution for particle p
*
* @param pid Particle id
* @return Double containing short-range Coulomb and non-bonded energy of the
* particle
* @return Double containing non-bonded energy of the energy
*/
double particle_short_range_energy_contribution(int pid);

Expand Down
4 changes: 4 additions & 0 deletions src/python/espressomd/cellsystem.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ cdef class CellSystem:
The list of neighbor particles surrounding the particle
"""
check_type_or_throw_except(
particle, 1, ParticleHandle, 'type is not a particle')
check_type_or_throw_except(
distance, 1, float, 'distance must be a float')
cdef vector[int] list_of_neighbors
list_of_neighbors = mpi_get_short_range_neighbors(
particle.id, distance)
Expand Down

0 comments on commit 7cefa16

Please sign in to comment.