ComputeNonbondedSplitting.h

Go to the documentation of this file.
00001 
00007 #ifndef COMPUTENONBONDEDSPLITTING_H
00008 #define COMPUTENONBONDEDSPLITTING_H
00009 
00010 // Several special cases are defined:
00011 //   NBPAIR, NBSELF, NBEXCL switch environment (mutually exclusive)
00012 //   FULLELECT full electrostatics calculation?
00013 
00014 #include "LJTable.h"
00015 #include "Molecule.h"
00016 #include "ComputeNonbondedUtil.h"
00017 
00018 // ************************************************************
00019 // Various switching functions (for inlining)
00020 inline void ComputeNonbondedUtil::shifting (
00021         BigReal &shiftVal, BigReal &dShiftVal,
00022         const BigReal &r, const BigReal &r2,
00023         const BigReal &c5, const BigReal &c6)
00024 {
00025   // Basic electrostatics shifting function for cutoff simulations
00026   shiftVal = 1.0 - r2*c5;
00027   dShiftVal = c6*shiftVal*r;
00028   shiftVal *= shiftVal;
00029 }
00030 
00031 inline void ComputeNonbondedUtil::xplorsplitting (
00032         BigReal &shiftVal, BigReal &dShiftVal,
00033         const BigReal &switchVal, const BigReal &dSwitchVal)
00034 {
00035   // X-plor electrostatics splitting function for multiple timestepping
00036   // Same as X-plor VdW switching function so copy from above.
00037   shiftVal = switchVal;
00038   dShiftVal = dSwitchVal;
00039 }
00040 
00041 inline void ComputeNonbondedUtil::c1splitting (
00042         BigReal &shiftVal, BigReal &dShiftVal,
00043         const BigReal &r, const BigReal &d0, const BigReal &switchOn)
00044 {
00045   // C1 electrostatics splitting function for multiple timestepping
00046   dShiftVal = 0;  // formula only correct for forces
00047   if (r > switchOn)
00048     {
00049     const BigReal d1 = d0*(r-switchOn);
00050     shiftVal = 1.0 + d1*d1*(2.0*d1-3.0);
00051     }
00052   else
00053     {
00054     shiftVal = 1;
00055     }
00056 }
00057 
00058 #endif
00059 

Generated on Thu Sep 21 01:17:11 2017 for NAMD by  doxygen 1.4.7