#include "gromacs/imd/imdsocket.h"
#include "gromacs/math/units.h"
#include "gromacs/math/vec.h"
+#include "gromacs/mdlib/broadcaststructs.h"
#include "gromacs/mdlib/groupcoord.h"
#include "gromacs/mdlib/mdrun.h"
#include "gromacs/mdlib/sighandler.h"
#include "gromacs/mdlib/sim_util.h"
#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/state.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/timing/wallcycle.h"
#include "gromacs/topology/mtop_util.h"
/*! \brief IMD Protocol Version. */
#define IMDVERSION 2
-/*! \brief Broadcast d to all nodes */
-#define block_bc(cr, d) gmx_bcast(sizeof(d), &(d), (cr))
-
-/*! \brief Broadcast nr elements of d to all nodes */
-#define nblock_bc(cr, nr, d) gmx_bcast((nr)*sizeof((d)[0]), (d), (cr))
-
/*! \internal
* \brief
"IMD_PAUSE",
"IMD_TRATE",
"IMD_IOERROR",
- NULL
+ nullptr
};
{
IMDatoms = gmx_mtop_global_atoms(sys);
write_sto_conf_indexed(opt2fn("-imd", nfile, fnm), "IMDgroup", &IMDatoms,
- state->x, state->v, ir->ePBC, state->box, ir->imd->nat, ir->imd->ind);
+ as_rvec_array(state->x.data()), as_rvec_array(state->v.data()), ir->ePBC, state->box, ir->imd->nat, ir->imd->ind);
}
}
/*! \brief Initializes the IMD private data. */
static t_gmx_IMD_setup* imd_create(int imdatoms, int nstimddef, int imdport)
{
- t_gmx_IMD_setup *IMDsetup = NULL;
+ t_gmx_IMD_setup *IMDsetup = nullptr;
snew(IMDsetup, 1);
/* then we reset the IMD step to its default, and reset the connection boolean */
IMDsetup->nstimd_new = IMDsetup->nstimd_def;
- IMDsetup->clientsocket = NULL;
+ IMDsetup->clientsocket = nullptr;
IMDsetup->bConnected = FALSE;
}
fprintf(stdout, "%s For a log of the IMD pull forces explicitly specify '-if' on the command line.\n"
"%s (Not possible with energy minimization.)\n", IMDstr, IMDstr);
- return NULL;
+ return nullptr;
}
#endif
rvec x[],
t_inputrec *ir,
double t,
- gmx_wallcycle_t wcycle)
+ gmx_wallcycle *wcycle)
{
gmx_bool imdstep = FALSE;
t_gmx_IMD_setup *IMDsetup;
void IMD_prep_energies_send_positions(gmx_bool bIMD, gmx_bool bIMDstep,
t_IMD *imd, gmx_enerdata_t *enerd,
gmx_int64_t step, gmx_bool bHaveNewEnergies,
- gmx_wallcycle_t wcycle)
+ gmx_wallcycle *wcycle)
{
if (bIMD)
{
return IMDsetup->nstimd;
}
+
void IMD_apply_forces(gmx_bool bIMD, t_IMD *imd, t_commrec *cr, rvec *f,
- gmx_wallcycle_t wcycle)
+ gmx_wallcycle *wcycle)
{
int i, j;
int locndx;