int
ncg_mtop(const gmx_mtop_t *mtop);
+/* Removes the charge groups, i.e. makes single atom charge groups, in mtop */
+void gmx_mtop_remove_chargegroups(gmx_mtop_t *mtop);
+
+
+/* Abstract data type for looking up atoms by global atom number */
+typedef struct gmx_mtop_atomlookup *gmx_mtop_atomlookup_t;
+
+/* Initialize atom lookup by global atom number */
+gmx_mtop_atomlookup_t
+gmx_mtop_atomlookup_init(const gmx_mtop_t *mtop);
+
+/* As gmx_mtop_atomlookup_init, but optimized for atoms involved in settle */
+gmx_mtop_atomlookup_t
+gmx_mtop_atomlookup_settle_init(const gmx_mtop_t *mtop);
+
+/* Destroy a gmx_mtop_atomlookup_t data structure */
+void
+gmx_mtop_atomlookup_destroy(gmx_mtop_atomlookup_t alook);
+
/* Returns a pointer to the t_atom struct belonging to atnr_global.
* This can be an expensive operation, so if possible use
* one of the atom loop constructs below.
*/
void
-gmx_mtop_atomnr_to_atom(const gmx_mtop_t *mtop,int atnr_global,
+gmx_mtop_atomnr_to_atom(const gmx_mtop_atomlookup_t alook,
+ int atnr_global,
t_atom **atom);
* and the local atom number in the molecule belonging to atnr_global.
*/
void
-gmx_mtop_atomnr_to_ilist(const gmx_mtop_t *mtop,int atnr_global,
+gmx_mtop_atomnr_to_ilist(const gmx_mtop_atomlookup_t alook,
+ int atnr_global,
t_ilist **ilist_mol,int *atnr_offset);
* belonging to atnr_global.
*/
void
-gmx_mtop_atomnr_to_molblock_ind(const gmx_mtop_t *mtop,int atnr_global,
+gmx_mtop_atomnr_to_molblock_ind(const gmx_mtop_atomlookup_t alook,
+ int atnr_global,
int *molb,int *molnr,int *atnr_mol);