/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2008,2009,2010.
- * Copyright (c) 2012,2013,2014,2015,2016 by the GROMACS development team.
+ * Copyright (c) 2008,2009,2010, The GROMACS development team.
+ * Copyright (c) 2012,2013,2014,2015,2016 The GROMACS development team.
* Copyright (c) 2017,2018,2019,2020, 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
return n;
}
+std::array<int, eptNR> gmx_mtop_particletype_count(const gmx_mtop_t& mtop)
+{
+ std::array<int, eptNR> count = { { 0 } };
+
+ for (const auto& molblock : mtop.molblock)
+ {
+ const t_atoms& atoms = mtop.moltype[molblock.type].atoms;
+ for (int a = 0; a < atoms.nr; a++)
+ {
+ count[atoms.atom[a].ptype] += molblock.nmol;
+ }
+ }
+
+ return count;
+}
+
static void atomcat(t_atoms* dest, const t_atoms* src, int copies, int maxres_renum, int* maxresnr)
{
int i, j, l, size;