Also fixed the order of the function type update table in tpxio.cpp.
themselves, but only if they are higher in the list, i.e. virtual sites
can be constructed from “particles” that are simpler virtual sites.
+- On top of an atom. This allows giving an atom multiple atom types and
+ with that also assigned multiple, different bonded interactions. This
+ can espically be of use in free-energy calculations.
+
+- The coordinates of the virtual site equal that of the constructing atom:
+
+ .. math:: \mathbf{r}_s ~=~ \mathbf{r}_i
+ :label: eqnvsite1
+
+- The force is moved to the constructing atom:
+
+ .. math:: \mathbf{F}_i ~=~ \mathbf{F}_{s}
+ :label: eqnvsite1force
+
- As a linear combination of two atoms
(:numref:`Fig. %s <fig-vsites>` 2):
Also, please use the syntax :issue:`number` to reference issues on GitLab, without the
a space between the colon and number!
+Virtual site with single constructing atom
+""""""""""""""""""""""""""""""""""""""""""
+
+Added a virtual site that is constructed on top if its single constructing
+atom. This can be useful for free-energy calculations.
+
Lower energy drift due to SETTLE
""""""""""""""""""""""""""""""""
tpxv_VSite2FD, /**< Added 2FD type virtual site */
tpxv_AddSizeField, /**< Added field with information about the size of the serialized tpr file in bytes, excluding the header */
tpxv_StoreNonBondedInteractionExclusionGroup, /**< Store the non bonded interaction exclusion group in the topology */
+ tpxv_VSite1, /**< Added 1 type virtual site */
tpxv_Count /**< the total number of tpxv versions */
};
{ 72, F_GBPOL_NOLONGERUSED },
{ 72, F_NPSOLVATION_NOLONGERUSED },
{ 93, F_LJ_RECIP },
+ { 76, F_ANHARM_POL },
{ 90, F_FBPOSRES },
+ { tpxv_VSite1, F_VSITE1 },
+ { tpxv_VSite2FD, F_VSITE2FD },
+ { tpxv_GenericInternalParameters, F_DENSITYFITTING },
{ 69, F_VTEMP_NOLONGERUSED },
{ 66, F_PDISPCORR },
- { 76, F_ANHARM_POL },
{ 79, F_DVDL_COUL },
{
79,
},
{ 79, F_DVDL_RESTRAINT },
{ 79, F_DVDL_TEMPERATURE },
- { tpxv_GenericInternalParameters, F_DENSITYFITTING },
- { tpxv_VSite2FD, F_VSITE2FD },
};
#define NFTUPD asize(ftupd)
serializer->doReal(&iparams->settle.doh);
serializer->doReal(&iparams->settle.dhh);
break;
+ case F_VSITE1: break; // VSite1 has 0 parameters
case F_VSITE2:
case F_VSITE2FD: serializer->doReal(&iparams->vsite.a); break;
case F_VSITE3:
{ "Shake-Init", 10 },
{ "Constraint-Vir", 24 },
{ "Settle", 370 },
+ { "Virtual Site 1", 1 },
{ "Virtual Site 2", 23 },
{ "Virtual Site 2fd", 63 },
{ "Virtual Site 3", 37 },
eNR_SHAKE_RIJ,
eNR_CONSTR_VIR,
eNR_SETTLE,
+ eNR_VSITE1,
eNR_VSITE2,
eNR_VSITE2FD,
eNR_VSITE3,
newparam->settle.doh = old[0];
newparam->settle.dhh = old[1];
break;
+ case F_VSITE1:
case F_VSITE2:
case F_VSITE2FD:
case F_VSITE3:
#ifndef DOXYGEN
/* Vsite construction routines */
+static void constr_vsite1(const rvec xi, rvec x)
+{
+ copy_rvec(xi, x);
+
+ /* TOTAL: 0 flops */
+}
+
static void constr_vsite2(const rvec xi, const rvec xj, rvec x, real a, const t_pbc* pbc)
{
real b = 1 - a;
real b1, c1;
switch (ftype)
{
+ case F_VSITE1: constr_vsite1(x[ai], x[avsite]); break;
case F_VSITE2:
aj = ia[3];
constr_vsite2(x[ai], x[aj], x[avsite], a1, pbc_null2);
#ifndef DOXYGEN
/* Force spreading routines */
+static void spread_vsite1(const t_iatom ia[], ArrayRef<RVec> f)
+{
+ const int av = ia[1];
+ const int ai = ia[2];
+
+ f[av] += f[ai];
+}
+
template<VirialHandling virialHandling>
static void spread_vsite2(const t_iatom ia[],
real a,
/* Construct the vsite depending on type */
switch (ftype)
{
+ case F_VSITE1: spread_vsite1(ia, f); break;
case F_VSITE2:
spread_vsite2<virialHandling>(ia, a1, x, f, fshift, pbc_null2);
break;
dd_move_f_vsites(*domainInfo_.domdec_, f, fshift);
}
+ inc_nrnb(nrnb, eNR_VSITE1, vsite_count(ilists_, F_VSITE1));
inc_nrnb(nrnb, eNR_VSITE2, vsite_count(ilists_, F_VSITE2));
inc_nrnb(nrnb, eNR_VSITE2FD, vsite_count(ilists_, F_VSITE2FD));
inc_nrnb(nrnb, eNR_VSITE3, vsite_count(ilists_, F_VSITE3));
* This is used to avoid loops over all ftypes just to get the vsite entries.
* (We should replace the fixed ilist array by only the used entries.)
*/
-static constexpr int c_ftypeVsiteStart = F_VSITE2;
+static constexpr int c_ftypeVsiteStart = F_VSITE1;
//! The start and end value of the vsite indices in the ftype enum
static constexpr int c_ftypeVsiteEnd = F_VSITEN + 1;
def_bonded("ANGRESZ", "Angle Rest. Z", 2, 3, 3), def_bonded("DIHRES", "Dih. Rest.", 4, 3, 3),
def_nofc("DIHRESVIOL", "Dih. Rest. Viol."), /* obsolete */
def_shkcb("CONSTR", "Constraint", 2, 1, 1), def_shk("CONSTRNC", "Constr. No Conn.", 2, 1, 1),
- def_shkcb("SETTLE", "Settle", 3, 2, 0), def_vsite("VSITE2", "Virtual site 2", 3, 1),
- def_vsite("VSITE2FD", "Virtual site 2fd", 3, 1), def_vsite("VSITE3", "Virtual site 3", 4, 2),
- def_vsite("VSITE3FD", "Virtual site 3fd", 4, 2), def_vsite("VSITE3FAD", "Virtual site 3fad", 4, 2),
+ def_shkcb("SETTLE", "Settle", 3, 2, 0), def_vsite("VSITE1", "Virtual site 1", 2, 0),
+ def_vsite("VSITE2", "Virtual site 2", 3, 1), def_vsite("VSITE2FD", "Virtual site 2fd", 3, 1),
+ def_vsite("VSITE3", "Virtual site 3", 4, 2), def_vsite("VSITE3FD", "Virtual site 3fd", 4, 2),
+ def_vsite("VSITE3FAD", "Virtual site 3fad", 4, 2),
def_vsite("VSITE3OUT", "Virtual site 3out", 4, 3), def_vsite("VSITE4FD", "Virtual site 4fd", 5, 3),
def_vsite("VSITE4FDN", "Virtual site 4fdn", 5, 3), def_vsite("VSITEN", "Virtual site N", 2, 2),
def_nofc("COM_PULL", "COM Pull En."), def_nofc("DENSITYFIT", "Density fitting"),
F_CONSTR,
F_CONSTRNC,
F_SETTLE,
+ F_VSITE1,
F_VSITE2,
F_VSITE2FD,
F_VSITE3,