*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,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
* top-level source directory and at http://www.gromacs.org.
return n_intercg_vsite;
}
-std::unique_ptr<gmx_vsite_t> initVsite(const gmx_mtop_t& mtop, const t_commrec* cr)
+int countVsites(const gmx_mtop_t& mtop)
{
- GMX_RELEASE_ASSERT(cr != nullptr, "We need a valid commrec");
-
- std::unique_ptr<gmx_vsite_t> vsite;
-
- /* check if there are vsites */
int nvsite = 0;
for (int ftype = 0; ftype < F_NRE; ftype++)
{
"c_ftypeVsiteStart and/or c_ftypeVsiteEnd do not have correct values");
}
}
+ return nvsite;
+}
+
+std::unique_ptr<gmx_vsite_t> initVsite(const gmx_mtop_t& mtop, const t_commrec* cr)
+{
+ GMX_RELEASE_ASSERT(cr != nullptr, "We need a valid commrec");
+
+ std::unique_ptr<gmx_vsite_t> vsite;
+
+ /* check if there are vsites */
+ int nvsite = countVsites(mtop);
if (nvsite == 0)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,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
* top-level source directory and at http://www.gromacs.org.
int countInterUpdategroupVsites(const gmx_mtop_t& mtop,
gmx::ArrayRef<const gmx::RangePartitioning> updateGroupingPerMoleculetype);
+/*! \brief Return the number of virtual sites
+ *
+ * \note This is used to determine whether modular simulator can be used.
+ * This function can be made static once modular simulator supports
+ * virtual sites.
+ *
+ * \param[in] mtop The global topology
+ * \return The number of virtual sites found in the topology
+ */
+int countVsites(const gmx_mtop_t& mtop);
+
/* Initialize the virtual site struct,
*
* \param[in] mtop The global topology