/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
namespace internal
{
class LocalAtomSetData;
-} // namespace internal
+} // namespace internal
/*! \libinternal \brief
* A local atom set collects local, global and collective indices of
* the home atoms on a rank. The indices of the home atoms are automatically
*/
class LocalAtomSet
{
- public:
- friend class LocalAtomSetManager;
- /*! \brief Maps indices on rank [0..numAtomsLocal_) to global atom indicices.
- *
- * \returns the collective index.
- */
- ArrayRef<const int> collectiveIndex() const;
- /*! \brief Global indices of the atoms in this set.
- *
- * \note For best performance, store and use a local copy of the arrayref.
- *
- * \returns the global index.
- */
- ArrayRef<const int> globalIndex() const;
- /*! \brief Local indices of the atoms.
- *
- * For example, the i-th local atom coordinate of this set is
- * x[atomSet.localIndex()[i]].
- *
- * When using in a loop other than a range-based for loop,
- * performance may improve if the ArrayRef is stored in
- * a local variable before the loop is entered.
- * Updated within domain-decomposition.
- *
- * \note For best performance, store and use a local copy of the ArrayRef.
- *
- * \returns the local index.
- */
- ArrayRef<const int> localIndex() const;
- /*! \brief The number of atoms from this group index on this rank.
- *
- * \note For best performance, store and use a local copy of the ArrayRef.
- */
- std::size_t numAtomsLocal() const;
- /*! \brief The number of all atoms from this group index on all ranks together.
- *
- * \note For best performance, store and use a local copy.
- */
- std::size_t numAtomsGlobal() const;
- private:
- /*! \brief Constructs a new atom set by setting a reference to its
- * internal data.
- * \param[in] data The data for the atom set is stored
- * in LocalAtomSetData, which is manged by \ref gmx::LocalAtomSetManager.
- */
- explicit LocalAtomSet(const internal::LocalAtomSetData &data);
+public:
+ friend class LocalAtomSetManager;
+ /*! \brief Maps indices on rank [0..numAtomsLocal_) to global atom indicices.
+ *
+ * \returns the collective index.
+ */
+ ArrayRef<const int> collectiveIndex() const;
+ /*! \brief Global indices of the atoms in this set.
+ *
+ * \note For best performance, store and use a local copy of the arrayref.
+ *
+ * \returns the global index.
+ */
+ ArrayRef<const int> globalIndex() const;
+ /*! \brief Local indices of the atoms.
+ *
+ * For example, the i-th local atom coordinate of this set is
+ * x[atomSet.localIndex()[i]].
+ *
+ * When using in a loop other than a range-based for loop,
+ * performance may improve if the ArrayRef is stored in
+ * a local variable before the loop is entered.
+ * Updated within domain-decomposition.
+ *
+ * \note For best performance, store and use a local copy of the ArrayRef.
+ *
+ * \returns the local index.
+ */
+ ArrayRef<const int> localIndex() const;
+ /*! \brief The number of atoms from this group index on this rank.
+ *
+ * \note For best performance, store and use a local copy of the ArrayRef.
+ */
+ std::size_t numAtomsLocal() const;
+ /*! \brief The number of all atoms from this group index on all ranks together.
+ *
+ * \note For best performance, store and use a local copy.
+ */
+ std::size_t numAtomsGlobal() const;
- const internal::LocalAtomSetData * data_;
+private:
+ /*! \brief Constructs a new atom set by setting a reference to its
+ * internal data.
+ * \param[in] data The data for the atom set is stored
+ * in LocalAtomSetData, which is manged by \ref gmx::LocalAtomSetManager.
+ */
+ explicit LocalAtomSet(const internal::LocalAtomSetData& data);
+ const internal::LocalAtomSetData* data_;
};
} // namespace gmx