#include "gromacs/math/vectypes.h"
#include "gromacs/mdtypes/pull-params.h"
-#include "gromacs/pulling/pull_internal.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/real.h"
struct ContinuationOptions;
struct gmx_mtop_t;
struct gmx_output_env_t;
+struct pull_coord_work_t;
struct pull_params_t;
struct t_commrec;
struct t_filenm;
namespace gmx
{
class ForceWithVirial;
+class LocalAtomSetManager;
}
/*! \brief Returns if the pull coordinate is an angle
*
* \returns The pull potential energy.
*/
-real pull_potential(struct pull_t *pull, t_mdatoms *md, struct t_pbc *pbc,
- t_commrec *cr, double t, real lambda,
- rvec *x, gmx::ForceWithVirial *force, real *dvdlambda);
+real pull_potential(struct pull_t *pull, const t_mdatoms *md, struct t_pbc *pbc,
+ const t_commrec *cr, double t, real lambda,
+ const rvec *x, gmx::ForceWithVirial *force, real *dvdlambda);
/*! \brief Constrain the coordinates xp in the directions in x
* \param[in,out] v Velocities, which may get a pull correction.
* \param[in,out] vir The virial, which, if != NULL, gets a pull correction.
*/
-void pull_constraint(struct pull_t *pull, t_mdatoms *md, struct t_pbc *pbc,
- t_commrec *cr, double dt, double t,
+void pull_constraint(struct pull_t *pull, const t_mdatoms *md, struct t_pbc *pbc,
+ const t_commrec *cr, double dt, double t,
rvec *x, rvec *xp, rvec *v, tensor vir);
*
* \param cr Structure for communication info.
* \param pull The pull group.
- * \param md All atoms.
*/
-void dd_make_local_pull_groups(t_commrec *cr,
- struct pull_t *pull, t_mdatoms *md);
+void dd_make_local_pull_groups(const t_commrec *cr, struct pull_t *pull);
/*! \brief Allocate, initialize and return a pull work struct.
* \param fplog General output file, normally md.log.
* \param pull_params The pull input parameters containing all pull settings.
* \param ir The inputrec.
- * \param nfile Number of files.
- * \param fnm Standard filename struct.
* \param mtop The topology of the whole system.
* \param cr Struct for communication info.
- * \param oenv Output options.
+ * \param atomSets The manager that handles the pull atom sets
* \param lambda FEP lambda.
- * \param bOutFile Open output files?
- * \param continuationOptions Options for continuing from checkpoint file
*/
struct pull_t *init_pull(FILE *fplog,
const pull_params_t *pull_params,
const t_inputrec *ir,
- int nfile,
- const t_filenm fnm[],
const gmx_mtop_t *mtop,
- t_commrec * cr,
- const gmx_output_env_t *oenv,
- real lambda,
- gmx_bool bOutFile,
- const ContinuationOptions &continuationOptions);
+ const t_commrec *cr,
+ gmx::LocalAtomSetManager *atomSets,
+ real lambda);
+/*! \brief Set up and open the pull output files, when requested.
+ *
+ * NOTE: This should only be called on the master rank and only when
+ * doing dynamics (e.g. not with energy minimization).
+ *
+ * \param pull The pull work data struct
+ * \param nfile Number of files.
+ * \param fnm Standard filename struct.
+ * \param oenv Output options.
+ * \param continuationOptions Options for continuing from checkpoint file
+ */
+void init_pull_output_files(pull_t *pull,
+ int nfile,
+ const t_filenm fnm[],
+ const gmx_output_env_t *oenv,
+ const ContinuationOptions &continuationOptions);
/*! \brief Close the pull output files.
*
* \param step Time step number.
* \param time Time.
*/
-void pull_print_output(struct pull_t *pull, gmx_int64_t step, double time);
+void pull_print_output(struct pull_t *pull, int64_t step, double time);
/*! \brief Calculates centers of mass all pull groups.
* \param[in,out] xp Updated x, can be NULL.
*
*/
-void pull_calc_coms(t_commrec *cr,
- struct pull_t *pull,
- t_mdatoms *md,
- struct t_pbc *pbc,
- double t,
- rvec x[],
- rvec *xp);
+void pull_calc_coms(const t_commrec *cr,
+ pull_t *pull,
+ const t_mdatoms *md,
+ t_pbc *pbc,
+ double t,
+ const rvec x[],
+ rvec *xp);
/*! \brief Margin for checking PBC distances compared to half the box size in pullCheckPbcWithinGroups() */
static constexpr real c_pullGroupPbcMargin = 0.9;