struct t_inputrec;
struct t_mdatoms;
-struct t_vcm_thread{
- rvec p = {0}; /* Linear momentum */
- rvec x = {0}; /* Center of mass */
- rvec j = {0}; /* Angular momentum */
- tensor i = {{0}}; /* Moment of inertia */
- real mass = 0; /* Mass */
+struct t_vcm_thread
+{
+ //! Linear momentum
+ rvec p = {0};
+ //! Center of mass
+ rvec x = {0};
+ //! Angular momentum
+ rvec j = {0};
+ //! Moment of inertia
+ tensor i = {{0}};
+ //! Mass
+ real mass = 0;
};
struct t_vcm
{
- int nr; /* Number of groups */
- int size; /* Size of group arrays */
- int stride; /* Stride for thread data */
- int mode; /* One of the enums above */
- int ndim; /* The number of dimensions for corr. */
- real timeStep; /* The time step for COMM removal */
- std::vector<real> group_ndf; /* Number of degrees of freedom */
- std::vector<real> group_mass; /* Mass per group */
- std::vector<gmx::RVec> group_p; /* Linear momentum per group */
- std::vector<gmx::RVec> group_v; /* Linear velocity per group */
- std::vector<gmx::RVec> group_x; /* Center of mass per group */
- std::vector<gmx::RVec> group_j; /* Angular momentum per group */
- std::vector<gmx::RVec> group_w; /* Angular velocity (omega) */
- tensor *group_i; /* Moment of inertia per group */
- std::vector<char *> group_name; /* These two are copies to pointers in */
- ivec *nFreeze; /* Tells whether dimensions are frozen per freeze group */
- std::vector<t_vcm_thread> thread_vcm; /* Temporary data per thread and group */
+ //! Number of groups
+ int nr = 0;
+ //! Size of group arrays
+ int size = 0;
+ //! Stride for thread data
+ int stride = 0;
+ //! One of the enums above
+ int mode = 0;
+ //! The number of dimensions for corr.
+ int ndim = 0;
+ //! The time step for COMM removal
+ real timeStep = 0;
+ //! Number of degrees of freedom
+ std::vector<real> group_ndf;
+ //! Mass per group
+ std::vector<real> group_mass;
+ //! Linear momentum per group
+ std::vector<gmx::RVec> group_p;
+ //! Linear velocity per group
+ std::vector<gmx::RVec> group_v;
+ //! Center of mass per group
+ std::vector<gmx::RVec> group_x;
+ //! Angular momentum per group
+ std::vector<gmx::RVec> group_j;
+ //! Angular velocity (omega)
+ std::vector<gmx::RVec> group_w;
+ //! Moment of inertia per group
+ tensor *group_i = nullptr;
+ //! These two are copies to pointers in
+ std::vector<char *> group_name;
+ //! Tells whether dimensions are frozen per freeze group
+ ivec *nFreeze = nullptr;
+ //! Temporary data per thread and group
+ std::vector<t_vcm_thread> thread_vcm;
- // Tell whether the integrator conserves momentum
- bool integratorConservesMomentum;
+ //! Tell whether the integrator conserves momentum
+ bool integratorConservesMomentum = false;
t_vcm(const SimulationGroups &groups, const t_inputrec &ir);
~t_vcm();
#include "gromacs/utility/smalloc.h"
struct t_grp_tcstat{
- real Th = 0; /* Temperature at half step */
- real T = 0; /* Temperature at full step */
- tensor ekinh = {{0}}; /* Kinetic energy at half step */
- tensor ekinh_old = {{0}}; /* Kinetic energy at old half step */
- tensor ekinf = {{0}}; /* Kinetic energy at full step */
- real lambda = 0; /* Berendsen coupling lambda */
- double ekinscalef_nhc = 0; /* Scaling factor for NHC- full step */
- double ekinscaleh_nhc = 0; /* Scaling factor for NHC- half step */
- double vscale_nhc = 0; /* Scaling factor for NHC- velocity */
+ //! Temperature at half step
+ real Th = 0;
+ //! Temperature at full step
+ real T = 0;
+ //! Kinetic energy at half step
+ tensor ekinh = {{0}};
+ //! Kinetic energy at old half step
+ tensor ekinh_old = {{0}};
+ //! Kinetic energy at full step
+ tensor ekinf = {{0}};
+ //! Berendsen coupling lambda
+ real lambda = 0;
+ //! Scaling factor for NHC- full step
+ double ekinscalef_nhc = 0;
+ //! Scaling factor for NHC- half step
+ double ekinscaleh_nhc = 0;
+ //! Scaling factor for NHC- velocity
+ double vscale_nhc = 0;
};
struct t_grp_acc {
- int nat; /* Number of atoms in this group */
- rvec u; /* Mean velocities of home particles */
- rvec uold; /* Previous mean velocities of home particles */
- double mA; /* Mass for topology A */
- double mB; /* Mass for topology B */
+ //! Number of atoms in this group
+ int nat = 0;
+ //! Mean velocities of home particles
+ rvec u = { 0 };
+ //! Previous mean velocities of home particles
+ rvec uold = { 0 };
+ //! Mass for topology A
+ double mA = 0;
+ //! Mass for topology B
+ double mB = 0;
};
struct t_cos_acc{
- real cos_accel; /* The acceleration for the cosine profile */
- real mvcos; /* The cos momenta of home particles */
- real vcos; /* The velocity of the cosine profile */
+ //! The acceleration for the cosine profile
+ real cos_accel = 0;
+ //! The cos momenta of home particles
+ real mvcos = 0;
+ //! The velocity of the cosine profile
+ real vcos = 0;
};
struct gmx_ekindata_t {
+ //! Whether non-equilibrium MD is active (ie. constant or cosine acceleration)
gmx_bool bNEMD;
- int ngtc; /* The number of T-coupling groups */
- int nthreads; /* For size of ekin_work */
- std::vector<t_grp_tcstat> tcstat; /* T-coupling data */
- tensor **ekin_work_alloc; /* Allocated locations for *_work members */
- tensor **ekin_work; /* Work arrays for tcstat per thread */
- real **dekindl_work; /* Work location for dekindl per thread */
- int ngacc; /* The number of acceleration groups */
- std::vector<t_grp_acc> grpstat; /* Acceleration data */
- tensor ekin; /* overall kinetic energy */
- tensor ekinh; /* overall 1/2 step kinetic energy */
- real dekindl; /* dEkin/dlambda at half step */
- real dekindl_old; /* dEkin/dlambda at old half step */
- t_cos_acc cosacc; /* Cosine acceleration data */
+ //! The number of T-coupling groups
+ int ngtc = 0;
+ //! For size of ekin_work
+ int nthreads = 0;
+ //! T-coupling data
+ std::vector<t_grp_tcstat> tcstat;
+ //! Allocated locations for *_work members
+ tensor **ekin_work_alloc = nullptr;
+ //! Work arrays for tcstat per thread
+ tensor **ekin_work = nullptr;
+ //! Work location for dekindl per thread
+ real **dekindl_work = nullptr;
+ //! The number of acceleration groups
+ int ngacc = 0;
+ //! Acceleration data
+ std::vector<t_grp_acc> grpstat;
+ //! overall kinetic energy
+ tensor ekin = {{ 0 }};
+ //! overall 1/2 step kinetic energy
+ tensor ekinh = {{ 0 }};
+ //! dEkin/dlambda at half step
+ real dekindl = 0;
+ //! dEkin/dlambda at old half step
+ real dekindl_old = 0;
+ //! Cosine acceleration data
+ t_cos_acc cosacc;
~gmx_ekindata_t();
};