ComputeNonbondedTI.C File Reference

#include "ComputeNonbondedInl.h"
#include "ComputeNonbondedBase.h"

Go to the source code of this file.

Defines

#define TIFLAG
#define CALCENERGY
#define NBTYPE   NBPAIR
#define FULLELECT
#define MERGEELECT
#define SLOWONLY
#define NBTYPE   NBSELF
#define FULLELECT
#define MERGEELECT
#define SLOWONLY
#define NBTYPE   NBPAIR
#define FULLELECT
#define MERGEELECT
#define SLOWONLY
#define NBTYPE   NBSELF
#define FULLELECT
#define MERGEELECT
#define SLOWONLY

Functions

void ti_vdw_force_energy_dUdl (BigReal A, BigReal B, BigReal r2, BigReal myVdwShift, BigReal switchdist2, BigReal cutoff2, BigReal myVdwLambda, BigReal alchVdwShiftCoeff, BigReal switchfactor, Bool vdwForceSwitching, Bool LJcorrection, BigReal *alch_vdw_energy, BigReal *alch_vdw_force, BigReal *alch_vdw_dUdl)


Define Documentation

#define CALCENERGY

Definition at line 84 of file ComputeNonbondedTI.C.

#define FULLELECT

Definition at line 129 of file ComputeNonbondedTI.C.

#define FULLELECT

Definition at line 129 of file ComputeNonbondedTI.C.

#define FULLELECT

Definition at line 129 of file ComputeNonbondedTI.C.

#define FULLELECT

Definition at line 129 of file ComputeNonbondedTI.C.

#define MERGEELECT

Definition at line 131 of file ComputeNonbondedTI.C.

#define MERGEELECT

Definition at line 131 of file ComputeNonbondedTI.C.

#define MERGEELECT

Definition at line 131 of file ComputeNonbondedTI.C.

#define MERGEELECT

Definition at line 131 of file ComputeNonbondedTI.C.

#define NBTYPE   NBSELF

Definition at line 127 of file ComputeNonbondedTI.C.

#define NBTYPE   NBPAIR

Definition at line 127 of file ComputeNonbondedTI.C.

#define NBTYPE   NBSELF

Definition at line 127 of file ComputeNonbondedTI.C.

#define NBTYPE   NBPAIR

Definition at line 127 of file ComputeNonbondedTI.C.

#define SLOWONLY

Definition at line 134 of file ComputeNonbondedTI.C.

#define SLOWONLY

Definition at line 134 of file ComputeNonbondedTI.C.

#define SLOWONLY

Definition at line 134 of file ComputeNonbondedTI.C.

#define SLOWONLY

Definition at line 134 of file ComputeNonbondedTI.C.

#define TIFLAG

Definition at line 83 of file ComputeNonbondedTI.C.


Function Documentation

void ti_vdw_force_energy_dUdl ( BigReal  A,
BigReal  B,
BigReal  r2,
BigReal  myVdwShift,
BigReal  switchdist2,
BigReal  cutoff2,
BigReal  myVdwLambda,
BigReal  alchVdwShiftCoeff,
BigReal  switchfactor,
Bool  vdwForceSwitching,
Bool  LJcorrection,
BigReal alch_vdw_energy,
BigReal alch_vdw_force,
BigReal alch_vdw_dUdl 
) [inline]

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 19 of file ComputeNonbondedTI.C.

00023                                                    {
00024   //myVdwShift already multplied by relevant (1-vdwLambda)
00025   const BigReal r2_1 = 1./(r2 + myVdwShift);
00026   const BigReal r6_1 = r2_1*r2_1*r2_1;
00027     
00028   // switching function (this is correct whether switching is active or not)
00029   const BigReal switchmul = (r2 > switchdist2 ? switchfactor*(cutoff2 - r2) \
00030                              *(cutoff2 - r2) \
00031                              *(cutoff2 - 3.*switchdist2 + 2.*r2) : 1.);
00032   const BigReal switchmul2 = (r2 > switchdist2 ?                      \
00033                               12.*switchfactor*(cutoff2 - r2)       \
00034                               *(r2 - switchdist2) : 0.);
00035 
00036   // separation-shifted vdW force and energy
00037   const BigReal U = A*r6_1*r6_1 - B*r6_1; // NB: unscaled! for shorthand only!
00038   *alch_vdw_energy = myVdwLambda*switchmul*U;
00039   *alch_vdw_force = (myVdwLambda*(switchmul*(12.*U + 6.*B*r6_1)*r2_1 \
00040                                   + switchmul2*U));
00041   *alch_vdw_dUdl = (switchmul*(U + myVdwLambda*alchVdwShiftCoeff \
00042                                    *(6.*U + 3.*B*r6_1)*r2_1));
00043 
00044   // BKR - separation-shifted vdW force switching and potential shifting
00045   if(vdwForceSwitching){ // add potential shifts and additional dU/dl terms
00046     const BigReal cutoff6 = cutoff2*cutoff2*cutoff2;
00047     const BigReal cutoff3 = cutoff2*sqrt(cutoff2);
00048     const BigReal shifted_switchdist2 = switchdist2 + myVdwShift;
00049     const BigReal shifted_switchdist = sqrt(shifted_switchdist2);
00050     const BigReal shifted_switchdist6 = \
00051         shifted_switchdist2*shifted_switchdist2*shifted_switchdist2;
00052     const BigReal shifted_switchdist3 = shifted_switchdist2*shifted_switchdist;
00053 
00054     const BigReal v_vdwa = -A / (cutoff6*shifted_switchdist6);
00055     const BigReal v_vdwb = -B / (cutoff3*shifted_switchdist3);
00056     const BigReal dU = v_vdwa - v_vdwb; //deltaV2 from Steinbach & Brooks
00057 
00058     if(r2 > switchdist2) {
00059       const BigReal k_vdwa = A*cutoff6 / (cutoff6 - shifted_switchdist6);
00060       const BigReal k_vdwb = B*cutoff3 / (cutoff3 - shifted_switchdist3);
00061       const BigReal tmpa = r6_1 - (1./cutoff6);
00062       const BigReal r_1 = sqrt(r2_1);
00063       const BigReal tmpb = r2_1*r_1 - (1./cutoff3);
00064       const BigReal Uh = (k_vdwa*tmpa*tmpa - k_vdwb*tmpb*tmpb \
00065                           - (LJcorrection ? dU : 0.));
00066       *alch_vdw_energy = myVdwLambda*Uh;
00067       *alch_vdw_force = (myVdwLambda*r2_1*(12.*k_vdwa*tmpa*r6_1
00068                                            - 6.*k_vdwb*tmpb*r2_1*r_1));
00069       *alch_vdw_dUdl = (Uh + alchVdwShiftCoeff*myVdwLambda*r2_1 \
00070                         *(6.*k_vdwa*tmpa*r6_1                   \
00071                           - 3.*k_vdwb*tmpb*r2_1*r_1));
00072     }else{
00073       if(!LJcorrection) {
00074         *alch_vdw_energy += myVdwLambda*dU;
00075         *alch_vdw_dUdl += dU;
00076       }
00077     }
00078   }
00079 }


Generated on Tue Sep 19 01:17:15 2017 for NAMD by  doxygen 1.4.7