extern const char *ei_names[eiNR+1];
extern const char *yesno_names[BOOL_NR+1];
extern const char *bool_names[BOOL_NR+1];
+extern const char *eintmod_names[eintmodNR+1];
extern const char *eel_names[eelNR+1];
extern const char *eewg_names[eewgNR+1];
extern const char *evdw_names[evdwNR+1];
#define EREFSCALINGTYPE(e) ENUM_NAME(e,erscNR,erefscaling_names)
#define EBLOCKS(e) ENUM_NAME(e,ebNR,eblock_names)
#define EPARAM(e) ENUM_NAME(e,epNR,eparam_names)
+#define INTMODIFIER(e) ENUM_NAME(e,eintmodNR,eintmod_names)
#define EELTYPE(e) ENUM_NAME(e,eelNR,eel_names)
#define EVDWTYPE(e) ENUM_NAME(e,evdwNR,evdw_names)
#define ECONSTRTYPE(e) ENUM_NAME(e,econtNR,econstr_names)
ecutsGROUP, ecutsVERLET, ecutsNR
};
+/* Coulomb / VdW interaction modifiers.
+ * grompp replaces eintmodPOTSHIFT_VERLET by eintmodPOTSHIFT or eintmodNONE.
+ */
+enum {
+ eintmodPOTSHIFT_VERLET, eintmodPOTSHIFT, eintmodNONE, eintmodNR
+};
+
/*
* eelNOTUSED1 used to be GB, but to enable generalized born with different
* forms of electrostatics (RF, switch, etc.) in the future it is now selected
t_forcetable tab14; /* for 1-4 interactions only */
/* PPPM & Shifting stuff */
+ gmx_bool coul_pot_shift;
real rcoulomb_switch,rcoulomb;
real *phi;
/* VdW stuff */
+ gmx_bool vdw_pot_shift;
double reppow;
real rvdw_switch,rvdw;
real bham_b_max;
real rlistlong; /* long range pairlist cut-off (nm) */
real rtpi; /* Radius for test particle insertion */
int coulombtype; /* Type of electrostatics treatment */
+ int coulomb_modifier; /* Modify the Coulomb interaction */
real rcoulomb_switch; /* Coulomb switch range start (nm) */
real rcoulomb; /* Coulomb cutoff (nm) */
real epsilon_r; /* relative dielectric constant */
int sa_algorithm; /* Algorithm for SA part of GBSA */
real sa_surface_tension; /* Energy factor for SA part of GBSA */
int vdwtype; /* Type of Van der Waals treatment */
+ int vdw_modifier; /* Modify the VdW interaction */
real rvdw_switch; /* Van der Waals switch range start (nm) */
real rvdw; /* Van der Waals cutoff (nm) */
int eDispCorr; /* Perform Long range dispersion corrections */
<li><a HREF="#tpi"><b>test particle insertion</b></a>(rtpi)
<li><A HREF="#out"><b>output control</b></A> (nstxout, nstvout, nstfout, nstlog, nstcalcenergy, nstenergy, nstxtcout, xtc-precision, xtc-grps, energygrps)
<li><A HREF="#nl"><b>neighbor searching</b></A> (cutoff-scheme, nstlist, ns-type, pbc, periodic-molecules, verlet-buffer-drift, rlist, rlistlong)
-<li><A HREF="#el"><b>electrostatics</b></A> (coulombtype, rcoulomb-switch, rcoulomb, epsilon-r, epsilon-rf)
-<li><A HREF="#vdw"><b>VdW</b></A> (vdwtype, rvdw-switch, rvdw, DispCorr)
+<li><A HREF="#el"><b>electrostatics</b></A> (coulombtype, coulomb-modifier, rcoulomb-switch, rcoulomb, epsilon-r, epsilon-rf)
+<li><A HREF="#vdw"><b>VdW</b></A> (vdwtype, vdw-modifier, rvdw-switch, rvdw, DispCorr)
<li><A HREF="#table"><b>tables</b></A> (table-extension, energygrp-table)
<li><A HREF="#ewald"><b>Ewald</b></A> (fourierspacing, fourier-nx, fourier-ny, fourier-nz, pme-order, ewald-rtol, ewald-geometry, epsilon-surface, optimize-fft)
<li><A HREF="#tc"><b>Temperature coupling</b></A> (tcoupl, nsttcouple, tc-grps, tau-t, ref-t)
scaling <b>rcoulomb</b> and the grid spacing. This can be turned off with
<tt>-notunepme</tt>.
-<b>Verlet<\b> is somewhat faster than <b>group</b> when there is no water, or if <b>group</b> would use a pair-list buffer to conserve energy.
+<b>Verlet</b> is somewhat faster than <b>group</b> when there is no water, or if <b>group</b> would use a pair-list buffer to conserve energy.
</dd>
</dl></dd>
</dl></dd>
+<dt><b>coulomb-modifier:</b></dt>
+<dd><dl compact>
+<dt><b>Potential-shift-Verlet</b></dt>
+<dd>Selects <b>Potential-shift</b> with the Verlet cutoff-scheme,
+as it is (nearly) free; selects <b>None</b> with the group cutoff-scheme.</dd>
+<dt><b>Potential-shift</b></dt>
+<dd>Shift the Coulomb potential by a constant such that it is zero at the cut-off.
+This makes the potential the integral of the force. Note that this does not
+affect the forces or the sampling.</dd>
+<dt><b>None</b></dt>
+<dd>Use an unmodified Coulomb potential.</dd>
+</dl></dd>
+
+
<A NAME="el2">
<dt><b>rcoulomb-switch: (0) [nm]</b></dt>
<dd>where to start switching the Coulomb potential</dd>
for <tt>f</tt> and <tt>-f'</tt> are ignored.</dd>
</dl></dd>
+<dt><b>vdw-modifier:</b></dt>
+<dd><dl compact>
+<dt><b>Potential-shift-Verlet</b></dt>
+<dd>Selects <b>Potential-shift</b> with the Verlet cutoff-scheme,
+as it is (nearly) free; selects <b>None</b> with the group cutoff-scheme.</dd>
+<dt><b>Potential-shift</b></dt>
+<dd>Shift the Van der Waals potential by a constant such that it is zero at the cut-off.
+This makes the potential the integral of the force. Note that this does not
+affect the forces or the sampling.</dd>
+<dt><b>None</b></dt>
+<dd>Use an unmodified Van der Waals potential.</dd>
+</dl></dd>
+
<dt><b>rvdw-switch: (0) [nm]</b></dt>
<dd>where to start switching the LJ potential</dd>
<A HREF="#bond">constraints</A><br>
<A HREF="#neq">cos-acceleration</A><br>
<A HREF="#el">coulombtype</A><br>
+<A HREF="#el">coulomb-modifier</A><br>
<A HREF="#free">couple-intramol</A><br>
<A HREF="#free">couple-lambda0</A><br>
<A HREF="#free">couple-lambda1</A><br>
<A HREF="#user">userreal2</A><br>
<A HREF="#user">userreal3</A><br>
<A HREF="#user">userreal4</A><br>
-<A HREF="#el">vdwtype</A><br>
+<A HREF="#vdw">vdwtype</A><br>
+<A HREF="#vdw">vdw-modifier</A><br>
<A HREF="#nl">verlet-buffer-drift</A><br>
<A HREF="#out">xtc-grps</A><br>
<A HREF="#out">xtc-precision</A><br>
"Lincs", "Shake", NULL
};
+const char *eintmod_names[eintmodNR+1] = {
+ "Potential-shift-Verlet","Potential-shift","None", NULL
+};
+
const char *egrp_nm[egNR+1] = {
"Coul-SR","LJ-SR","Buck-SR", "Coul-LR", "LJ-LR", "Buck-LR",
"Coul-14", "LJ-14", NULL
static const char *tpx_tag = TPX_TAG_RELEASE;
/* This number should be increased whenever the file format changes! */
-static const int tpx_version = 80;
+static const int tpx_version = 81;
/* This number should only be increased when you edit the TOPOLOGY section
* or the HEADER of the tpx format.
gmx_fio_do_int(fio,ir->coulombtype);
if (file_version < 32 && ir->coulombtype == eelRF)
ir->coulombtype = eelRF_NEC;
+ if (file_version >= 81)
+ {
+ gmx_fio_do_int(fio,ir->coulomb_modifier);
+ }
+ else
+ {
+ ir->coulomb_modifier = (ir->cutoff_scheme == ecutsVERLET ? eintmodPOTSHIFT : eintmodNONE);
+ }
gmx_fio_do_real(fio,ir->rcoulomb_switch);
gmx_fio_do_real(fio,ir->rcoulomb);
gmx_fio_do_int(fio,ir->vdwtype);
+ if (file_version >= 81)
+ {
+ gmx_fio_do_int(fio,ir->vdw_modifier);
+ }
+ else
+ {
+ ir->vdw_modifier = (ir->cutoff_scheme == ecutsVERLET ? eintmodPOTSHIFT : eintmodNONE);
+ }
gmx_fio_do_real(fio,ir->rvdw_switch);
gmx_fio_do_real(fio,ir->rvdw);
if (file_version < 67) {
PR("rlistlong",ir->rlistlong);
PR("rtpi",ir->rtpi);
PS("coulombtype",EELTYPE(ir->coulombtype));
+ PS("coulomb-modifier",INTMODIFIER(ir->coulomb_modifier));
PR("rcoulomb-switch",ir->rcoulomb_switch);
PR("rcoulomb",ir->rcoulomb);
PS("vdwtype",EVDWTYPE(ir->vdwtype));
+ PS("vdw-modifier",INTMODIFIER(ir->vdw_modifier));
PR("rvdw-switch",ir->rvdw_switch);
PR("rvdw",ir->rvdw);
if (ir->epsilon_r != 0)
return d;
}
+static void process_interaction_modifier(const t_inputrec *ir,int *eintmod)
+{
+ if (*eintmod == eintmodPOTSHIFT_VERLET)
+ {
+ if (ir->cutoff_scheme == ecutsVERLET)
+ {
+ *eintmod = eintmodPOTSHIFT;
+ }
+ else
+ {
+ *eintmod = eintmodNONE;
+ }
+ }
+}
+
void check_ir(const char *mdparin,t_inputrec *ir, t_gromppopts *opts,
warninp_t wi)
/* Check internal consistency */
warning_error(wi,"rlist should be >= 0");
}
+ process_interaction_modifier(ir,&ir->coulomb_modifier);
+ process_interaction_modifier(ir,&ir->vdw_modifier);
+
if (ir->cutoff_scheme == ecutsGROUP)
{
+ if (ir->coulomb_modifier != eintmodNONE ||
+ ir->vdw_modifier != eintmodNONE)
+ {
+ warning_error(wi,"potential modifiers are not supported (yet) with the group cut-off scheme");
+ }
+
/* BASIC CUT-OFF STUFF */
if (ir->rlist == 0 ||
!((EEL_MIGHT_BE_ZERO_AT_CUTOFF(ir->coulombtype) && ir->rcoulomb > ir->rlist) ||
CCTYPE ("OPTIONS FOR ELECTROSTATICS AND VDW");
CTYPE ("Method for doing electrostatics");
EETYPE("coulombtype", ir->coulombtype, eel_names);
+ EETYPE("coulomb-modifier", ir->coulomb_modifier, eintmod_names);
CTYPE ("cut-off lengths");
RTYPE ("rcoulomb-switch", ir->rcoulomb_switch, 0.0);
RTYPE ("rcoulomb", ir->rcoulomb, -1);
RTYPE ("epsilon-rf", ir->epsilon_rf, 0.0);
CTYPE ("Method for doing Van der Waals");
EETYPE("vdw-type", ir->vdwtype, evdw_names);
+ EETYPE("vdw-modifier", ir->vdw_modifier, eintmod_names);
CTYPE ("cut-off lengths");
RTYPE ("rvdw-switch", ir->rvdw_switch, 0.0);
RTYPE ("rvdw", ir->rvdw, -1);
cmp_real(fp,"inputrec->rlistlong",-1,ir1->rlistlong,ir2->rlistlong,ftol,abstol);
cmp_real(fp,"inputrec->rtpi",-1,ir1->rtpi,ir2->rtpi,ftol,abstol);
cmp_int(fp,"inputrec->coulombtype",-1,ir1->coulombtype,ir2->coulombtype);
+ cmp_int(fp,"inputrec->coulomb_modifier",-1,ir1->coulomb_modifier,ir2->coulomb_modifier);
cmp_real(fp,"inputrec->rcoulomb_switch",-1,ir1->rcoulomb_switch,ir2->rcoulomb_switch,ftol,abstol);
cmp_real(fp,"inputrec->rcoulomb",-1,ir1->rcoulomb,ir2->rcoulomb,ftol,abstol);
cmp_int(fp,"inputrec->vdwtype",-1,ir1->vdwtype,ir2->vdwtype);
- cmp_real(fp,"inputrec->rvdw_switch",-1,ir1->rvdw_switch,ir2->rvdw_switch,ftol,abstol);
+ cmp_int(fp,"inputrec->vdw_modifier",-1,ir1->vdw_modifier,ir2->vdw_modifier); cmp_real(fp,"inputrec->rvdw_switch",-1,ir1->rvdw_switch,ir2->rvdw_switch,ftol,abstol);
cmp_real(fp,"inputrec->rvdw",-1,ir1->rvdw,ir2->rvdw,ftol,abstol);
cmp_real(fp,"inputrec->epsilon_r",-1,ir1->epsilon_r,ir2->epsilon_r,ftol,abstol);
cmp_real(fp,"inputrec->epsilon_rf",-1,ir1->epsilon_rf,ir2->epsilon_rf,ftol,abstol);
const t_forcerec *fr)
{
interaction_const_t *ic;
- gmx_bool shLJ,shCoul;
-
- shLJ = (getenv("GMX_NO_SHIFT_LJ") == NULL);
- shCoul = (getenv("GMX_NO_SHIFT_COUL") == NULL);
snew(ic, 1);
/* Lennard-Jones */
ic->rvdw = fr->rvdw;
- if (shLJ)
+ if (fr->vdw_pot_shift)
{
ic->sh_invrc6 = pow(ic->rvdw,-6.0);
}
/* Ewald */
ic->ewaldcoeff = fr->ewaldcoeff;
- if (shCoul)
+ if (fr->coul_pot_shift)
{
ic->sh_ewald = gmx_erfc(ic->ewaldcoeff*ic->rcoulomb);
}
/* For plain cut-off we might use the reaction-field kernels */
ic->epsilon_rf = ic->epsilon_r;
ic->k_rf = 0;
- if (shCoul)
+ if (fr->coul_pot_shift)
{
ic->c_rf = 1/ic->rcoulomb;
}
fr->rlistlong = cutoff_inf(ir->rlistlong);
fr->eeltype = ir->coulombtype;
fr->vdwtype = ir->vdwtype;
+
+ fr->coul_pot_shift = (ir->coulomb_modifier == eintmodPOTSHIFT);
+ fr->vdw_pot_shift = (ir->vdw_modifier == eintmodPOTSHIFT);
fr->bTwinRange = fr->rlistlong > fr->rlist;
fr->bEwald = (EEL_PME(fr->eeltype) || fr->eeltype==eelEWALD);
/* Contribution beyond the cut-off */
eners[0] += -4.0*M_PI/(3.0*rc3);
eners[1] += 4.0*M_PI/(9.0*rc9);
- if (fr->cutoff_scheme == ecutsVERLET && fr->ic->sh_invrc6 != 0) {
+ if (fr->vdw_pot_shift) {
/* Contribution within the cut-off */
eners[0] += -4.0*M_PI/(3.0*rc3);
eners[1] += 4.0*M_PI/(3.0*rc9);