real * fshift;
const real * x;
real * f;
- real facel, krf, crf;
const real * chargeA;
const real * chargeB;
real sigma6_min, sigma6_def, lam_power;
real alpha_coul, alpha_vdw, lambda_coul, lambda_vdw;
- real sh_lj_ewald;
const real * nbfp, *nbfp_grid;
real * dvdl;
real * Vv;
real * Vc;
gmx_bool bDoForces, bDoShiftForces, bDoPotential;
- real rcoulomb, rvdw, sh_invrc6;
gmx_bool bEwald, bEwaldLJ;
real rcutoff_max2;
const real * tab_ewald_F_lj = nullptr;
shiftvec = fr->shift_vec[0];
chargeA = mdatoms->chargeA;
chargeB = mdatoms->chargeB;
- facel = fr->ic->epsfac;
- krf = ic->k_rf;
- crf = ic->c_rf;
Vc = kernel_data->energygrp_elec;
typeA = mdatoms->typeA;
typeB = mdatoms->typeB;
bDoShiftForces = ((kernel_data->flags & GMX_NONBONDED_DO_SHIFTFORCE) != 0);
bDoPotential = ((kernel_data->flags & GMX_NONBONDED_DO_POTENTIAL) != 0);
- rcoulomb = ic->rcoulomb;
- rvdw = ic->rvdw;
- sh_invrc6 = ic->sh_invrc6;
- sh_lj_ewald = ic->sh_lj_ewald;
+ // Extract data from interaction_const_t
+ const real facel = ic->epsfac;
+ const real rcoulomb = ic->rcoulomb;
+ const real krf = ic->k_rf;
+ const real crf = ic->c_rf;
+ const real sh_lj_ewald = ic->sh_lj_ewald;
+ const real rvdw = ic->rvdw;
+ const real dispersionShift = ic->dispersion_shift.cpot;
+ const real repulsionShift = ic->repulsion_shift.cpot;
// Note that the nbnxm kernels do not support Coulomb potential switching at all
GMX_ASSERT(ic->coulomb_modifier != eintmodPOTSWITCH,
Vvdw6 = c6[i]*rinv6;
Vvdw12 = c12[i]*rinv6*rinv6;
- Vvdw[i] = ( (Vvdw12 - c12[i]*sh_invrc6*sh_invrc6)*onetwelfth
- - (Vvdw6 - c6[i]*sh_invrc6)*onesixth);
+ Vvdw[i] = ( (Vvdw12 + c12[i]*repulsionShift)*onetwelfth
+ - (Vvdw6 + c6[i]*dispersionShift)*onesixth);
FscalV[i] = Vvdw12 - Vvdw6;
if (bEwaldLJ)
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,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.
struct switch_consts_t vdw_switch;
gmx_bool useBuckingham;
real buckinghamBMax;
- /* TODO: remove this variable, used for not modyfing the group kernels,
- * it is equal to -dispersion_shift->cpot
- */
- real sh_invrc6;
/* type of electrostatics (defined in enums.h) */
int eeltype;