Partial renaming of cginfo to atom info
[alexxy/gromacs.git] / src / gromacs / domdec / utility.h
index e3fea6e1e7de42a3a8ac38732011c4b80fa77800..ce65383f19a984454f8c1f1de88f4ec53af56c36 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, 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.
@@ -82,17 +82,19 @@ void make_tric_corr_matrix(int npbcdim, const matrix box, matrix tcm);
 /*! \brief Ensure box obeys the screw restrictions, fatal error if not */
 void check_screw_box(const matrix box);
 
-/*! \brief Return the charge group information flags for charge group cg */
-static inline int ddcginfo(gmx::ArrayRef<const cginfo_mb_t> cginfo_mb, int cg)
+/*! \brief Return the atom information flags for atom a */
+static inline int ddGetAtomInfo(gmx::ArrayRef<const AtomInfoWithinMoleculeBlock> atomInfoForEachMoleculeBlock,
+                                int                                              a)
 {
     size_t index = 0;
-    while (cg >= cginfo_mb[index].cg_end)
+    while (a >= atomInfoForEachMoleculeBlock[index].indexOfLastAtomInMoleculeBlock)
     {
         index++;
     }
-    const cginfo_mb_t& cgimb = cginfo_mb[index];
+    const AtomInfoWithinMoleculeBlock& atomInfoOfMoleculeBlock = atomInfoForEachMoleculeBlock[index];
 
-    return cgimb.cginfo[(cg - cgimb.cg_start) % cgimb.cg_mod];
+    return atomInfoOfMoleculeBlock.atomInfo[(a - atomInfoOfMoleculeBlock.indexOfFirstAtomInMoleculeBlock)
+                                            % atomInfoOfMoleculeBlock.atomInfo.size()];
 };
 
 /*! \brief Returns the number of MD steps for which load has been recorded */