}
dd_bcast(dd, NITEM_DD_INIT_LOCAL_STATE*sizeof(int), buf);
- init_state(state_local, 0, buf[1], buf[2], buf[3], buf[4]);
+ init_gtc_state(state_local, buf[1], buf[2], buf[3]);
+ init_dfhist_state(state_local, buf[4]);
state_local->flags = buf[0];
}
#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/mdtypes/state.h"
#include "gromacs/trajectory/trajectoryframe.h"
+#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/baseversion.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
xdr_datatype_names[xdrTypeInTheCode],
xdr_datatype_names[xdrTypeInTheFile]);
- /* Matchting int and real should never occur, but check anyhow */
+ /* Matching int and real should never occur, but check anyhow */
if (xdrTypeInTheFile == xdr_datatype_int ||
xdrTypeInTheCode == xdr_datatype_int)
{
/* This conditional ensures that we don't resize on write.
* In particular in the state where this code was written
* PaddedRVecVector has a size of numElemInThefile and we
- * don't want to loose that padding here.
+ * don't want to lose that padding here.
*/
if (vector->size() < static_cast<unsigned int>(numElemInTheFile))
{
return 0;
}
-//! \brief Read/Write an std::vector
+//! \brief Read/Write a std::vector.
template <typename T>
static int doVector(XDR *xd, StatePart part, int ecpt, int sflags,
std::vector<T> *vector, FILE *list)
return doVectorLow<T>(xd, part, ecpt, sflags, -1, nullptr, nullptr, vector, list, CptElementType::real);
}
-//! \brief Read/Write an std::vector, on read checks the number of elements matches \p numElements
-template <typename T>
-static int doVector(XDR *xd, StatePart part, int ecpt, int sflags,
- int numElements, std::vector<T> *vector, FILE *list)
+//! \brief Read/Write an ArrayRef<real>.
+static int doRealArrayRef(XDR *xd, StatePart part, int ecpt, int sflags,
+ gmx::ArrayRef<real> vector, FILE *list)
{
- return doVectorLow<T>(xd, part, ecpt, sflags, numElements, nullptr, nullptr, vector, list, CptElementType::real);
+ real *v_real = vector.data();
+ return doVectorLow<real>(xd, part, ecpt, sflags, vector.size(), nullptr, &v_real, nullptr, list, CptElementType::real);
}
-//! \brief Read/Write a PaddedRVecVector, on read checks the number of elements matches \p numElements
-static int doPaddedVector(XDR *xd, StatePart part, int ecpt, int sflags,
- int numElements, PaddedRVecVector *v, FILE *list)
+//! \brief Read/Write a PaddedRVecVector.
+static int doPaddedRvecVector(XDR *xd, StatePart part, int ecpt, int sflags,
+ gmx::PaddedRVecVector *vector, FILE *list)
{
- rvec *v_rvec;
+ real *v_real;
if (list == nullptr && (sflags & (1 << ecpt)))
{
- /* We resize the vector here to avoid pointer reallocation in
- * do_cpte_reals_low. Note the we allocate 1 element extra for SIMD.
- */
- v->resize(numElements + 1);
- v_rvec = as_rvec_array(v->data());
+ v_real = vector->data()->as_vec();
}
else
{
- v_rvec = nullptr;
+ v_real = nullptr;
}
+ // The current invariant of a PaddedRVecVector is that its size is
+ // one larger than necessary to store the data. Make sure that we
+ // read/write only the valid data, and don't leak to the outside
+ // world that currently we find it convenient internally to
+ // allocate one extra element.
+ gmx::ArrayRef<real> ref(v_real, v_real + (vector->size()-1) * DIM);
- return doVectorLow<real>(xd, part, ecpt, sflags,
- numElements*DIM, nullptr, (real **)(&v_rvec), nullptr,
- list, CptElementType::real3);
+ return doRealArrayRef(xd, part, ecpt, sflags, ref, list);
}
/* This function stores n along with the reals for reading,
FILE *list)
{
int ret = 0;
-
- const int nnht = state->nhchainlength*state->ngtc;
- const int nnhtp = state->nhchainlength*state->nnhpres;
-
const StatePart part = StatePart::microState;
const int sflags = state->flags;
+ // If reading, state->natoms was probably just read, so
+ // allocations need to be managed. If writing, this won't change
+ // anything that matters.
+ state_change_natoms(state, state->natoms);
for (int i = 0; (i < estNR && ret == 0); i++)
{
if (fflags & (1<<i))
{
switch (i)
{
- case estLAMBDA: ret = doVector<real>(xd, part, i, sflags, static_cast<int>(efptNR), &state->lambda, list); break;
+ case estLAMBDA: ret = doRealArrayRef(xd, part, i, sflags, gmx::arrayRefFromArray<real>(state->lambda.data(), state->lambda.size()), list); break;
case estFEPSTATE: ret = do_cpte_int (xd, part, i, sflags, &state->fep_state, list); break;
case estBOX: ret = do_cpte_matrix(xd, part, i, sflags, state->box, list); break;
case estBOX_REL: ret = do_cpte_matrix(xd, part, i, sflags, state->box_rel, list); break;
case estPRES_PREV: ret = do_cpte_matrix(xd, part, i, sflags, state->pres_prev, list); break;
case estSVIR_PREV: ret = do_cpte_matrix(xd, part, i, sflags, state->svir_prev, list); break;
case estFVIR_PREV: ret = do_cpte_matrix(xd, part, i, sflags, state->fvir_prev, list); break;
- case estNH_XI: ret = doVector<double>(xd, part, i, sflags, nnht, &state->nosehoover_xi, list); break;
- case estNH_VXI: ret = doVector<double>(xd, part, i, sflags, nnht, &state->nosehoover_vxi, list); break;
- case estNHPRES_XI: ret = doVector<double>(xd, part, i, sflags, nnhtp, &state->nhpres_xi, list); break;
- case estNHPRES_VXI: ret = doVector<double>(xd, part, i, sflags, nnhtp, &state->nhpres_vxi, list); break;
- case estTC_INT: ret = doVector<double>(xd, part, i, sflags, state->ngtc, &state->therm_integral, list); break;
+ case estNH_XI: ret = doVector<double>(xd, part, i, sflags, &state->nosehoover_xi, list); break;
+ case estNH_VXI: ret = doVector<double>(xd, part, i, sflags, &state->nosehoover_vxi, list); break;
+ case estNHPRES_XI: ret = doVector<double>(xd, part, i, sflags, &state->nhpres_xi, list); break;
+ case estNHPRES_VXI: ret = doVector<double>(xd, part, i, sflags, &state->nhpres_vxi, list); break;
+ case estTC_INT: ret = doVector<double>(xd, part, i, sflags, &state->therm_integral, list); break;
case estVETA: ret = do_cpte_real(xd, part, i, sflags, &state->veta, list); break;
case estVOL0: ret = do_cpte_real(xd, part, i, sflags, &state->vol0, list); break;
- case estX: ret = doPaddedVector(xd, part, i, sflags, state->natoms, &state->x, list); break;
- case estV: ret = doPaddedVector(xd, part, i, sflags, state->natoms, &state->v, list); break;
+ case estX: ret = doPaddedRvecVector(xd, part, i, sflags, &state->x, list); break;
+ case estV: ret = doPaddedRvecVector(xd, part, i, sflags, &state->v, list); break;
/* The RNG entries are no longer written,
* the next 4 lines are only for reading old files.
*/
case eeksEKINF: ret = do_cpte_matrices(xd, part, i, fflags, ekins->ekin_n, &ekins->ekinf, list); break;
case eeksEKINO: ret = do_cpte_matrices(xd, part, i, fflags, ekins->ekin_n, &ekins->ekinh_old, list); break;
case eeksEKINTOTAL: ret = do_cpte_matrix(xd, part, i, fflags, ekins->ekin_total, list); break;
- case eeksEKINSCALEF: ret = doVector<double>(xd, part, i, fflags, ekins->ekin_n, &ekins->ekinscalef_nhc, list); break;
- case eeksVSCALE: ret = doVector<double>(xd, part, i, fflags, ekins->ekin_n, &ekins->vscale_nhc, list); break;
- case eeksEKINSCALEH: ret = doVector<double>(xd, part, i, fflags, ekins->ekin_n, &ekins->ekinscaleh_nhc, list); break;
+ case eeksEKINSCALEF: ret = doVector<double>(xd, part, i, fflags, &ekins->ekinscalef_nhc, list); break;
+ case eeksVSCALE: ret = doVector<double>(xd, part, i, fflags, &ekins->vscale_nhc, list); break;
+ case eeksEKINSCALEH: ret = doVector<double>(xd, part, i, fflags, &ekins->ekinscaleh_nhc, list); break;
case eeksDEKINDL: ret = do_cpte_real(xd, part, i, fflags, &ekins->dekindl, list); break;
case eeksMVCOS: ret = do_cpte_real(xd, part, i, fflags, &ekins->mvcos, list); break;
default:
switch (i)
{
case eenhENERGY_N: ret = do_cpte_int(xd, part, i, fflags, &energyHistoryNumEnergies, list); break;
- case eenhENERGY_AVER: ret = doVector<double>(xd, part, i, fflags, energyHistoryNumEnergies, &enerhist->ener_ave, list); break;
- case eenhENERGY_SUM: ret = doVector<double>(xd, part, i, fflags, energyHistoryNumEnergies, &enerhist->ener_sum, list); break;
+ case eenhENERGY_AVER: ret = doVector<double>(xd, part, i, fflags, &enerhist->ener_ave, list); break;
+ case eenhENERGY_SUM: ret = doVector<double>(xd, part, i, fflags, &enerhist->ener_sum, list); break;
case eenhENERGY_NSUM: do_cpt_step_err(xd, eenh_names[i], &enerhist->nsum, list); break;
- case eenhENERGY_SUM_SIM: ret = doVector<double>(xd, part, i, fflags, energyHistoryNumEnergies, &enerhist->ener_sum_sim, list); break;
+ case eenhENERGY_SUM_SIM: ret = doVector<double>(xd, part, i, fflags, &enerhist->ener_sum_sim, list); break;
case eenhENERGY_NSUM_SIM: do_cpt_step_err(xd, eenh_names[i], &enerhist->nsum_sim, list); break;
case eenhENERGY_NSTEPS: do_cpt_step_err(xd, eenh_names[i], &enerhist->nsteps, list); break;
case eenhENERGY_NSTEPS_SIM: do_cpt_step_err(xd, eenh_names[i], &enerhist->nsteps_sim, list); break;
void read_checkpoint_trxframe(t_fileio *fp, t_trxframe *fr)
{
- /* This next line is nasty because the sub-structures of t_state
- * cannot be assumed to be zeroed (or even initialized in ways the
- * rest of the code might assume). Using snew would be better, but
- * this will all go away for 5.0. */
t_state state;
int simulation_part;
gmx_int64_t step;
double t;
- init_state(&state, 0, 0, 0, 0, 0);
-
read_checkpoint_data(fp, &simulation_part, &step, &t, &state, nullptr, nullptr);
fr->natoms = state.natoms;
gmx_file_position_t *outputfiles;
int nfiles;
- t_state state = {};
- init_state(&state, 0, 0, 0, 0, 0);
+ t_state state;
fp = gmx_fio_open(fn, "r");
do_cpt_header(gmx_fio_getxdr(fp), TRUE, &file_version,
double t;
t_state state;
- init_state(&state, 0, 0, 0, 0, 0);
-
read_checkpoint_data(fp, simulation_part, &step, &t, &state,
nfiles, outputfiles);
if (gmx_fio_close(fp) != 0)
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, 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.
struct t_commrec;
struct t_fileio;
struct t_inputrec;
-struct t_state;
+class t_state;
struct t_trxframe;
/* the name of the environment variable to disable fsync failure checks with */
if (!bRead)
{
+ GMX_RELEASE_ASSERT(state != nullptr, "Cannot write a null state");
GMX_RELEASE_ASSERT(x == nullptr && v == nullptr, "Passing separate x and v pointers to do_tpx() is not supported when writing");
tpx.natoms = state->natoms;
if (bRead)
{
- state->flags = 0;
- if (x != nullptr)
+ state->flags = 0;
+ init_gtc_state(state, tpx.ngtc, 0, 0);
+ if (x == nullptr)
{
- init_state(state, 0, tpx.ngtc, 0, 0, 0);
- }
- else
- {
- init_state(state, tpx.natoms, tpx.ngtc, 0, 0, 0);
+ state_change_natoms(state, tpx.natoms);
}
}
rvec *x, rvec *v, gmx_mtop_t *mtop)
{
t_fileio *fio;
- t_state state {};
+ t_state state;
int ePBC;
fio = open_tpx(fn, "r");
rvec *x = nullptr;
rvec *v = nullptr;
snew(conftop, 1);
- init_state(state, 0, 0, 0, 0, 0);
read_tps_conf(confin, conftop, nullptr, &x, &v, state->box, FALSE);
state->natoms = conftop->atoms.nr;
if (state->natoms != sys->natoms)
gmx_fatal(FARGS, "%s does not exist", fn);
}
- t_state state {};
+ t_state state;
new_status(fn, opt2fn_null("-pp", NFILE, fnm), opt2fn("-c", NFILE, fnm),
opts, ir, bZero, bGenVel, bVerbose, &state,
atype, sys, &nmi, &mi, &intermolecular_interactions,
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017, 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.
struct t_gmx_IMD;
struct t_IMD;
struct t_inputrec;
-struct t_state;
+class t_state;
static const char IMDstr[] = "IMD:"; /**< Tag output from the IMD module with this string. */
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, 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.
#include "gromacs/utility/basedefinitions.h"
struct gmx_mtop_t;
-struct history_t;
+class history_t;
struct t_commrec;
struct t_inputrec;
struct t_pbc;
-struct t_state;
+class t_state;
/*! \brief
* Initiates *fcd data.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017, 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.
struct gmx_enerdata_t;
struct gmx_grppairener_t;
-struct history_t;
+class history_t;
struct t_commrec;
struct t_fcdata;
struct t_forcerec;
struct t_lambda;
struct t_mdatoms;
struct t_nrnb;
-struct t_state;
+class t_state;
#ifdef __cplusplus
extern "C" {
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2017, 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.
struct gmx_mtop_t;
struct gmx_multisim_t;
-struct history_t;
+class history_t;
struct t_inputrec;
struct t_pbc;
struct t_commrec;
struct t_fcdata;
struct t_oriresdata;
-struct t_state;
+class t_state;
/*! \brief
* Decides whether orientation restraints can work, and initializes
block_bc(cr, state->nnhpres);
block_bc(cr, state->nhchainlength);
block_bc(cr, state->flags);
- state->lambda.resize(efptNR);
if (cr->dd)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, 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.
#endif
struct t_pbc;
-struct t_state;
+class t_state;
enum
{
}
}
-void sum_dhdl(gmx_enerdata_t *enerd, const std::vector<real> *lambda, t_lambda *fepvals)
+void sum_dhdl(gmx_enerdata_t *enerd, gmx::ConstArrayRef<real> lambda, t_lambda *fepvals)
{
- int i, j, index;
+ int index;
double dlam;
enerd->dvdl_lin[efptVDW] += enerd->term[F_DVDL_VDW]; /* include dispersion correction */
enerd->term[F_DVDL] = 0.0;
- for (i = 0; i < efptNR; i++)
+ for (int i = 0; i < efptNR; i++)
{
if (fepvals->separate_dvdl[i])
{
}
enerd->term[F_DVDL_CONSTR] = 0;
- for (i = 0; i < fepvals->n_lambda; i++)
+ for (int i = 0; i < fepvals->n_lambda; i++)
{
/* note we are iterating over fepvals here!
For the current lam, dlam = 0 automatically,
current lambda, because the contributions to the current
lambda are automatically zeroed */
- for (j = 0; j < efptNR; j++)
+ for (size_t j = 0; j < lambda.size(); j++)
{
/* Note that this loop is over all dhdl components, not just the separated ones */
- dlam = (fepvals->all_lambda[j][i] - (*lambda)[j]);
+ dlam = (fepvals->all_lambda[j][i] - lambda[j]);
enerd->enerpart_lambda[i+1] += dlam*enerd->dvdl_lin[j];
if (debug)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, 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.
#include "gromacs/mdtypes/forcerec.h"
#include "gromacs/mdtypes/state.h"
#include "gromacs/timing/wallcycle.h"
+#include "gromacs/utility/arrayref.h"
struct gmx_edsam;
struct gmx_gpu_info_t;
struct gmx_groups_t;
struct gmx_vsite_t;
-struct history_t;
+class history_t;
struct nonbonded_verlet_t;
struct t_blocka;
struct t_commrec;
void sum_epot(gmx_grppairener_t *grpp, real *epot);
/* Locally sum the non-bonded potential energy terms */
-void sum_dhdl(gmx_enerdata_t *enerd, const std::vector<real> *lambda, t_lambda *fepvals);
+void sum_dhdl(gmx_enerdata_t *enerd, gmx::ConstArrayRef<real> lambda, t_lambda *fepvals);
/* Sum the free energy contributions */
/* Compute the average C6 and C12 params for LJ corrections */
tensor vir_force,
t_mdatoms *mdatoms,
gmx_enerdata_t *enerd, t_fcdata *fcd,
- std::vector<real> *lambda, struct t_graph *graph,
+ gmx::ArrayRef<real> lambda, t_graph *graph,
t_forcerec *fr,
gmx_vsite_t *vsite, rvec mu_tot,
double t, struct gmx_edsam *ed,
state->flags |= (1<<estFEPSTATE);
}
state->flags |= (1<<estX);
- state->lambda.resize(efptNR);
GMX_RELEASE_ASSERT(state->x.size() >= static_cast<unsigned int>(state->natoms), "We should start a run with an initialized state->x");
if (EI_DYNAMICS(ir->eI))
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, 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.
struct t_grpopts;
struct t_lambda;
struct t_nrnb;
-struct t_state;
+class t_state;
struct t_trxframe;
namespace gmx
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, 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.
struct t_lambda;
struct t_mdatoms;
struct t_simtemp;
-struct t_state;
+class t_state;
#define MD_POLARISE (1<<2)
#define MD_RERUN (1<<4)
state_global->ngtc = 0;
/* Initialize lambda variables */
- initialize_lambdas(fplog, ir, &(state_global->fep_state), &state_global->lambda, nullptr);
+ initialize_lambdas(fplog, ir, &(state_global->fep_state), state_global->lambda, nullptr);
init_nrnb(nrnb);
count, nrnb, wcycle, top, &top_global->groups,
ems->s.box, &ems->s.x, &ems->s.hist,
&ems->f, force_vir, mdatoms, enerd, fcd,
- &ems->s.lambda, graph, fr, vsite, mu_tot, t, nullptr, TRUE,
+ ems->s.lambda, graph, fr, vsite, mu_tot, t, nullptr, TRUE,
GMX_FORCE_STATECHANGED | GMX_FORCE_ALLFORCES |
GMX_FORCE_VIRIAL | GMX_FORCE_ENERGY |
(bNS ? GMX_FORCE_NS : 0));
enerd->term[F_PRES] =
calc_pres(fr->ePBC, inputrec->nwall, ems->s.box, ekin, vir, pres);
- sum_dhdl(enerd, &ems->s.lambda, inputrec->fepvals);
+ sum_dhdl(enerd, ems->s.lambda, inputrec->fepvals);
if (EI_ENERGY_MINIMIZATION(inputrec->eI))
{
rvec *x_old, rvec *x_init, rvec *x,
rvec *f, rvec *acc_dir,
gmx_bool bMolPBC, matrix box,
- const std::vector<real> *lambda, real *dvdlambda,
+ gmx::ConstArrayRef<real> lambda, real *dvdlambda,
t_nrnb *nrnb)
{
rvec *xnold, *xnew;
}
constrain(log, FALSE, FALSE, constr, idef, ir, cr, step, 0, 1.0, md,
x, xnold, nullptr, bMolPBC, box,
- (*lambda)[efptBONDED], &(dvdlambda[efptBONDED]),
+ lambda[efptBONDED], &(dvdlambda[efptBONDED]),
nullptr, nullptr, nrnb, econqCoord);
constrain(log, FALSE, FALSE, constr, idef, ir, cr, step, 0, 1.0, md,
x, xnew, nullptr, bMolPBC, box,
- (*lambda)[efptBONDED], &(dvdlambda[efptBONDED]),
+ lambda[efptBONDED], &(dvdlambda[efptBONDED]),
nullptr, nullptr, nrnb, econqCoord);
for (n = 0; n < end; n++)
/* Project the acceleration on the old bond directions */
constrain(log, FALSE, FALSE, constr, idef, ir, cr, step, 0, 1.0, md,
x_old, xnew, acc_dir, bMolPBC, box,
- (*lambda)[efptBONDED], &(dvdlambda[efptBONDED]),
+ lambda[efptBONDED], &(dvdlambda[efptBONDED]),
nullptr, nullptr, nrnb, econqDeriv_FlexCon);
}
do_force(fplog, cr, inputrec, mdstep, nrnb, wcycle, top, groups,
state->box, &state->x, &state->hist,
force[Min], force_vir, md, enerd, fcd,
- &state->lambda, graph,
+ state->lambda, graph,
fr, vsite, mu_tot, t, nullptr, bBornRadii,
(bDoNS ? GMX_FORCE_NS : 0) | force_flags);
constr, idef, inputrec, cr, dd_ac1, mdstep, md, end,
shfc->x_old, as_rvec_array(state->x.data()), as_rvec_array(state->x.data()), as_rvec_array(force[Min]->data()),
shfc->acc_dir,
- fr->bMolPBC, state->box, &state->lambda, &dum, nrnb);
+ fr->bMolPBC, state->box, state->lambda, &dum, nrnb);
for (i = 0; i < end; i++)
{
init_adir(fplog, shfc,
constr, idef, inputrec, cr, dd_ac1, mdstep, md, end,
x_old, as_rvec_array(state->x.data()), as_rvec_array(pos[Min]->data()), as_rvec_array(force[Min]->data()), acc_dir,
- fr->bMolPBC, state->box, &state->lambda, &dum, nrnb);
+ fr->bMolPBC, state->box, state->lambda, &dum, nrnb);
directional_sd(pos[Min], pos[Try], acc_dir, end, fr->fc_stepsize);
}
do_force(fplog, cr, inputrec, 1, nrnb, wcycle,
top, groups, state->box, pos[Try], &state->hist,
force[Try], force_vir,
- md, enerd, fcd, &state->lambda, graph,
+ md, enerd, fcd, state->lambda, graph,
fr, vsite, mu_tot, t, nullptr, bBornRadii,
force_flags);
init_adir(fplog, shfc,
constr, idef, inputrec, cr, dd_ac1, mdstep, md, end,
x_old, as_rvec_array(state->x.data()), as_rvec_array(pos[Try]->data()), as_rvec_array(force[Try]->data()), acc_dir,
- fr->bMolPBC, state->box, &state->lambda, &dum, nrnb);
+ fr->bMolPBC, state->box, state->lambda, &dum, nrnb);
for (i = 0; i < end; i++)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, 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.
struct t_fcdata;
struct t_graph;
struct t_inputrec;
-struct t_state;
+class t_state;
/* Initialization function, also predicts the initial shell postions.
*/
#include "gromacs/timing/wallcycle.h"
#include "gromacs/timing/wallcyclereporting.h"
#include "gromacs/timing/walltime_accounting.h"
+#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/exceptions.h"
tensor vir_force,
t_mdatoms *mdatoms,
gmx_enerdata_t *enerd, t_fcdata *fcd,
- std::vector<real> *lambda, t_graph *graph,
+ gmx::ArrayRef<real> lambda, t_graph *graph,
t_forcerec *fr,
gmx_vsite_t *vsite, rvec mu_tot,
double t, gmx_edsam_t ed,
force, vir_force,
mdatoms,
enerd, fcd,
- lambda->data(), graph,
+ lambda.data(), graph,
fr, fr->ic,
vsite, mu_tot,
t, ed,
force, vir_force,
mdatoms,
enerd, fcd,
- lambda->data(), graph,
+ lambda.data(), graph,
fr, vsite, mu_tot,
t, ed,
bBornRadii,
}
}
-extern void initialize_lambdas(FILE *fplog, t_inputrec *ir, int *fep_state, std::vector<real> *lambda, double *lam0)
+extern void initialize_lambdas(FILE *fplog, t_inputrec *ir, int *fep_state, gmx::ArrayRef<real> lambda, double *lam0)
{
/* this function works, but could probably use a logic rewrite to keep all the different
types of efep straight. */
if checkpoint is set -- a kludge is in for now
to prevent this.*/
- lambda->resize(efptNR);
-
for (int i = 0; i < efptNR; i++)
{
/* overwrite lambda state with init_lambda for now for backwards compatibility */
if (fep->init_lambda >= 0) /* if it's -1, it was never initializd */
{
- (*lambda)[i] = fep->init_lambda;
+ lambda[i] = fep->init_lambda;
if (lam0)
{
- lam0[i] = (*lambda)[i];
+ lam0[i] = lambda[i];
}
}
else
{
- (*lambda)[i] = fep->all_lambda[i][*fep_state];
+ lambda[i] = fep->all_lambda[i][*fep_state];
if (lam0)
{
- lam0[i] = (*lambda)[i];
+ lam0[i] = lambda[i];
}
}
}
if (fplog != nullptr)
{
fprintf(fplog, "Initial vector of lambda components:[ ");
- for (int i = 0; i < efptNR; i++)
+ for (const auto &l : lambda)
{
- fprintf(fplog, "%10.4f ", (*lambda)[i]);
+ fprintf(fplog, "%10.4f ", l);
}
fprintf(fplog, "]\n");
}
void init_md(FILE *fplog,
t_commrec *cr, t_inputrec *ir, const gmx_output_env_t *oenv,
double *t, double *t0,
- std::vector<real> *lambda, int *fep_state, double *lam0,
+ gmx::ArrayRef<real> lambda, int *fep_state, double *lam0,
t_nrnb *nrnb, gmx_mtop_t *mtop,
gmx_update_t **upd,
int nfile, const t_filenm fnm[],
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, 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.
#include "gromacs/mdlib/vcm.h"
#include "gromacs/timing/wallcycle.h"
#include "gromacs/timing/walltime_accounting.h"
+#include "gromacs/utility/arrayref.h"
struct gmx_constr;
struct gmx_localtop_t;
matrix box, real lambda, tensor pres, tensor virial,
real *prescorr, real *enercorr, real *dvdlcorr);
-void initialize_lambdas(FILE *fplog, t_inputrec *ir, int *fep_state, std::vector<real> *lambda, double *lam0);
+void initialize_lambdas(FILE *fplog, t_inputrec *ir, int *fep_state, gmx::ArrayRef<real> lambda, double *lam0);
void do_constrain_first(FILE *log, gmx_constr *constr,
t_inputrec *inputrec, t_mdatoms *md,
void init_md(FILE *fplog,
t_commrec *cr, t_inputrec *ir, const gmx_output_env_t *oenv,
double *t, double *t0,
- std::vector<real> *lambda, int *fep_state, double *lam0,
+ gmx::ArrayRef<real> lambda, int *fep_state, double *lam0,
t_nrnb *nrnb, gmx_mtop_t *mtop,
gmx_update_t **upd,
int nfile, const t_filenm fnm[],
step, nrnb, wcycle, top, &top_global->groups,
state_global->box, &state_global->x, &state_global->hist,
&f, force_vir, mdatoms, enerd, fcd,
- &state_global->lambda,
+ state_global->lambda,
nullptr, fr, nullptr, mu_tot, t, nullptr, FALSE,
GMX_FORCE_NONBONDED | GMX_FORCE_ENERGY |
(bNS ? GMX_FORCE_DYNAMICBOX | GMX_FORCE_NS : 0) |
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, 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.
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/real.h"
-struct ekinstate_t;
+class ekinstate_t;
struct gmx_constr;
struct gmx_ekindata_t;
struct gmx_enerdata_t;
struct t_inputrec;
struct t_mdatoms;
struct t_nrnb;
-struct t_state;
+class t_state;
/* Abstract type for update */
struct gmx_update_t;
/* The source code in this file should be thread-safe.
Please keep it that way. */
-static void zero_history(history_t *hist)
+history_t::history_t() : disre_initf(0),
+ ndisrepairs(0),
+ disre_rm3tav(nullptr),
+ orire_initf(0),
+ norire_Dtav(0),
+ orire_Dtav(nullptr)
{
- hist->disre_initf = 0;
- hist->ndisrepairs = 0;
- hist->disre_rm3tav = nullptr;
- hist->orire_initf = 0;
- hist->norire_Dtav = 0;
- hist->orire_Dtav = nullptr;
-}
+};
-static void zero_ekinstate(ekinstate_t *eks)
+ekinstate_t::ekinstate_t() : bUpToDate(FALSE),
+ ekin_n(0),
+ ekinh(nullptr),
+ ekinf(nullptr),
+ ekinh_old(nullptr),
+ ekin_total(),
+ ekinscalef_nhc(),
+ ekinscaleh_nhc(),
+ vscale_nhc(),
+ dekindl(0),
+ mvcos(0)
{
- eks->ekin_n = 0;
- eks->ekinh = nullptr;
- eks->ekinf = nullptr;
- eks->ekinh_old = nullptr;
- eks->ekinscalef_nhc.resize(0);
- eks->ekinscaleh_nhc.resize(0);
- eks->vscale_nhc.resize(0);
- eks->dekindl = 0;
- eks->mvcos = 0;
-}
+ clear_mat(ekin_total);
+};
static void init_swapstate(swapstate_t *swapstate)
{
}
-void init_state(t_state *state, int natoms, int ngtc, int nnhpres, int nhchainlength, int dfhistNumLambda)
+/* Checkpoint code relies on this function having no effect if
+ state->natoms is > 0 and passed as natoms. */
+void state_change_natoms(t_state *state, int natoms)
{
- state->natoms = natoms;
- state->flags = 0;
- state->fep_state = 0;
- state->lambda.resize(efptNR, 0);
- state->veta = 0;
- clear_mat(state->box);
- clear_mat(state->box_rel);
- clear_mat(state->boxv);
- clear_mat(state->pres_prev);
- clear_mat(state->svir_prev);
- clear_mat(state->fvir_prev);
- init_gtc_state(state, ngtc, nnhpres, nhchainlength);
+ state->natoms = natoms;
if (state->natoms > 0)
{
/* We need to allocate one element extra, since we might use
state->v.resize(0);
}
state->cg_p.resize(0);
- zero_history(&state->hist);
- zero_ekinstate(&state->ekinstate);
+}
+
+void init_dfhist_state(t_state *state, int dfhistNumLambda)
+{
if (dfhistNumLambda > 0)
{
snew(state->dfhist, 1);
{
state->dfhist = nullptr;
}
- state->swapstate = nullptr;
- state->edsamstate = nullptr;
- state->ddp_count = 0;
- state->ddp_count_cg_gl = 0;
- state->cg_gl.resize(0);
}
void comp_state(const t_state *st1, const t_state *st2,
return dest;
}
+
+t_state::t_state() : natoms(0),
+ ngtc(0),
+ nnhpres(0),
+ nhchainlength(0),
+ flags(0),
+ fep_state(0),
+ lambda(),
+ nosehoover_xi(),
+ nosehoover_vxi(),
+ nhpres_xi(),
+ nhpres_vxi(),
+ therm_integral(),
+ veta(0),
+ vol0(0),
+ x(),
+ v(),
+ cg_p(),
+ ekinstate(),
+ hist(),
+ swapstate(nullptr),
+ dfhist(nullptr),
+ edsamstate(nullptr),
+ ddp_count(0),
+ ddp_count_cg_gl(0),
+ cg_gl()
+{
+ // It would be nicer to initialize these with {} or {{0}} in the
+ // above initialization list, but uncrustify doesn't understand
+ // that.
+ // TODO Fix this if we switch to clang-format some time.
+ // cppcheck-suppress useInitializationList
+ lambda = {{ 0 }};
+ clear_mat(box);
+ clear_mat(box_rel);
+ clear_mat(boxv);
+ clear_mat(pres_prev);
+ clear_mat(svir_prev);
+ clear_mat(fvir_prev);
+}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, 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.
#ifndef GMX_MDTYPES_STATE_H
#define GMX_MDTYPES_STATE_H
+#include <array>
#include <vector>
#include "gromacs/math/paddedvector.h"
/* The names of the state entries, defined in src/gmxlib/checkpoint.c */
extern const char *est_names[estNR];
-typedef struct history_t
+class history_t
{
- real disre_initf; /* The scaling factor for initializing the time av. */
- int ndisrepairs; /* The number of distance restraints */
- real *disre_rm3tav; /* The r^-3 time averaged pair distances */
- real orire_initf; /* The scaling factor for initializing the time av. */
- int norire_Dtav; /* The number of matrix element in dtav (npair*5) */
- real *orire_Dtav; /* The time averaged orientation tensors */
-} history_t;
+ public:
+ history_t();
+
+ real disre_initf; /* The scaling factor for initializing the time av. */
+ int ndisrepairs; /* The number of distance restraints */
+ real *disre_rm3tav; /* The r^-3 time averaged pair distances */
+ real orire_initf; /* The scaling factor for initializing the time av. */
+ int norire_Dtav; /* The number of matrix element in dtav (npair*5) */
+ real *orire_Dtav; /* The time averaged orientation tensors */
+};
/* Struct used for checkpointing only.
* This struct would not be required with unlimited precision.
* can cause the kinetic energy in the MD loop to differ by a few bits from
* the kinetic energy one would determine from state.v.
*/
-typedef struct ekinstate_t
+class ekinstate_t
{
- gmx_bool bUpToDate;
- int ekin_n;
- tensor *ekinh;
- tensor *ekinf;
- tensor *ekinh_old;
- tensor ekin_total;
- std::vector<double> ekinscalef_nhc;
- std::vector<double> ekinscaleh_nhc;
- std::vector<double> vscale_nhc;
- real dekindl;
- real mvcos;
-} ekinstate_t;
+ public:
+ ekinstate_t();
+
+ gmx_bool bUpToDate;
+ int ekin_n;
+ tensor *ekinh;
+ tensor *ekinf;
+ tensor *ekinh_old;
+ tensor ekin_total;
+ std::vector<double> ekinscalef_nhc;
+ std::vector<double> ekinscaleh_nhc;
+ std::vector<double> vscale_nhc;
+ real dekindl;
+ real mvcos;
+};
typedef struct df_history_t
{
swapstate_t;
-typedef struct t_state
+class t_state
{
- int natoms;
- int ngtc;
- int nnhpres;
- int nhchainlength; /* number of nose-hoover chains */
- int flags; /* Flags telling which entries are present */
- int fep_state; /* indicates which of the alchemical states we are in */
- std::vector<real> lambda; /* lambda vector */
- matrix box; /* box vector coordinates */
- matrix box_rel; /* Relitaive box vectors to preserve shape */
- matrix boxv; /* box velocitites for Parrinello-Rahman pcoupl */
- matrix pres_prev; /* Pressure of the previous step for pcoupl */
- matrix svir_prev; /* Shake virial for previous step for pcoupl */
- matrix fvir_prev; /* Force virial of the previous step for pcoupl */
- std::vector<double> nosehoover_xi; /* for Nose-Hoover tcoupl (ngtc) */
- std::vector<double> nosehoover_vxi; /* for N-H tcoupl (ngtc) */
- std::vector<double> nhpres_xi; /* for Nose-Hoover pcoupl for barostat */
- std::vector<double> nhpres_vxi; /* for Nose-Hoover pcoupl for barostat */
- std::vector<double> therm_integral; /* for N-H/V-rescale tcoupl (ngtc) */
- real veta; /* trotter based isotropic P-coupling */
- real vol0; /* initial volume,required for computing NPT conserverd quantity */
- PaddedRVecVector x; /* the coordinates (natoms) */
- PaddedRVecVector v; /* the velocities (natoms) */
- PaddedRVecVector cg_p; /* p vector for conjugate gradient minimization */
-
- ekinstate_t ekinstate; /* The state of the kinetic energy data */
-
- /* History for special algorithms, should be moved to a history struct */
- history_t hist; /* Time history for restraints */
- swapstate_t *swapstate; /* Position swapping */
- df_history_t *dfhist; /*Free energy history for free energy analysis */
- edsamstate_t *edsamstate; /* Essential dynamics / flooding history */
-
- int ddp_count; /* The DD partitioning count for this state */
- int ddp_count_cg_gl; /* The DD part. count for index_gl */
- std::vector<int> cg_gl; /* The global cg number of the local cgs */
-} t_state;
+ public:
+ // Constructor
+ t_state();
+
+ // All things public
+ int natoms;
+ int ngtc;
+ int nnhpres;
+ int nhchainlength; /* number of nose-hoover chains */
+ int flags; /* Flags telling which entries are present */
+ int fep_state; /* indicates which of the alchemical states we are in */
+ std::array<real, efptNR> lambda; /* lambda vector */
+ matrix box; /* box vector coordinates */
+ matrix box_rel; /* Relitaive box vectors to preserve shape */
+ matrix boxv; /* box velocitites for Parrinello-Rahman pcoupl */
+ matrix pres_prev; /* Pressure of the previous step for pcoupl */
+ matrix svir_prev; /* Shake virial for previous step for pcoupl */
+ matrix fvir_prev; /* Force virial of the previous step for pcoupl */
+ std::vector<double> nosehoover_xi; /* for Nose-Hoover tcoupl (ngtc) */
+ std::vector<double> nosehoover_vxi; /* for N-H tcoupl (ngtc) */
+ std::vector<double> nhpres_xi; /* for Nose-Hoover pcoupl for barostat */
+ std::vector<double> nhpres_vxi; /* for Nose-Hoover pcoupl for barostat */
+ std::vector<double> therm_integral; /* for N-H/V-rescale tcoupl (ngtc) */
+ real veta; /* trotter based isotropic P-coupling */
+ real vol0; /* initial volume,required for computing NPT conserverd quantity */
+ PaddedRVecVector x; /* the coordinates (natoms) */
+ PaddedRVecVector v; /* the velocities (natoms) */
+ PaddedRVecVector cg_p; /* p vector for conjugate gradient minimization */
+
+ ekinstate_t ekinstate; /* The state of the kinetic energy data */
+
+ /* History for special algorithms, should be moved to a history struct */
+ history_t hist; /* Time history for restraints */
+ swapstate_t *swapstate; /* Position swapping */
+ df_history_t *dfhist; /*Free energy history for free energy analysis */
+ edsamstate_t *edsamstate; /* Essential dynamics / flooding history */
+
+ int ddp_count; /* The DD partitioning count for this state */
+ int ddp_count_cg_gl; /* The DD part. count for index_gl */
+ std::vector<int> cg_gl; /* The global cg number of the local cgs */
+};
typedef struct t_extmass
{
double *vscale_nhc;
} t_vetavars;
+//! Allocates memory for temperature coupling
void init_gtc_state(t_state *state, int ngtc, int nnhpres, int nhchainlength);
-void init_state(t_state *state, int natoms, int ngtc, int nnhpres, int nhchainlength, int dfhistNumLambda);
+//! Change the number of atoms represented by this state, allocating memory as needed.
+void state_change_natoms(t_state *state, int natoms);
+
+//! Allocates memory for free-energy history
+void init_dfhist_state(t_state *state, int dfhistNumLambda);
void comp_state(const t_state *st1, const t_state *st2, gmx_bool bRMSD, real ftol, real abstol);
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017, 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.
#include "gromacs/utility/real.h"
struct t_inputrec;
-struct t_state;
+class t_state;
/*! \brief Make sure the relative box shape remains the same
*
{
FILE *gp;
int indent, i, j, **gcount, atot;
- t_state state {};
+ t_state state;
t_inputrec *ir = nullptr;
t_tpxheader tpx;
gmx_mtop_t mtop;
}
/* Initial values */
- init_md(fplog, cr, ir, oenv, &t, &t0, &state_global->lambda,
+ init_md(fplog, cr, ir, oenv, &t, &t0, state_global->lambda,
&(state_global->fep_state), lam0,
nrnb, top_global, &upd,
nfile, fnm, &outf, &mdebin,
{
top = dd_init_local_top(top_global);
- stateInstance = std::unique_ptr<t_state>(new t_state {});
+ stateInstance = std::unique_ptr<t_state>(new t_state);
state = stateInstance.get();
dd_init_local_state(cr->dd, state_global, state);
}
do_force(fplog, cr, ir, step, nrnb, wcycle, top, groups,
state->box, &state->x, &state->hist,
&f, force_vir, mdatoms, enerd, fcd,
- &state->lambda, graph,
+ state->lambda, graph,
fr, vsite, mu_tot, t, ed, bBornRadii,
(bNS ? GMX_FORCE_NS : 0) | force_flags);
}
/* sum up the foreign energy and dhdl terms for vv. currently done every step so that dhdl is correct in the .edr */
if (ir->efep != efepNO && !bRerunMD)
{
- sum_dhdl(enerd, &state->lambda, ir->fepvals);
+ sum_dhdl(enerd, state->lambda, ir->fepvals);
}
}
{
/* Sum up the foreign energy and dhdl terms for md and sd.
Currently done every step so that dhdl is correct in the .edr */
- sum_dhdl(enerd, &state->lambda, ir->fepvals);
+ sum_dhdl(enerd, state->lambda, ir->fepvals);
}
update_pcouple_after_coordinates(fplog, step, ir, mdatoms,
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017, 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.
struct t_commrec;
struct t_filenm;
struct t_inputrec;
-struct t_state;
+class t_state;
/* initialisation of membed code */
gmx_membed_t *init_membed(FILE *fplog, int nfile, const t_filenm fnm[], gmx_mtop_t *mtop,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2017, 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.
struct gmx_multisim_t;
struct t_commrec;
struct t_inputrec;
-struct t_state;
+class t_state;
/* Abstract type for replica exchange */
typedef struct gmx_repl_ex *gmx_repl_ex_t;
{
gmx_incons("Changing nstlist with domain decomposition and unbounded dimensions is not implemented yet");
}
- t_state state_tmp {};
+ t_state state_tmp;
copy_mat(box, state_tmp.box);
bDD = change_dd_cutoff(cr, &state_tmp, ir, rlist_new);
}
please_cite(fplog, "Berendsen95a");
}
- std::unique_ptr<t_state> stateInstance = std::unique_ptr<t_state>(new t_state {});
+ std::unique_ptr<t_state> stateInstance = std::unique_ptr<t_state>(new t_state);
t_state * state = stateInstance.get();
if (SIMMASTER(cr))