/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011, by the GROMACS development team, led by
- * David van der Spoel, Berk Hess, Erik Lindahl, and including many
- * others, as listed in the AUTHORS file in the top-level source
- * directory and at http://www.gromacs.org.
+ * Copyright (c) 2009,2010,2011,2013,2014, 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.
*
* GROMACS is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* To help us fund GROMACS development, we humbly ask that you cite
* the research papers on the package. Check out http://www.gromacs.org.
*/
-/*! \file
+/*! \internal \file
* \brief API for calculation of centers of mass/geometry.
*
* This header defines a few functions that can be used to calculate
#ifndef GMX_SELECTION_CENTEROFMASS_H
#define GMX_SELECTION_CENTEROFMASS_H
-#include "../legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vectypes.h"
-/** Calculate a single center of geometry. */
+struct t_block;
+struct t_blocka;
+struct t_pbc;
+struct t_topology;
+
+/*! \brief
+ * Calculate a single center of geometry.
+ *
+ * \param[in] top Topology structure (unused, can be NULL).
+ * \param[in] x Position vectors of all atoms.
+ * \param[in] nrefat Number of atoms in the index.
+ * \param[in] index Indices of atoms.
+ * \param[out] xout COG position for the indexed atoms.
+ * \returns 0 on success.
+ */
int
gmx_calc_cog(t_topology *top, rvec x[], int nrefat, atom_id index[], rvec xout);
/** Calculate a single center of mass. */
/** Calculate force on a single center of geometry. */
int
gmx_calc_cog_f(t_topology *top, rvec f[], int nrefat, atom_id index[], rvec fout);
+/*! \brief
+ * Calculate force on a single center of mass.
+ *
+ * \param[in] top Topology structure (unused, can be NULL).
+ * \param[in] f Forces on all atoms.
+ * \param[in] nrefat Number of atoms in the index.
+ * \param[in] index Indices of atoms.
+ * \param[out] fout Force on the COM position for the indexed atoms.
+ * \returns 0 on success.
+ */
+int
+gmx_calc_com_f(t_topology *top, rvec f[], int nrefat, atom_id index[], rvec fout);
/** Calculate a single center of mass/geometry. */
int
gmx_calc_comg(t_topology *top, rvec x[], int nrefat, atom_id index[],
gmx_calc_comg_pbc(t_topology *top, rvec x[], t_pbc *pbc,
int nrefat, atom_id index[], bool bMass, rvec xout);
-/** Calculate centers of geometry for a blocked index. */
+/*! \brief
+ * Calculate centers of geometry for a blocked index.
+ *
+ * \param[in] top Topology structure (unused, can be NULL).
+ * \param[in] x Position vectors of all atoms.
+ * \param[in] block t_block structure that divides \p index into blocks.
+ * \param[in] index Indices of atoms.
+ * \param[out] xout \p block->nr COG positions.
+ * \returns 0 on success.
+ */
int
gmx_calc_cog_block(t_topology *top, rvec x[], t_block *block,
atom_id index[], rvec xout[]);
int
gmx_calc_cog_f_block(t_topology *top, rvec f[], t_block *block,
atom_id index[], rvec fout[]);
+/*! \brief
+ * Calculate forces on centers of mass for a blocked index.
+ *
+ * \param[in] top Topology structure (unused, can be NULL).
+ * \param[in] f Forces on all atoms.
+ * \param[in] block t_block structure that divides \p index into blocks.
+ * \param[in] index Indices of atoms.
+ * \param[out] fout \p block->nr Forces on COM positions.
+ * \returns 0 on success.
+ */
+int
+gmx_calc_com_f_block(t_topology *top, rvec f[], t_block *block,
+ atom_id index[], rvec fout[]);
/** Calculate centers of mass/geometry for a blocked index. */
int
gmx_calc_comg_block(t_topology *top, rvec x[], t_block *block,