From dd905cfa1bcb3db9f70c98d6bfae6aa80da75b42 Mon Sep 17 00:00:00 2001 From: Berk Hess Date: Wed, 23 Oct 2019 10:27:54 +0200 Subject: [PATCH] Expand documentation for nbnxn_put_on_grid() Change-Id: Id6349848d9d03215632cf23e59a556f4e40327fb --- src/gromacs/nbnxm/gridset.cpp | 1 - src/gromacs/nbnxm/nbnxm.cpp | 4 ++-- src/gromacs/nbnxm/nbnxm.h | 32 +++++++++++++++++++++++++------- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/gromacs/nbnxm/gridset.cpp b/src/gromacs/nbnxm/gridset.cpp index b4d76234bf..4f476b4e02 100644 --- a/src/gromacs/nbnxm/gridset.cpp +++ b/src/gromacs/nbnxm/gridset.cpp @@ -133,7 +133,6 @@ void GridSet::setLocalAtomOrder() } } -// TODO: Move to gridset.cpp void GridSet::putOnGrid(const matrix box, const int gridIndex, const rvec lowerCorner, diff --git a/src/gromacs/nbnxm/nbnxm.cpp b/src/gromacs/nbnxm/nbnxm.cpp index 52d2fecb13..29b68c28b8 100644 --- a/src/gromacs/nbnxm/nbnxm.cpp +++ b/src/gromacs/nbnxm/nbnxm.cpp @@ -56,7 +56,7 @@ void nbnxn_put_on_grid(nonbonded_verlet_t *nb_verlet, const matrix box, - int ddZone, + int gridIndex, const rvec lowerCorner, const rvec upperCorner, const gmx::UpdateGroupsCog *updateGroupsCog, @@ -68,7 +68,7 @@ void nbnxn_put_on_grid(nonbonded_verlet_t *nb_verlet, int numAtomsMoved, const int *move) { - nb_verlet->pairSearch_->putOnGrid(box, ddZone, lowerCorner, upperCorner, + nb_verlet->pairSearch_->putOnGrid(box, gridIndex, lowerCorner, upperCorner, updateGroupsCog, atomStart, atomEnd, atomDensity, atomInfo, x, numAtomsMoved, move, nb_verlet->nbat.get()); diff --git a/src/gromacs/nbnxm/nbnxm.h b/src/gromacs/nbnxm/nbnxm.h index 9e58003db2..c93ea94b00 100644 --- a/src/gromacs/nbnxm/nbnxm.h +++ b/src/gromacs/nbnxm/nbnxm.h @@ -449,16 +449,34 @@ init_nb_verlet(const gmx::MDLogger &mdlog, /*! \brief Put the atoms on the pair search grid. * * Only atoms atomStart to atomEnd in x are put on the grid. - * The atom_density is used to determine the grid size. - * When atomDensity<=0, the density is determined from atomEnd-atomStart and the corners. - * With domain decomposition part of the n particles might have migrated, - * but have not been removed yet. This count is given by nmoved. - * When move[i] < 0 particle i has migrated and will not be put on the grid. - * Without domain decomposition move will be NULL. + * When \p updateGroupsCog != nullptr, atoms are put on the grid + * based on the center of geometry of the group they belong to. + * Atoms or COGs of groups should be within the bounding box provided, + * this is checked in debug builds when not using update groups. + * The atom density is used to determine the grid size when \p gridIndex = 0. + * When \p atomDensity <= 0, the density is determined from atomEnd-atomStart + * and the bounding box corners. + * With domain decomposition, part of the atoms might have migrated, + * but have not been removed yet. This count is given by \p numAtomsMoved. + * When \p move[i] < 0 particle i has migrated and will not be put on the grid. + * + * \param[in,out] nb_verlet The non-bonded object + * \param[in] box Box used for periodic distance calculations + * \param[in] gridIndex The index of the grid to spread to, always 0 except with test particle insertion + * \param[in] lowerCorner Atom groups to be gridded should have coordinates >= this corner + * \param[in] upperCorner Atom groups to be gridded should have coordinates <= this corner + * \param[in] updateGroupsCog Centers of geometry for update groups, pass nullptr when not using update groups + * \param[in] atomStart Start of atom range to grid + * \param[in] atomEnd End of atom range to grid + * \param[in] atomDensity An estimate of the atom density, used for peformance optimization and only with \p gridIndex = 0 + * \param[in] atomInfo Atom information flags + * \param[in] x Coordinates for atoms to grid + * \param[in] numAtomsMoved The number of atoms that will move to another domain, pass 0 without DD + * \param[in] move Move flags for atoms, pass nullptr without DD */ void nbnxn_put_on_grid(nonbonded_verlet_t *nb_verlet, const matrix box, - int ddZone, + int gridIndex, const rvec lowerCorner, const rvec upperCorner, const gmx::UpdateGroupsCog *updateGroupsCog, -- 2.22.0