}
void init_ekindata(FILE gmx_unused *log, const gmx_mtop_t *mtop, const t_grpopts *opts,
- gmx_ekindata_t *ekind)
+ gmx_ekindata_t *ekind, real cos_accel)
{
int i;
int nthread, thread;
ekind->ngacc = opts->ngacc;
ekind->grpstat.resize(opts->ngacc);
init_grpstat(mtop, opts->ngacc, ekind->grpstat.data());
+
+ ekind->cosacc.cos_accel = cos_accel;
}
void accumulate_u(const t_commrec *cr, const t_grpopts *opts, gmx_ekindata_t *ekind)
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
void init_ekindata(FILE *log, const gmx_mtop_t *mtop,
const t_grpopts *opts,
- gmx_ekindata_t *ekind);
+ gmx_ekindata_t *ekind,
+ real cos_accel);
/* Allocate memory and set the grpnr array. */
void done_ekindata(gmx_ekindata_t *ekind);
#include "gromacs/mdlib/stophandler.h"
class energyhistory_t;
+struct gmx_ekindata_t;
struct gmx_enerdata_t;
struct gmx_enfrot;
struct gmx_mtop_t;
gmx_wallcycle *wcycle,
t_forcerec *fr,
gmx_enerdata_t *enerd,
+ gmx_ekindata_t *ekind,
PpForceWorkload *ppForceWorkload,
const ReplicaExchangeParameters &replExParams,
gmx_membed_t *membed,
wcycle(wcycle),
fr(fr),
enerd(enerd),
+ ekind(ekind),
ppForceWorkload(ppForceWorkload),
replExParams(replExParams),
membed(membed),
t_forcerec *fr;
//! Data for energy output.
gmx_enerdata_t *enerd;
+ //! Kinetic energy data.
+ gmx_ekindata_t *ekind;
//! Schedule of force-calculation work each step for this task.
PpForceWorkload *ppForceWorkload;
//! Parameters for replica exchange algorihtms.
StartingBehavior::NewSimulation);
gmx::EnergyOutput energyOutput(mdoutf_get_fp_ene(outf), top_global, ir, pull_work, mdoutf_get_fp_dhdl(outf), false);
- /* Kinetic energy data */
- std::unique_ptr<gmx_ekindata_t> eKinData = std::make_unique<gmx_ekindata_t>();
- gmx_ekindata_t *ekind = eKinData.get();
- init_ekindata(fplog, top_global, &(ir->opts), ekind);
- /* Copy the cos acceleration to the groups struct */
- ekind->cosacc.cos_accel = ir->cos_accel;
-
gstat = global_stat_init(ir);
/* Check for polarizable models and flexible constraints */
StartingBehavior::NewSimulation);
gmx::EnergyOutput energyOutput(mdoutf_get_fp_ene(outf), top_global, ir, pull_work, mdoutf_get_fp_dhdl(outf), true);
- /* Kinetic energy data */
- std::unique_ptr<gmx_ekindata_t> eKinData = std::make_unique<gmx_ekindata_t>();
- gmx_ekindata_t *ekind = eKinData.get();
- init_ekindata(fplog, top_global, &(ir->opts), ekind);
- /* Copy the cos acceleration to the groups struct */
- ekind->cosacc.cos_accel = ir->cos_accel;
-
gstat = global_stat_init(ir);
/* Check for polarizable models and flexible constraints */
StartingBehavior::NewSimulation);
gmx::EnergyOutput energyOutput(mdoutf_get_fp_ene(outf), top_global, ir, pull_work, mdoutf_get_fp_dhdl(outf), true);
- /* Kinetic energy data */
- std::unique_ptr<gmx_ekindata_t> eKinData = std::make_unique<gmx_ekindata_t>();
- gmx_ekindata_t *ekind = eKinData.get();
- init_ekindata(fplog, top_global, &(ir->opts), ekind);
- /* Copy the cos acceleration to the groups struct */
- ekind->cosacc.cos_accel = ir->cos_accel;
-
gstat = global_stat_init(ir);
/* Check for polarizable models and flexible constraints */
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/mdtypes/enerdata.h"
#include "gromacs/mdtypes/fcdata.h"
+#include "gromacs/mdtypes/group.h"
#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/mdtypes/mdrunoptions.h"
/* Energy terms and groups */
gmx_enerdata_t enerd(mtop.groups.groups[SimulationAtomGroupType::EnergyOutput].size(), inputrec->fepvals->n_lambda);
+ /* Kinetic energy data */
+ gmx_ekindata_t ekind;
+ init_ekindata(fplog, &mtop, &(inputrec->opts), &ekind, inputrec->cos_accel);
+
/* Set up interactive MD (IMD) */
auto imdSession = makeImdSession(inputrec, cr, wcycle, &enerd, ms, &mtop, mdlog,
MASTER(cr) ? globalState->x.rvec_array() : nullptr,
&observablesHistory,
mdAtoms.get(), &nrnb, wcycle, fr,
&enerd,
+ &ekind,
&ppForceWorkload,
replExParams,
membed,