NAMD
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ComputeNonbondedUtil Class Reference

#include <ComputeNonbondedUtil.h>

Inheritance diagram for ComputeNonbondedUtil:
ComputeLCPO ComputeNonbondedCUDA ComputeNonbondedMIC ComputeNonbondedPair ComputeNonbondedSelf CudaComputeNonbonded ExclElem

Public Types

enum  {
  exclChecksumIndex, pairlistWarningIndex, electEnergyIndex, fullElectEnergyIndex,
  vdwEnergyIndex, goNativeEnergyIndex, goNonnativeEnergyIndex, groLJEnergyIndex,
  groGaussEnergyIndex, electEnergyIndex_s, fullElectEnergyIndex_s, vdwEnergyIndex_s,
  electEnergyIndex_ti_1, fullElectEnergyIndex_ti_1, vdwEnergyIndex_ti_1, electEnergyIndex_ti_2,
  fullElectEnergyIndex_ti_2, vdwEnergyIndex_ti_2, TENSOR =(virialIndex), TENSOR =(virialIndex),
  VECTOR =(pairVDWForceIndex), VECTOR =(pairVDWForceIndex), reductionDataSize
}
 

Public Member Functions

 ComputeNonbondedUtil ()
 
 ~ComputeNonbondedUtil ()
 
void calcGBIS (nonbonded *params, GBISParamStruct *gbisParams)
 

Static Public Member Functions

static void select (void)
 
static void submitReductionData (BigReal *, SubmitReduction *)
 
static void submitPressureProfileData (BigReal *, SubmitReduction *)
 
static BigReal square (const BigReal &x, const BigReal &y, const BigReal &z)
 
static void calc_error (nonbonded *)
 
static void calc_pair (nonbonded *)
 
static void calc_pair_energy (nonbonded *)
 
static void calc_pair_fullelect (nonbonded *)
 
static void calc_pair_energy_fullelect (nonbonded *)
 
static void calc_pair_merge_fullelect (nonbonded *)
 
static void calc_pair_energy_merge_fullelect (nonbonded *)
 
static void calc_pair_slow_fullelect (nonbonded *)
 
static void calc_pair_energy_slow_fullelect (nonbonded *)
 
static void calc_self (nonbonded *)
 
static void calc_self_energy (nonbonded *)
 
static void calc_self_fullelect (nonbonded *)
 
static void calc_self_energy_fullelect (nonbonded *)
 
static void calc_self_merge_fullelect (nonbonded *)
 
static void calc_self_energy_merge_fullelect (nonbonded *)
 
static void calc_self_slow_fullelect (nonbonded *)
 
static void calc_self_energy_slow_fullelect (nonbonded *)
 
static void calc_pair_energy_fep (nonbonded *)
 
static void calc_pair_energy_fullelect_fep (nonbonded *)
 
static void calc_pair_energy_merge_fullelect_fep (nonbonded *)
 
static void calc_pair_energy_slow_fullelect_fep (nonbonded *)
 
static void calc_self_energy_fep (nonbonded *)
 
static void calc_self_energy_fullelect_fep (nonbonded *)
 
static void calc_self_energy_merge_fullelect_fep (nonbonded *)
 
static void calc_self_energy_slow_fullelect_fep (nonbonded *)
 
static void calc_pair_energy_ti (nonbonded *)
 
static void calc_pair_ti (nonbonded *)
 
static void calc_pair_energy_fullelect_ti (nonbonded *)
 
static void calc_pair_fullelect_ti (nonbonded *)
 
static void calc_pair_energy_merge_fullelect_ti (nonbonded *)
 
static void calc_pair_merge_fullelect_ti (nonbonded *)
 
static void calc_pair_energy_slow_fullelect_ti (nonbonded *)
 
static void calc_pair_slow_fullelect_ti (nonbonded *)
 
static void calc_self_energy_ti (nonbonded *)
 
static void calc_self_ti (nonbonded *)
 
static void calc_self_energy_fullelect_ti (nonbonded *)
 
static void calc_self_fullelect_ti (nonbonded *)
 
static void calc_self_energy_merge_fullelect_ti (nonbonded *)
 
static void calc_self_merge_fullelect_ti (nonbonded *)
 
static void calc_self_energy_slow_fullelect_ti (nonbonded *)
 
static void calc_self_slow_fullelect_ti (nonbonded *)
 
static void calc_pair_les (nonbonded *)
 
static void calc_pair_energy_les (nonbonded *)
 
static void calc_pair_fullelect_les (nonbonded *)
 
static void calc_pair_energy_fullelect_les (nonbonded *)
 
static void calc_pair_merge_fullelect_les (nonbonded *)
 
static void calc_pair_energy_merge_fullelect_les (nonbonded *)
 
static void calc_pair_slow_fullelect_les (nonbonded *)
 
static void calc_pair_energy_slow_fullelect_les (nonbonded *)
 
static void calc_self_les (nonbonded *)
 
static void calc_self_energy_les (nonbonded *)
 
static void calc_self_fullelect_les (nonbonded *)
 
static void calc_self_energy_fullelect_les (nonbonded *)
 
static void calc_self_merge_fullelect_les (nonbonded *)
 
static void calc_self_energy_merge_fullelect_les (nonbonded *)
 
static void calc_self_slow_fullelect_les (nonbonded *)
 
static void calc_self_energy_slow_fullelect_les (nonbonded *)
 
static void calc_pair_energy_int (nonbonded *)
 
static void calc_pair_energy_fullelect_int (nonbonded *)
 
static void calc_pair_energy_merge_fullelect_int (nonbonded *)
 
static void calc_self_energy_int (nonbonded *)
 
static void calc_self_energy_fullelect_int (nonbonded *)
 
static void calc_self_energy_merge_fullelect_int (nonbonded *)
 
static void calc_pair_pprof (nonbonded *)
 
static void calc_pair_energy_pprof (nonbonded *)
 
static void calc_pair_fullelect_pprof (nonbonded *)
 
static void calc_pair_energy_fullelect_pprof (nonbonded *)
 
static void calc_pair_merge_fullelect_pprof (nonbonded *)
 
static void calc_pair_energy_merge_fullelect_pprof (nonbonded *)
 
static void calc_pair_slow_fullelect_pprof (nonbonded *)
 
static void calc_pair_energy_slow_fullelect_pprof (nonbonded *)
 
static void calc_self_pprof (nonbonded *)
 
static void calc_self_energy_pprof (nonbonded *)
 
static void calc_self_fullelect_pprof (nonbonded *)
 
static void calc_self_energy_fullelect_pprof (nonbonded *)
 
static void calc_self_merge_fullelect_pprof (nonbonded *)
 
static void calc_self_energy_merge_fullelect_pprof (nonbonded *)
 
static void calc_self_slow_fullelect_pprof (nonbonded *)
 
static void calc_self_energy_slow_fullelect_pprof (nonbonded *)
 
static void calc_pair_tabener (nonbonded *)
 
static void calc_pair_energy_tabener (nonbonded *)
 
static void calc_pair_fullelect_tabener (nonbonded *)
 
static void calc_pair_energy_fullelect_tabener (nonbonded *)
 
static void calc_pair_merge_fullelect_tabener (nonbonded *)
 
static void calc_pair_energy_merge_fullelect_tabener (nonbonded *)
 
static void calc_pair_slow_fullelect_tabener (nonbonded *)
 
static void calc_pair_energy_slow_fullelect_tabener (nonbonded *)
 
static void calc_self_tabener (nonbonded *)
 
static void calc_self_energy_tabener (nonbonded *)
 
static void calc_self_fullelect_tabener (nonbonded *)
 
static void calc_self_energy_fullelect_tabener (nonbonded *)
 
static void calc_self_merge_fullelect_tabener (nonbonded *)
 
static void calc_self_energy_merge_fullelect_tabener (nonbonded *)
 
static void calc_self_slow_fullelect_tabener (nonbonded *)
 
static void calc_self_energy_slow_fullelect_tabener (nonbonded *)
 
static void calc_pair_go (nonbonded *)
 
static void calc_pair_energy_go (nonbonded *)
 
static void calc_pair_fullelect_go (nonbonded *)
 
static void calc_pair_energy_fullelect_go (nonbonded *)
 
static void calc_pair_merge_fullelect_go (nonbonded *)
 
static void calc_pair_energy_merge_fullelect_go (nonbonded *)
 
static void calc_pair_slow_fullelect_go (nonbonded *)
 
static void calc_pair_energy_slow_fullelect_go (nonbonded *)
 
static void calc_self_go (nonbonded *)
 
static void calc_self_energy_go (nonbonded *)
 
static void calc_self_fullelect_go (nonbonded *)
 
static void calc_self_energy_fullelect_go (nonbonded *)
 
static void calc_self_merge_fullelect_go (nonbonded *)
 
static void calc_self_energy_merge_fullelect_go (nonbonded *)
 
static void calc_self_slow_fullelect_go (nonbonded *)
 
static void calc_self_energy_slow_fullelect_go (nonbonded *)
 

Static Public Attributes

static void(* calcPair )(nonbonded *)
 
static void(* calcPairEnergy )(nonbonded *)
 
static void(* calcSelf )(nonbonded *)
 
static void(* calcSelfEnergy )(nonbonded *)
 
static void(* calcFullPair )(nonbonded *)
 
static void(* calcFullPairEnergy )(nonbonded *)
 
static void(* calcFullSelf )(nonbonded *)
 
static void(* calcFullSelfEnergy )(nonbonded *)
 
static void(* calcMergePair )(nonbonded *)
 
static void(* calcMergePairEnergy )(nonbonded *)
 
static void(* calcMergeSelf )(nonbonded *)
 
static void(* calcMergeSelfEnergy )(nonbonded *)
 
static void(* calcSlowPair )(nonbonded *)
 
static void(* calcSlowPairEnergy )(nonbonded *)
 
static void(* calcSlowSelf )(nonbonded *)
 
static void(* calcSlowSelfEnergy )(nonbonded *)
 
static Bool commOnly
 
static Bool fixedAtomsOn
 
static Bool qmForcesOn
 
static BigReal cutoff
 
static BigReal cutoff2
 
static float cutoff2_f
 
static BigReal dielectric_1
 
static const LJTableljTable = 0
 
static const Moleculemol
 
static BigReal r2_delta
 
static BigReal r2_delta_1
 
static int rowsize
 
static int columnsize
 
static int r2_delta_exp
 
static BigRealtable_alloc = 0
 
static BigRealtable_ener = 0
 
static BigRealtable_short
 
static BigRealtable_noshort
 
static BigRealfast_table
 
static BigRealscor_table
 
static BigRealslow_table
 
static BigRealcorr_table
 
static BigRealfull_table
 
static BigRealvdwa_table
 
static BigRealvdwb_table
 
static BigRealr2_table
 
static int table_length
 
static BigReal scaling
 
static BigReal scale14
 
static BigReal switchOn
 
static BigReal switchOn_1
 
static BigReal switchOn2
 
static BigReal v_vdwa
 
static BigReal v_vdwb
 
static BigReal k_vdwa
 
static BigReal k_vdwb
 
static BigReal cutoff_3
 
static BigReal cutoff_6
 
static float v_vdwa_f
 
static float v_vdwb_f
 
static float k_vdwa_f
 
static float k_vdwb_f
 
static float cutoff_3_f
 
static float cutoff_6_f
 
static float switchOn_f
 
static float A6_f
 
static float B6_f
 
static float C6_f
 
static float A12_f
 
static float B12_f
 
static float C12_f
 
static BigReal c0
 
static BigReal c1
 
static BigReal c3
 
static BigReal c5
 
static BigReal c6
 
static BigReal c7
 
static BigReal c8
 
static Bool alchFepOn
 
static Bool alchThermIntOn
 
static Bool alchWCAOn
 
static BigReal alchVdwShiftCoeff
 
static Bool vdwForceSwitching
 
static Bool alchDecouple
 
static Bool lesOn
 
static int lesFactor
 
static BigReal lesScaling
 
static BigReallambda_table = 0
 
static Bool pairInteractionOn
 
static Bool pairInteractionSelf
 
static Bool pressureProfileOn
 
static int pressureProfileSlabs
 
static int pressureProfileAtomTypes
 
static BigReal pressureProfileThickness
 
static BigReal pressureProfileMin
 
static Bool accelMDOn
 
static Bool drudeNbthole
 
static BigReal ewaldcof
 
static BigReal pi_ewaldcof
 
static int vdw_switch_mode
 
static Bool goGroPair
 
static Bool goForcesOn
 
static int goMethod
 

Detailed Description

Definition at line 243 of file ComputeNonbondedUtil.h.

Member Enumeration Documentation

anonymous enum
Enumerator
exclChecksumIndex 
pairlistWarningIndex 
electEnergyIndex 
fullElectEnergyIndex 
vdwEnergyIndex 
goNativeEnergyIndex 
goNonnativeEnergyIndex 
groLJEnergyIndex 
groGaussEnergyIndex 
electEnergyIndex_s 
fullElectEnergyIndex_s 
vdwEnergyIndex_s 
electEnergyIndex_ti_1 
fullElectEnergyIndex_ti_1 
vdwEnergyIndex_ti_1 
electEnergyIndex_ti_2 
fullElectEnergyIndex_ti_2 
vdwEnergyIndex_ti_2 
TENSOR 
TENSOR 
VECTOR 
VECTOR 
reductionDataSize 

Definition at line 272 of file ComputeNonbondedUtil.h.

275 //sd-db
279 //sd-de
280  TENSOR(virialIndex), TENSOR(fullElectVirialIndex),
281  VECTOR(pairVDWForceIndex), VECTOR(pairElectForceIndex),

Constructor & Destructor Documentation

ComputeNonbondedUtil::ComputeNonbondedUtil ( )
inline

Definition at line 247 of file ComputeNonbondedUtil.h.

247 {}
ComputeNonbondedUtil::~ComputeNonbondedUtil ( )
inline

Definition at line 248 of file ComputeNonbondedUtil.h.

248 {}

Member Function Documentation

void ComputeNonbondedUtil::calc_error ( nonbonded )
static

Definition at line 249 of file ComputeNonbondedUtil.C.

References NAMD_bug().

Referenced by select().

249  {
250  NAMD_bug("Tried to call missing nonbonded compute routine.");
251 }
void NAMD_bug(const char *err_msg)
Definition: common.C:123
static void ComputeNonbondedUtil::calc_pair ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_fep ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_fullelect ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_fullelect_fep ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_fullelect_go ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_fullelect_int ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_fullelect_les ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_fullelect_pprof ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_fullelect_tabener ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_fullelect_ti ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_go ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_int ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_les ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_merge_fullelect ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_merge_fullelect_fep ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_merge_fullelect_go ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_merge_fullelect_int ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_merge_fullelect_les ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_merge_fullelect_pprof ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_merge_fullelect_tabener ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_merge_fullelect_ti ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_pprof ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_slow_fullelect ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_slow_fullelect_fep ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_slow_fullelect_go ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_slow_fullelect_les ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_slow_fullelect_pprof ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_slow_fullelect_tabener ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_slow_fullelect_ti ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_tabener ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_energy_ti ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_fullelect ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_fullelect_go ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_fullelect_les ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_fullelect_pprof ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_fullelect_tabener ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_fullelect_ti ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_go ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_les ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_merge_fullelect ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_merge_fullelect_go ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_merge_fullelect_les ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_merge_fullelect_pprof ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_merge_fullelect_tabener ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_merge_fullelect_ti ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_pprof ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_slow_fullelect ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_slow_fullelect_go ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_slow_fullelect_les ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_slow_fullelect_pprof ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_slow_fullelect_tabener ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_slow_fullelect_ti ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_tabener ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_pair_ti ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_fep ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_fullelect ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_fullelect_fep ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_fullelect_go ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_fullelect_int ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_fullelect_les ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_fullelect_pprof ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_fullelect_tabener ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_fullelect_ti ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_go ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_int ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_les ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_merge_fullelect ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_merge_fullelect_fep ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_merge_fullelect_go ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_merge_fullelect_int ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_merge_fullelect_les ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_merge_fullelect_pprof ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_merge_fullelect_tabener ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_merge_fullelect_ti ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_pprof ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_slow_fullelect ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_slow_fullelect_fep ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_slow_fullelect_go ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_slow_fullelect_les ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_slow_fullelect_pprof ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_slow_fullelect_tabener ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_slow_fullelect_ti ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_tabener ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_energy_ti ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_fullelect ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_fullelect_go ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_fullelect_les ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_fullelect_pprof ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_fullelect_tabener ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_fullelect_ti ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_go ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_les ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_merge_fullelect ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_merge_fullelect_go ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_merge_fullelect_les ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_merge_fullelect_pprof ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_merge_fullelect_tabener ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_merge_fullelect_ti ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_pprof ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_slow_fullelect ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_slow_fullelect_go ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_slow_fullelect_les ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_slow_fullelect_pprof ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_slow_fullelect_tabener ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_slow_fullelect_ti ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_tabener ( nonbonded )
static

Referenced by select().

static void ComputeNonbondedUtil::calc_self_ti ( nonbonded )
static

Referenced by select().

void ComputeNonbondedUtil::calcGBIS ( nonbonded params,
GBISParamStruct gbisParams 
)

Definition at line 261 of file ComputeGBIS.C.

References GBISParamStruct::a_cut, GBISParamStruct::bornRad, CalcDHPair(), CalcHPair(), CompAtom::charge, COULOMB, GBISParamStruct::cutoff, DA, DB, DC, DD, DE, GBISParamStruct::dEdaSum, GBISParamStruct::dHdrPrefix, GBISParamStruct::doEnergy, GBISParamStruct::doFullElectrostatics, GBISParamStruct::doSmoothing, GBISParamStruct::epsilon_p, GBISParamStruct::epsilon_s, nonbonded::ff, FS_MAX, nonbonded::fullf, GBISParamStruct::gbInterEnergy, GBISParamStruct::gbisPhase, GBISParamStruct::gbisStepPairlists, GBISParamStruct::gbSelfEnergy, h1(), h2(), CompAtomExt::id, GBISParamStruct::intRad, GBISParamStruct::kappa, nonbonded::minPart, Pairlists::nextlist(), CompAtom::nonbondedGroupSize, nonbonded::numAtoms, nonbonded::numParts, GBISParamStruct::numPatches, nonbonded::offset, nonbonded::p, pairlistFromAll(), nonbonded::pExt, CompAtom::position, GBISParamStruct::psiSum, Pairlists::reset(), scaling, GBISParamStruct::sequence, TA, TB, TC, TD, TE, Vector::x, Vector::y, Vector::z, and ZERO.

Referenced by ComputeNonbondedPair::doForce(), and ComputeNonbondedSelf::doForce().

261  {
262 //CkPrintf("SEQ%03i, P%i, CID%05i(%02i,%02i) ENTER\n",gbisParams->sequence,gbisParams->gbisPhase,gbisParams->cid,gbisParams->patchID[0],gbisParams->patchID[1]);
263 #if CHECK_PRIORITIES
264 CkPrintf("PE%i, S%09i, P%i\n",CkMyPe(),gbisParams->sequence,gbisParams->gbisPhase);
265 #endif
266  if (params->numAtoms[0] == 0 || params->numAtoms[1] == 0) return;
267 
268  const BigReal offset_x = params->offset.x;
269  const BigReal offset_y = params->offset.y;
270  const BigReal offset_z = params->offset.z;
271 
272  int partSize = params->numAtoms[0] / params->numParts;
273  int minIg = 0;
274  for (int s = 0; s < params->minPart; s++) {
275  minIg+=params->p[0][minIg].nonbondedGroupSize;
276  }
277  int maxI = params->numAtoms[0];
278  int strideIg = params->numParts;
279 
280  int unique = (gbisParams->numPatches == 1) ? 1 : 0;//should inner loop be unique from ourter loop
281  int numGBISPairlists = 4;
282  float r_cut = gbisParams->cutoff;
283  float fsMax = FS_MAX; // gbisParams->fsMax;//FS_MAX;
284  float a_cut = gbisParams->a_cut-fsMax;
285  float a_cut2 = a_cut*a_cut;
286  float a_cut_ps = a_cut + fsMax;//max screen radius
287  float r_cut2 = r_cut*r_cut;
288  float a_cut_ps2 = a_cut_ps*a_cut_ps;
289  //put PL pointer back to beginning of lists
290  for (int k = 0; k < numGBISPairlists; k++)
291  gbisParams->gbisStepPairlists[k]->reset();
292 
293 
294 /***********************************************************
295 * GBIS Phase 1
296 ***********************************************************/
297 if (gbisParams->gbisPhase == 1) {
298 //CkPrintf("SEQ%03i, P%i, CID%05i(%02i,%02i):[%03i,%03i]\n",gbisParams->sequence,gbisParams->gbisPhase,gbisParams->cid,gbisParams->patchID[0],gbisParams->patchID[1],minI,maxI);
299 
300  pairlistFromAll(params,gbisParams,minIg,strideIg,maxI);
301 
302 #ifdef BENCHMARK
303  int nops = 0;
304  int domains[] = {0, 0, 0, 0, 0, 0, 0, 0};
305  int numDom = 7;
306  double t1 = 1.0*clock()/CLOCKS_PER_SEC;
307 #endif
308  register GBReal psiI;
309 
310  register float dr;
311  register float r2;
312  register float r, r_i, r2_i;
313  float rhoi0, rhois, rhojs, rhoj0;
314  Position ri, rj;
315  register int j;
316  int numPairs;
317  register float ta = TA;
318  register float tb = TB;
319  register float tc = TC;
320  register float td = TD;
321  register float te = TE;
322 
323  register float hij,hji;
324  int dij,dji;
325  float k;
326  float rhois2, rhojs2;
327 
328  //calculate piecewise-22 Pairs
329  int c = 0;
330  for (int ngi = minIg; ngi < maxI; ) {
331  int iGroupSize = params->p[0][ngi].nonbondedGroupSize;
332  for (int i = ngi; i < ngi+iGroupSize; i++) {
333  ri = params->p[0][i].position;
334  ri.x += offset_x;
335  ri.y += offset_y;
336  ri.z += offset_z;
337  rhoi0 = gbisParams->intRad[0][2*i+0];
338  rhois = gbisParams->intRad[0][2*i+1];
339  rhois2 = rhois*rhois;
340  psiI = ZERO;
341  plint *pairs;
342  gbisParams->gbisStepPairlists[c]->nextlist(&pairs,&numPairs);
343  for (register int jj = 0; jj < numPairs; jj++) {
344 #ifdef BENCHMARK
345  nops++;
346 #endif
347  j = pairs[jj];
348  rj = params->p[1][j].position;
349 
350  dr = (ri.x - rj.x);
351  r2 = dr*dr;
352  dr = (ri.y - rj.y);
353  r2 += dr*dr;
354  dr = (ri.z - rj.z);
355  r2 += dr*dr;
356  r2_i = 1.0/r2;
357 
358  rhoj0 = gbisParams->intRad[1][2*j+0];
359  rhojs = gbisParams->intRad[1][2*j+1];
360  rhojs2 = rhojs*rhojs;
361 
362  k = rhojs2*r2_i;//k=(rs/r)^2
363  hij = rhojs*r2_i*k*(ta+k*(tb+k*(tc+k*(td+k*te))));
364 
365  k = rhois2*r2_i;//k=(rs/r)^2
366  hji = rhois*r2_i*k*(ta+k*(tb+k*(tc+k*(td+k*te))));
367 
368 //#if 1
369 #ifdef PRINT_COMP
370  int id1 = params->pExt[0][i].id;
371  int id2 = params->pExt[1][j].id;
372  float h1 = hij;
373  float h2 = hji;
374  float r10 = rhoi0;
375  float r1s = rhojs;
376  float r20 = rhoj0;
377  float r2s = rhois;
378 /*printf("PSIPAIR %05i %05i%9.5f%6.3f%6.3f%2i% 13.5e\n",
379 id1,id2,sqrt(r2),
380 rhoi0, rhojs,
381 2,hij);
382 printf("PSIPAIR %05i %05i%9.5f%6.3f%6.3f%2i% 13.5e\n",
383 id2,id1,sqrt(r2),
384 rhoj0, rhois,
385 2,hji);
386 */
387  if (id1 > id2) {
388  int tmp = id1;
389  id1 = id2;
390  id2 = tmp;
391  h1 = hji;
392  h2 = hij;
393  r20 = rhoi0;
394  r2s = rhojs;
395  r10 = rhoj0;
396  r1s = rhois;
397  }
398 // CkPrintf("PSIPAIR%5i%5i%10.5f%5i%14.8f%7.4f%7.4f\n",id1,id2,sqrt(r2),2,h1,r10,r1s);
399 // CkPrintf("PSIPAIR%5i%5i%10.5f%5i%14.8f%7.4f%7.4f\n",id2,id1,sqrt(r2),2,h2,r20,r2s);
400  //CkPrintf("PPSI(%04i)[%04i,%04i] = 22\n",gbisParams->cid,id1,id2);
401 #endif
402 
403  psiI += hij;
404  gbisParams->psiSum[1][j] += hji;
405  }//end inner j
406  gbisParams->psiSum[0][i] += psiI;
407  }//end outer i
408  for (int s = 0; s < strideIg; s++) {
409  ngi+=params->p[0][ngi].nonbondedGroupSize;
410  }
411  }
412 #ifdef BENCHMARK
413  double t2 = 1.0*clock()/CLOCKS_PER_SEC;
414  //nops *= (9 + 2*DIV_FLOPS+SQRT_FLOPS) + (14 + 0*DIV_FLOPS + 0*LOG_FLOPS);
415  //double flops = 1.0 * nops / (t2 - t1);
416  //double gflops = flops / 1000000000.0;
417  CkPrintf("PHASE1.1: %8.3f ms @ %8.3f ns/iter for %i iter\n",1000.0*(t2-t1), 1000000000.0*(t2-t1)/nops, nops);
418 nops = 0;
419  t1 = 1.0*clock()/CLOCKS_PER_SEC;
420  nops = 0;
421 #endif
422 
423  float rmris, rmrjs;
424  float rmrsi;
425  float rmrs2;
426  float rs2;
427  float logri, logrj;
428  float rci2;
429  float a_cut_i = 1.0 / a_cut;
430  float a_cut_i2 = a_cut_i*a_cut_i;
431 
432  //calculate piecewise-11 pairs
433  c = 1;
434  for (int ngi = minIg; ngi < maxI; ) {
435  int iGroupSize = params->p[0][ngi].nonbondedGroupSize;
436  for (int i = ngi; i < ngi+iGroupSize; i++) {
437  ri = params->p[0][i].position;
438  ri.x += offset_x;
439  ri.y += offset_y;
440  ri.z += offset_z;
441  rhoi0 = gbisParams->intRad[0][2*i+0];
442  rhois = gbisParams->intRad[0][2*i+1];
443  psiI = ZERO;
444  plint *pairs;
445  gbisParams->gbisStepPairlists[c]->nextlist(&pairs,&numPairs);
446  for (register int jj = 0; jj < numPairs; jj++) {
447  j = pairs[jj];
448  rj = params->p[1][j].position;
449 
450  dr = (ri.x - rj.x);
451  r2 = dr*dr;
452  dr = (ri.y - rj.y);
453  r2 += dr*dr;
454  dr = (ri.z - rj.z);
455  r2 += dr*dr;
456  r_i = 1.0/sqrt(r2);
457  r = r2*r_i;
458 
459  rhoj0 = gbisParams->intRad[1][2*j+0];
460  rhojs = gbisParams->intRad[1][2*j+1];
461 
462  float tmp1 = 0.125*r_i;
463  float tmp2 = r2 - 4.0*a_cut*r;
464  float rr = 2.0*r;
465 
466 
467  rmrjs = r-rhojs;
468  rmris = r-rhois;
469  logri = log(rmris*a_cut_i);
470  logrj = log(rmrjs*a_cut_i);
471 
472  rmrsi = 1.0/rmrjs;
473  //rmrs2 = rmrjs*rmrjs;
474  rs2 = rhojs*rhojs;
475  hij = /*0.125*r_i*/tmp1*(1 + rr*rmrsi +
476  a_cut_i2*(/*r2 - 4.0*a_cut*r*/tmp2 - rs2) + logrj+logrj);
477 
478 
479  rmrsi = 1.0/rmris;
480  //rmrs2 = rmris*rmris;
481  rs2 = rhois*rhois;
482  hji = /*0.125*r_i*/tmp1*(1 + rr*rmrsi +
483  a_cut_i2*(/*r2 - 4.0*a_cut*r*/tmp2 - rs2) + 2.0* logri);
484 //#if 1
485 #ifdef PRINT_COMP
486  int id1 = params->pExt[0][i].id;
487  int id2 = params->pExt[1][j].id;
488  float h1 = hij;
489  float h2 = hji;
490  float r10 = rhoi0;
491  float r1s = rhojs;
492  float r20 = rhoj0;
493  float r2s = rhois;
494 /*printf("PSIPAIR %05i %05i%9.5f%6.3f%6.3f%2i% 13.5e\n",
495 id1,id2,sqrt(r2),
496 rhoi0, rhojs,
497 1,hij);
498 printf("PSIPAIR %05i %05i%9.5f%6.3f%6.3f%2i% 13.5e\n",
499 id2,id1,sqrt(r2),
500 rhoj0, rhois,
501 1,hji);*/
502  if (id1 > id2) {
503  int tmp = id1;
504  id1 = id2;
505  id2 = tmp;
506  h1 = hji;
507  h2 = hij;
508  r20 = rhoi0;
509  r2s = rhojs;
510  r10 = rhoj0;
511  r1s = rhois;
512  }
513 // CkPrintf("PSIPAIR%5i%5i%10.5f%5i%14.8f%7.4f%7.4f\n",id1,id2,sqrt(r2),1,h1,r10,r1s);
514 // CkPrintf("PSIPAIR%5i%5i%10.5f%5i%14.8f%7.4f%7.4f\n",id2,id1,sqrt(r2),1,h2,r20,r2s);
515  //CkPrintf("PSI(%04i)[%04i,%04i] = 11 % .4e % .4e\n",gbisParams->sequence,id1,id2,h1, h2);
516  //CkPrintf("PPSI(%04i)[%04i,%04i] = 11\n",gbisParams->cid,id1,id2);
517 #endif
518 
519 #ifdef BENCHMARK
520  nops++;
521 #endif
522 
523  psiI += hij;
524  gbisParams->psiSum[1][j] += hji;
525  }//end inner j
526  gbisParams->psiSum[0][i] += psiI;
527  }//end outer i
528  for (int s = 0; s < strideIg; s++) {
529  ngi+=params->p[0][ngi].nonbondedGroupSize;
530  }
531  }
532 #ifdef BENCHMARK
533  t2 = 1.0*clock()/CLOCKS_PER_SEC;
534  CkPrintf("PHASE1.2: %8.3f ms @ %8.3f ns/iter for %i iter\n",1000.0*(t2-t1), 1000000000.0*(t2-t1)/nops, nops);
535 nops = 0;
536  t1 = 1.0*clock()/CLOCKS_PER_SEC;
537  nops = 0;
538 #endif
539 
540  //calculate all other piecewise pairs
541  c = 2;
542  for (int ngi = minIg; ngi < maxI; ) {
543  int iGroupSize = params->p[0][ngi].nonbondedGroupSize;
544  for (int i = ngi; i < ngi+iGroupSize; i++) {
545  ri = params->p[0][i].position;
546  ri.x += offset_x;
547  ri.y += offset_y;
548  ri.z += offset_z;
549  rhoi0 = gbisParams->intRad[0][2*i+0];
550  rhois = gbisParams->intRad[0][2*i+1];
551  psiI = ZERO;
552  plint *pairs;
553  gbisParams->gbisStepPairlists[c]->nextlist(&pairs,&numPairs);
554  for (register int jj = 0; jj < numPairs; jj++) {
555  j = pairs[jj];
556  rj = params->p[1][j].position;
557 
558  dr = (ri.x - rj.x);
559  r2 = dr*dr;
560  dr = (ri.y - rj.y);
561  r2 += dr*dr;
562  dr = (ri.z - rj.z);
563  r2 += dr*dr;
564  rhojs = gbisParams->intRad[1][2*j+1];
565  rhoj0 = gbisParams->intRad[1][2*j+0];
566  r_i = 1.0/sqrt(r2);
567  r = r2 * r_i;
568 
569  CalcHPair(r,r2,r_i,a_cut,
570  rhoi0, rhojs,
571  rhoj0, rhois,
572  dij,dji,hij,hji);
573 //#if 1
574 #ifdef PRINT_COMP
575  int id1 = params->pExt[0][i].id;
576  int id2 = params->pExt[1][j].id;
577  float h1 = hij;
578  float h2 = hji;
579  int d1 = dij;
580  int d2 = dji;
581  float r10 = rhoi0;
582  float r1s = rhojs;
583  float r20 = rhoj0;
584  float r2s = rhois;
585 /* if (dij > 0 ) {
586 printf("PSIPAIR %05i %05i%9.5f%6.3f%6.3f%2i% 13.5e\n",
587 id1,id2,sqrt(r2),
588 rhoi0, rhojs,
589 dij,hij);
590  }
591  if (dji > 0 ) {
592 printf("PSIPAIR %05i %05i%9.5f%6.3f%6.3f%2i% 13.5e\n",
593 id2,id1,sqrt(r2),
594 rhoj0, rhois,
595 dji,hji);
596  }*/
597 // CkPrintf("PSIPAIR%5i%5i%10.5f%5i%14.8f%7.4f%7.4f\n",id1,id2,sqrt(r2),d1,h1,r10,r1s);
598  if (id1 > id2) {
599  int tmp = id1;
600  id1 = id2;
601  id2 = tmp;
602  h1 = hji;
603  h2 = hij;
604  d1 = dji;
605  d2 = dij;
606  r20 = rhoi0;
607  r2s = rhojs;
608  r10 = rhoj0;
609  r1s = rhois;
610  }
611 // CkPrintf("PSIPAIR%5i%5i%10.5f%5i%14.8f%7.4f%7.4f\n",id2,id1,sqrt(r2),d2,h2,r20,r2s);
612  //CkPrintf("PSI(%04i)[%04i,%04i] = %i%i % .4e % .4e\n",gbisParams->sequence,id1,id2,d1,d2,h1, h2);
613  //CkPrintf("PPSI(%04i)[%04i,%04i] = %i%i\n",gbisParams->cid,id1,id2,d1,d2);
614 #endif
615 
616 #ifdef BENCHMARK
617  nops++;
618 #endif
619  psiI += hij;
620  gbisParams->psiSum[1][j] += hji;
621  }//end inner j
622  gbisParams->psiSum[0][i] += psiI;
623  }//end outer i
624  for (int s = 0; s < strideIg; s++) {
625  ngi+=params->p[0][ngi].nonbondedGroupSize;
626  }
627  }
628 
629 #ifdef BENCHMARK
630  t2 = 1.0*clock()/CLOCKS_PER_SEC;
631  CkPrintf("PHASE1.3: %8.3f ms @ %8.3f ns/iter for %i iter\n",1000.0*(t2-t1), 1000000000.0*(t2-t1)/nops,nops);
632 #endif
633 
634 /***********************************************************
635 * GBIS Phase 2
636 ***********************************************************/
637 } else if (gbisParams->gbisPhase == 2) {
638 
639  float epsilon_s = gbisParams->epsilon_s;
640  float epsilon_p = gbisParams->epsilon_p;
641  float epsilon_s_i = 1/epsilon_s;
642  float epsilon_p_i = 1/epsilon_p;
643  float kappa = gbisParams->kappa;
644 
645  //values used in loop
646  float r_cut_2 = 1.0 / r_cut2;
647  float r_cut_4 = 4.0*r_cut_2*r_cut_2;
648  float coulEij=0,ddrCoulEij=0,gbEij=0,ddrGbEij=0;
649  float dEdai=0,dEdaj=0, qiqj=0;
650  float scale=0, ddrScale=0;
651  float rnx=0,rny=0,rnz=0;
652  float fx=0,fy=0,fz=0,forceCoul=0, forcedEdr=0;
653 
654  int nops = 0;
655  double t1 = 1.0*clock()/CLOCKS_PER_SEC;
656  float r2;
657  float dr;
658  BigReal dx, dy, dz;
659  float r, r_i, ratio;
660  float fIx, fIy, fIz;
661  GBReal dEdaSumI;
662  float bornRadI, bornRadJ;
663  float qi;
664  Position ri, rj;
665  float aiaj,expr2aiaj4,fij,f_i,expkappa,Dij;
666  float aiaj4,ddrDij,ddrf_i,ddrfij,tmp_dEda;
667 
668  for (int c = 0; c < 4/*dEdrPLs*/; c++) {
669  for (int ngi = minIg; ngi < maxI; ) {
670  int iGroupSize = params->p[0][ngi].nonbondedGroupSize;
671  for (int i = ngi; i < ngi+iGroupSize; i++) {
672  ri = params->p[0][i].position;
673  ri.x += offset_x;
674  ri.y += offset_y;
675  ri.z += offset_z;
676  qi = - COULOMB * params->p[0][i].charge * scaling;
677  //printf("ATOM(%05i) %.3e %.3e %.3e\n", params->pExt[0][i].id, params->p[0][i].charge, COULOMB, scaling);
678  int numPairs;
679  plint *pairs;
680  gbisParams->gbisStepPairlists[c]->nextlist(&pairs,&numPairs);
681  fIx = fIy = fIz = 0.0;
682  dEdaSumI = 0.0;
683  bornRadI = gbisParams->bornRad[0][i];
684  for (int jj = 0; jj < numPairs; jj++) {
685  int j = pairs[jj];
686  rj = params->p[1][j].position;
687 
688  //distance
689  dx = (ri.x - rj.x);
690  dy = (ri.y - rj.y);
691  dz = (ri.z - rj.z);
692  r2 = dx*dx + dy*dy + dz*dz;
693  if (r2 > r_cut2) continue;
694  qiqj = qi*params->p[1][j].charge;
695  bornRadJ = gbisParams->bornRad[1][j];
696  r_i = 1.0/sqrt(r2);
697  r = r2 * r_i;
698 
699  //pairwise calculation
700 /* Phase2_Pair(r, r2, r_i, qiqj,
701  bornRadI,
702  bornRadJ,
703  epsilon_p_i, epsilon_s_i,
704  kappa, gbisParams->doFullElectrostatics,
705  gbEij, ddrGbEij, dEdai, dEdaj);
706 */
707 
708  //calculate GB energy
709  aiaj = bornRadI*bornRadJ;
710  aiaj4 = 4*aiaj;
711  expr2aiaj4 = exp(-r2/aiaj4);
712  fij = sqrt(r2+aiaj*expr2aiaj4);
713  f_i = 1/fij;
714  expkappa = (kappa > 0) ? exp(-kappa*fij) : 1.0;
715  Dij = epsilon_p_i - expkappa*epsilon_s_i;
716  gbEij = qiqj*Dij*f_i;
717 
718  //calculate energy derivatives
719  ddrfij = r*f_i*(1 - 0.25*expr2aiaj4);
720  ddrf_i = -ddrfij*f_i*f_i;
721  ddrDij = kappa*expkappa*ddrfij*epsilon_s_i;
722  ddrGbEij = qiqj*(ddrDij*f_i+Dij*ddrf_i);
723 
724  //calc dEda
725  //NAMD smoothing function
726  scale = 1;
727  ddrScale = 0;
728  if (gbisParams->doSmoothing) {
729  scale = r2 * r_cut_2 - 1;
730  scale *= scale;
731  ddrScale = r*(r2-r_cut2)*r_cut_4;
732  //CkPrintf("SCALE %f %f\n",scale,ddrScale);
733  gbisParams->gbInterEnergy += gbEij * scale;
734  forcedEdr = -(ddrGbEij)*scale-(gbEij)*ddrScale;
735  } else {
736  gbisParams->gbInterEnergy += gbEij;
737  forcedEdr = -ddrGbEij;
738  }
739 
740  //add dEda
741  if (gbisParams->doFullElectrostatics) {
742  //gbisParams->dEdaSum[0][i] += dEdai*scale;
743  tmp_dEda = 0.5*qiqj*f_i*f_i
744  *(kappa*epsilon_s_i*expkappa-Dij*f_i)
745  *(aiaj+0.25*r2)*expr2aiaj4;//0
746  dEdai = tmp_dEda/bornRadI;
747  dEdaj = tmp_dEda/bornRadJ;
748  dEdaSumI += dEdai*scale;
749  gbisParams->dEdaSum[1][j] += dEdaj*scale;
750  }
751 
752 #if 1
753 //#ifdef PRINT_COMP
754  int id1 = params->pExt[0][i].id;
755  int id2 = params->pExt[1][j].id;
756  float deda1 = dEdai;
757  float deda2 = dEdaj;
758  float bR1 = bornRadI;
759  float bR2 = bornRadJ;
760  if (id1 > id2) {
761  int tmp = id1;
762  id1 = id2;
763  id2 = tmp;
764  deda1 = dEdaj;
765  deda2 = dEdai;
766  bR1 = bornRadJ;
767  bR2 = bornRadI;
768  }
769  //CkPrintf("DEDR(%04i)[%04i,%04i] = % .4e\n",gbisParams->sequence,id1,id2,forcedEdr);
770  //CkPrintf("DASM(%04i)[%04i,%04i] = % .4e % .4e\n",gbisParams->sequence,id1, id2, deda1,deda2);
771  //CkPrintf("P2RM(%04i)[%04i,%04i] = % .4e % .4e % .4e % .4e % .4e\n",gbisParams->sequence,id1, id2, r, bR1,bR2,epsilon_p_i,epsilon_s_i,kappa);
772 /*CkPrintf("P2PAIR %05i %05i%9.5f%6.3f%6.3f% 13.5e% 13.5e% 13.5e% 13.5e% 13.5e\n",
773 params->pExt[0][i].id, params->pExt[1][j].id,sqrt(r2),
774 bornRadI, bornRadJ, forcedEdr, dEdai, qiqj, Dij, scale
775 );
776 CkPrintf("P2PAIR %05i %05i%9.5f%6.3f%6.3f% 13.5e% 13.5e% 13.5e% 13.5e% 13.5e\n",
777 params->pExt[1][j].id, params->pExt[0][i].id,sqrt(r2),
778 bornRadJ, bornRadI, forcedEdr, dEdaj, qiqj, Dij, scale
779 );*/
780 #endif
781 
782  forcedEdr *= r_i;
783  fx = dx*forcedEdr;
784  fy = dy*forcedEdr;
785  fz = dz*forcedEdr;
786 
787  params->ff[1][j].x -= fx;
788  params->ff[1][j].y -= fy;
789  params->ff[1][j].z -= fz;
790 
791  fIx += fx;
792  fIy += fy;
793  fIz += fz;
794 
795 #ifdef BENCHMARK
796  nops ++;//= (59 + 4*DIV_FLOPS + 2*EXP_FLOPS+SQRT_FLOPS);//56 w/o nops
797 #endif
798 
799  }//end inner j
800  gbisParams->dEdaSum[0][i] += dEdaSumI;
801  params->ff[0][i].x += fIx;
802  params->ff[0][i].y += fIy;
803  params->ff[0][i].z += fIz;
804 
805  //self energy of each atom
806  if (c == 0 && gbisParams->doEnergy && gbisParams->numPatches == 1) {
807  float fij = bornRadI;//inf
808  float expkappa = exp(-kappa*fij);//0
809  float Dij = epsilon_p_i - expkappa*epsilon_s_i;
810  float gbEij = qi*params->p[0][i].charge*Dij/fij;
811  gbisParams->gbSelfEnergy += 0.5*gbEij;//self energy
812  }
813  }// end outer i
814  for (int s = 0; s < strideIg; s++) {
815  ngi+=params->p[0][ngi].nonbondedGroupSize;
816  }//end i
817  }//end ig
818  }//end c
819 #ifdef BENCHMARK
820  double t2 = 1.0*clock()/CLOCKS_PER_SEC;
821  //double flops = 1.0 * nops / (t2 - t1);
822  //double gflops = flops / 1000000000.0;
823 
824  CkPrintf("PHASE2.0: %8.3f ms @ %8.3f ns/iter for %i iter\n",1000.0*(t2-t1), 1000000000.0*(t2-t1)/nops,nops);
825 #endif
826 
827 /***********************************************************
828 * GBIS Phase 3
829 ***********************************************************/
830 } else if (gbisParams->gbisPhase == 3 && gbisParams->doFullElectrostatics) {
831 
832 #ifdef BENCHMARK
833  //int domains[] = {0, 0, 0, 0, 0, 0, 0, 0};
834  double t1 = 1.0*clock()/CLOCKS_PER_SEC;
835  double t2;
836  int nops = 0;
837 #endif
838  //CkPrintf("GBIS(%3i)[%2i]::P3 %3i(%3i) %3i(%3i)\n",gbisParams->sequence,gbisParams->cid, gbisParams->patchID[0],params->numAtoms[0],gbisParams->patchID[1],params->numAtoms[1]);
839 
840  register BigReal dx, dy, dz;
841  register float r2;
842  register float r, r_i;
843  register float rhoi0, rhois;
844  float rhojs, rhoj0;
845  float fx, fy, fz;
846  float forceAlpha;
847  register float fIx, fIy, fIz;
848 
849  float dhij;
850  float dhji;
851  int dij;
852  int dji;
853  register float dHdrPrefixI;
854  float dHdrPrefixJ;
855  register Position ri;
856  register Position rj;
857  register int c, numPairs, jj, j;
858  register float k;
859  register float da = DA;
860  register float db = DB;
861  register float dc = DC;
862  register float dd = DD;
863  register float de = DE;
864  float r_i3;
865 
866  //piecewise 22
867  c = 0;
868  for (int ngi = minIg; ngi < maxI; ) {
869  int iGroupSize = params->p[0][ngi].nonbondedGroupSize;
870  for (int i = ngi; i < ngi+iGroupSize; i++) {
871  ri = params->p[0][i].position;
872  ri.x += offset_x;
873  ri.y += offset_y;
874  ri.z += offset_z;
875  rhois = gbisParams->intRad[0][2*i+1];
876  plint *pairs;
877  gbisParams->gbisStepPairlists[c]->nextlist(&pairs,&numPairs);
878  fIx = fIy = fIz = 0.0;
879  dHdrPrefixI = gbisParams->dHdrPrefix[0][i];
880  for (jj = 0; jj < numPairs; jj++) {
881  j = pairs[jj];
882  rj = params->p[1][j].position;
883 
884  dx = (ri.x - rj.x);
885  dy = (ri.y - rj.y);
886  dz = (ri.z - rj.z);
887  r2 = dx*dx + dy*dy + dz*dz;
888  dHdrPrefixJ = gbisParams->dHdrPrefix[1][j];
889 
890  r_i = 1.0/sqrt(r2);//rptI takes 50% of loop time
891  r_i3 = r_i*r_i*r_i;
892 
893  rhojs = gbisParams->intRad[1][2*j+1];
894 
895  k = rhojs*r_i; k*=k;//k=(rs/r)^2
896  dhij = -rhojs*r_i3*k*
897  (da+k*(db+k*(dc+k*(dd+k*de))));
898 
899  k = rhois*r_i; k*=k;//k=(rs/r)^2
900  dhji = -rhois*r_i3*k*
901  (da+k*(db+k*(dc+k*(dd+k*de))));
902 
903  //add dEda*dadr force
904  forceAlpha = -r_i*(dHdrPrefixI*dhij+dHdrPrefixJ*dhji);
905  fx = dx * forceAlpha;
906  fy = dy * forceAlpha;
907  fz = dz * forceAlpha;
908 
909  params->fullf[1][j].x -= fx;
910  params->fullf[1][j].y -= fy;
911  params->fullf[1][j].z -= fz;
912 
913  fIx += fx;
914  fIy += fy;
915  fIz += fz;
916 
917 #if 1
918 //#ifdef PRINT_COMP
919  int id1 = params->pExt[0][i].id;
920  int id2 = params->pExt[1][j].id;
921  float h1 = dhij;
922  float h2 = dhji;
923  if (id1 > id2) {
924  int tmp = id1;
925  id1 = id2;
926  id2 = tmp;
927  h1 = dhji;
928  h2 = dhij;
929  }
930 /*CkPrintf("P3PAIR %05i %05i%9.5f% 13.5e% 13.5e% 13.5e% 13.5e% 13.5e %i\n",
931 params->pExt[0][i].id, params->pExt[1][j].id,sqrt(r2),
932 dHdrPrefixI, dHdrPrefixJ, dhij, dhji, forceAlpha, 2
933 );
934 CkPrintf("P3PAIR %05i %05i%9.5f% 13.5e% 13.5e% 13.5e% 13.5e% 13.5e %i\n",
935 params->pExt[1][j].id, params->pExt[0][i].id,sqrt(r2),
936 dHdrPrefixJ, dHdrPrefixI, dhji, dhij, forceAlpha, 2
937 );*/
938  //CkPrintf("DEDA(%04i)[%04i,%04i] = 22 % .4e % .4e % .4e\n",gbisParams->sequence,id1,id2,h1,h2, forceAlpha);
939 #endif
940 
941 #ifdef BENCHMARK
942  nops++;//= (24 + 2*DIV_FLOPS+SQRT_FLOPS);// 8 w/o nops
943 #endif
944 
945  }//end inner j
946  params->fullf[0][i].x += fIx;
947  params->fullf[0][i].y += fIy;
948  params->fullf[0][i].z += fIz;
949  }//end outer i
950  for (int s = 0; s < strideIg; s++) {
951  ngi+=params->p[0][ngi].nonbondedGroupSize;
952  }
953  }
954 
955 #ifdef BENCHMARK
956  t2 = 1.0*clock()/CLOCKS_PER_SEC;
957  CkPrintf("PHASE3.1: %8.3f ms @ %8.3f ns/iter for %i iter\n",1000.0*(t2-t1), 1000000000.0*(t2-t1)/nops,nops);
958 nops = 0;
959  t1 = 1.0*clock()/CLOCKS_PER_SEC;
960  nops = 0;
961 #endif
962 
963  float a_cut_i = 1.0/a_cut;
964  float a_cut_i2 = a_cut_i*a_cut_i;
965  float a_cut2 = a_cut*a_cut;
966  float rmrs;
967  float rmrsi;
968  float rmrs2;
969  float rhois2, rhojs2;
970  float logri, logrj;
971  float r_i2;
972 
973  //piecewise 11
974  c = 1;
975  for (int ngi = minIg; ngi < maxI; ) {
976  int iGroupSize = params->p[0][ngi].nonbondedGroupSize;
977  for (int i = ngi; i < ngi+iGroupSize; i++) {
978  ri = params->p[0][i].position;
979  ri.x += offset_x;
980  ri.y += offset_y;
981  ri.z += offset_z;
982  rhois = gbisParams->intRad[0][2*i+1];
983  rhois2 = rhois*rhois;
984  plint *pairs;
985  gbisParams->gbisStepPairlists[c]->nextlist(&pairs,&numPairs);
986  fIx = fIy = fIz = 0.0;
987  dHdrPrefixI = gbisParams->dHdrPrefix[0][i];
988  for (jj = 0; jj < numPairs; jj++) {
989  j = pairs[jj];
990  rj = params->p[1][j].position;
991  dHdrPrefixJ = gbisParams->dHdrPrefix[1][j];
992 
993  dx = (ri.x - rj.x);
994  dy = (ri.y - rj.y);
995  dz = (ri.z - rj.z);
996  r2 = dx*dx + dy*dy + dz*dz;
997  r_i = 1.0/sqrt(r2);//rptI
998  r = r2* r_i;
999  r_i2 = r_i*r_i;
1000 
1001  rhojs = gbisParams->intRad[1][2*j+1];
1002  rhojs2 = rhojs*rhojs;
1003 
1004 
1005  rmrs = r-rhojs;// 4 times
1006  rmrsi = 1.0/rmrs;
1007  rmrs2 = rmrs*rmrs;
1008  logrj = log(rmrs*a_cut_i);
1009  dhij = r_i2*(-0.25*logrj - (a_cut2 - rmrs2)*(rhojs2 + r2)*0.125*a_cut_i2*rmrsi*rmrsi);
1010 
1011 
1012  rmrs = r-rhois;// 4 times
1013  rmrsi = 1.0/rmrs;
1014  rmrs2 = rmrs*rmrs;
1015  logri = log(rmrs*a_cut_i);
1016  dhji = r_i2*(-0.25*logri - (a_cut2 - rmrs2)*(rhois2 + r2)*0.125*a_cut_i2*rmrsi*rmrsi);
1017 
1018  //add dEda*dadr force
1019  forceAlpha = -r_i*(dHdrPrefixI*dhij+dHdrPrefixJ*dhji);
1020  fx = dx * forceAlpha;
1021  fy = dy * forceAlpha;
1022  fz = dz * forceAlpha;
1023 
1024  params->fullf[1][j].x -= fx;
1025  params->fullf[1][j].y -= fy;
1026  params->fullf[1][j].z -= fz;
1027 
1028  fIx += fx;
1029  fIy += fy;
1030  fIz += fz;
1031 
1032 #if 1
1033 //#ifdef PRINT_COMP
1034  int id1 = params->pExt[0][i].id;
1035  int id2 = params->pExt[1][j].id;
1036  float h1 = dhij;
1037  float h2 = dhji;
1038  if (id1 > id2) {
1039  int tmp = id1;
1040  id1 = id2;
1041  id2 = tmp;
1042  h1 = dhji;
1043  h2 = dhij;
1044  }
1045  //CkPrintf("DEDA(%04i)[%04i,%04i] = 11 % .4e % .4e % .4e\n",gbisParams->sequence,id1,id2,h1,h2, forceAlpha);
1046 /*CkPrintf("P3PAIR %05i %05i%9.5f% 13.5e% 13.5e% 13.5e% 13.5e% 13.5e %i\n",
1047 params->pExt[0][i].id, params->pExt[1][j].id,sqrt(r2),
1048 dHdrPrefixI, dHdrPrefixJ, dhij, dhji, forceAlpha, 1
1049 );
1050 CkPrintf("P3PAIR %05i %05i%9.5f% 13.5e% 13.5e% 13.5e% 13.5e% 13.5e %i\n",
1051 params->pExt[1][j].id, params->pExt[0][i].id,sqrt(r2),
1052 dHdrPrefixJ, dHdrPrefixI, dhji, dhij, forceAlpha, 1
1053 );*/
1054 #endif
1055 
1056 #ifdef BENCHMARK
1057  nops++;
1058 #endif
1059 
1060  }//end inner j
1061  params->fullf[0][i].x += fIx;
1062  params->fullf[0][i].y += fIy;
1063  params->fullf[0][i].z += fIz;
1064  }//end outer i
1065  for (int s = 0; s < strideIg; s++) {
1066  ngi+=params->p[0][ngi].nonbondedGroupSize;
1067  }
1068  }
1069 
1070 #ifdef BENCHMARK
1071  t2 = 1.0*clock()/CLOCKS_PER_SEC;
1072  CkPrintf("PHASE3.2: %8.3f ms @ %8.3f ns/iter for %i iter\n",1000.0*(t2-t1), 1000000000.0*(t2-t1)/nops,nops);
1073 nops = 0;
1074  t1 = 1.0*clock()/CLOCKS_PER_SEC;
1075  nops = 0;
1076 #endif
1077 
1078  //piecewise all others
1079  c = 2;
1080  for (int ngi = minIg; ngi < maxI; ) {
1081  int iGroupSize = params->p[0][ngi].nonbondedGroupSize;
1082  for (int i = ngi; i < ngi+iGroupSize; i++) {
1083  ri = params->p[0][i].position;
1084  ri.x += offset_x;
1085  ri.y += offset_y;
1086  ri.z += offset_z;
1087  rhoi0 = gbisParams->intRad[0][2*i+0];
1088  rhois = gbisParams->intRad[0][2*i+1];
1089  plint *pairs;
1090  gbisParams->gbisStepPairlists[c]->nextlist(&pairs,&numPairs);
1091  fIx = fIy = fIz = 0.0;
1092  dHdrPrefixI = gbisParams->dHdrPrefix[0][i];
1093  for (jj = 0; jj < numPairs; jj++) {
1094  j = pairs[jj];
1095  rj = params->p[1][j].position;
1096  dHdrPrefixJ = gbisParams->dHdrPrefix[1][j];
1097 
1098  dx = (ri.x - rj.x);
1099  dy = (ri.y - rj.y);
1100  dz = (ri.z - rj.z);
1101  r2 = dx*dx + dy*dy + dz*dz;
1102 
1103  r_i = 1.0/sqrt(r2);//rptI
1104  r = r2* r_i;
1105 
1106  rhojs = gbisParams->intRad[1][2*j+1];
1107  rhoj0 = gbisParams->intRad[1][2*j+0];
1108 
1109  CalcDHPair(r,r2,r_i,a_cut,
1110  rhoi0,rhojs,
1111  rhoj0,rhois,
1112  dij,dji,dhij,dhji);
1113 
1114  //add dEda*dadr force
1115  forceAlpha = -r_i*(dHdrPrefixI*dhij+dHdrPrefixJ*dhji); // *scaling ?
1116  fx = dx * forceAlpha;
1117  fy = dy * forceAlpha;
1118  fz = dz * forceAlpha;
1119 
1120  fIx += fx;
1121  fIy += fy;
1122  fIz += fz;
1123 
1124  params->fullf[1][j].x -= fx;
1125  params->fullf[1][j].y -= fy;
1126  params->fullf[1][j].z -= fz;
1127 
1128 #if 1
1129 //#ifdef PRINT_COMP
1130  int id1 = params->pExt[0][i].id;
1131  int id2 = params->pExt[1][j].id;
1132  int d1 = dij;
1133  int d2 = dji;
1134  float h1 = dhij;
1135  float h2 = dhji;
1136  if (id1 > id2) {
1137  int tmp = id1;
1138  id1 = id2;
1139  id2 = tmp;
1140  d1 = dji;
1141  d2 = dij;
1142  h1 = dhji;
1143  h2 = dhij;
1144  }
1145 // CkPrintf("DEDA(%04i)[%04i,%04i] = %i%i % .4e % .4e % .4e\n",gbisParams->sequence,id1,id2,d1,d2,h1,h2, forceAlpha);
1146 // CkPrintf("DEDA(%04i)[%04i,%04i] = %i%i % .4e % .4e % .4e\n",gbisParams->sequence,id1,id2,d1,d2,h1,h2, forceAlpha);
1147 /*if ( dij > 0 ) {
1148 CkPrintf("P3PAIR %05i %05i%9.5f% 13.5e% 13.5e% 13.5e% 13.5e% 13.5e %i\n",
1149 params->pExt[0][i].id, params->pExt[1][j].id,sqrt(r2),
1150 dHdrPrefixI, dHdrPrefixJ, dhij, dhji, forceAlpha, dij
1151 );
1152 }
1153 if ( dji > 0 ) {
1154 CkPrintf("P3PAIR %05i %05i%9.5f% 13.5e% 13.5e% 13.5e% 13.5e% 13.5e %i\n",
1155 params->pExt[1][j].id, params->pExt[0][i].id,sqrt(r2),
1156 dHdrPrefixJ, dHdrPrefixI, dhji, dhij, forceAlpha, dji
1157 );
1158 }*/
1159 #endif
1160 
1161 #ifdef BENCHMARK
1162  nops++;
1163 #endif
1164 
1165  }//end inner j
1166  params->fullf[0][i].x += fIx;
1167  params->fullf[0][i].y += fIy;
1168  params->fullf[0][i].z += fIz;
1169  }//end outer i
1170  for (int s = 0; s < strideIg; s++) {
1171  ngi+=params->p[0][ngi].nonbondedGroupSize;
1172  }
1173  }
1174 
1175 
1176 #ifdef BENCHMARK
1177  t2 = 1.0*clock()/CLOCKS_PER_SEC;
1178  CkPrintf("PHASE3.3: %8.3f ms @ %8.3f ns/iter for %i iter\n",1000.0*(t2-t1), 1000000000.0*(t2-t1)/nops, nops);
1179 #endif
1180 
1181 }//end if gbisPhase
1182 
1183 }//end calcGBIS
#define TE
Definition: ComputeGBIS.inl:36
#define TD
Definition: ComputeGBIS.inl:35
#define TA
Definition: ComputeGBIS.inl:32
CompAtom * p[2]
Definition: Vector.h:64
#define COULOMB
Definition: common.h:44
BigReal z
Definition: Vector.h:66
Position position
Definition: NamdTypes.h:53
static void h2(float r, float r2, float ri, float rc, float r0, float rs, float &h)
#define TC
Definition: ComputeGBIS.inl:34
#define DA
Definition: ComputeGBIS.inl:37
#define DD
Definition: ComputeGBIS.inl:40
Charge charge
Definition: NamdTypes.h:54
static void CalcDHPair(float r, float r2, float ri, float rc, float ri0, float rjs, float rj0, float ris, int &dij, int &dji, float &dhij, float &dhji)
unsigned short plint
void nextlist(plint **list, int *list_size)
static void h1(float r, float r2, float ri, float rc, float r0, float rs, float &h)
Pairlists * gbisStepPairlists[4]
#define DB
Definition: ComputeGBIS.inl:38
#define DC
Definition: ComputeGBIS.inl:39
CompAtomExt * pExt[2]
#define ZERO
Definition: common.h:93
BigReal x
Definition: Vector.h:66
#define FS_MAX
Definition: ComputeGBIS.inl:24
static void CalcHPair(float r, float r2, float ri, float rc, float ri0, float rjs, float rj0, float ris, int &dij, int &dji, float &hij, float &hji)
BigReal y
Definition: Vector.h:66
unsigned int nonbondedGroupSize
Definition: NamdTypes.h:57
#define TB
Definition: ComputeGBIS.inl:33
Force * fullf[2]
#define DE
Definition: ComputeGBIS.inl:41
double BigReal
Definition: common.h:112
float GBReal
Definition: ComputeGBIS.inl:17
void pairlistFromAll(nonbonded *params, GBISParamStruct *gbisParams, int minIg, int strideIg, int maxI)
Definition: ComputeGBIS.C:44
void ComputeNonbondedUtil::select ( void  )
static

Definition at line 253 of file ComputeNonbondedUtil.C.

References A, A12_f, A6_f, accelMDOn, SimParameters::accelMDOn, alchDecouple, SimParameters::alchDecouple, alchFepOn, SimParameters::alchFepOn, alchThermIntOn, SimParameters::alchThermIntOn, alchVdwShiftCoeff, SimParameters::alchVdwShiftCoeff, alchWCAOn, SimParameters::alchWCAOn, B, B12_f, B6_f, c0, C1, c1, C12_f, C2, c3, c5, c6, C6_f, c7, c8, calc_error(), calc_pair(), calc_pair_energy(), calc_pair_energy_fep(), calc_pair_energy_fullelect(), calc_pair_energy_fullelect_fep(), calc_pair_energy_fullelect_go(), calc_pair_energy_fullelect_int(), calc_pair_energy_fullelect_les(), calc_pair_energy_fullelect_pprof(), calc_pair_energy_fullelect_tabener(), calc_pair_energy_fullelect_ti(), calc_pair_energy_go(), calc_pair_energy_int(), calc_pair_energy_les(), calc_pair_energy_merge_fullelect(), calc_pair_energy_merge_fullelect_fep(), calc_pair_energy_merge_fullelect_go(), calc_pair_energy_merge_fullelect_int(), calc_pair_energy_merge_fullelect_les(), calc_pair_energy_merge_fullelect_pprof(), calc_pair_energy_merge_fullelect_tabener(), calc_pair_energy_merge_fullelect_ti(), calc_pair_energy_pprof(), calc_pair_energy_slow_fullelect(), calc_pair_energy_slow_fullelect_fep(), calc_pair_energy_slow_fullelect_go(), calc_pair_energy_slow_fullelect_les(), calc_pair_energy_slow_fullelect_pprof(), calc_pair_energy_slow_fullelect_tabener(), calc_pair_energy_slow_fullelect_ti(), calc_pair_energy_tabener(), calc_pair_energy_ti(), calc_pair_fullelect(), calc_pair_fullelect_go(), calc_pair_fullelect_les(), calc_pair_fullelect_pprof(), calc_pair_fullelect_tabener(), calc_pair_fullelect_ti(), calc_pair_go(), calc_pair_les(), calc_pair_merge_fullelect(), calc_pair_merge_fullelect_go(), calc_pair_merge_fullelect_les(), calc_pair_merge_fullelect_pprof(), calc_pair_merge_fullelect_tabener(), calc_pair_merge_fullelect_ti(), calc_pair_pprof(), calc_pair_slow_fullelect(), calc_pair_slow_fullelect_go(), calc_pair_slow_fullelect_les(), calc_pair_slow_fullelect_pprof(), calc_pair_slow_fullelect_tabener(), calc_pair_slow_fullelect_ti(), calc_pair_tabener(), calc_pair_ti(), calc_self(), calc_self_energy(), calc_self_energy_fep(), calc_self_energy_fullelect(), calc_self_energy_fullelect_fep(), calc_self_energy_fullelect_go(), calc_self_energy_fullelect_int(), calc_self_energy_fullelect_les(), calc_self_energy_fullelect_pprof(), calc_self_energy_fullelect_tabener(), calc_self_energy_fullelect_ti(), calc_self_energy_go(), calc_self_energy_int(), calc_self_energy_les(), calc_self_energy_merge_fullelect(), calc_self_energy_merge_fullelect_fep(), calc_self_energy_merge_fullelect_go(), calc_self_energy_merge_fullelect_int(), calc_self_energy_merge_fullelect_les(), calc_self_energy_merge_fullelect_pprof(), calc_self_energy_merge_fullelect_tabener(), calc_self_energy_merge_fullelect_ti(), calc_self_energy_pprof(), calc_self_energy_slow_fullelect(), calc_self_energy_slow_fullelect_fep(), calc_self_energy_slow_fullelect_go(), calc_self_energy_slow_fullelect_les(), calc_self_energy_slow_fullelect_pprof(), calc_self_energy_slow_fullelect_tabener(), calc_self_energy_slow_fullelect_ti(), calc_self_energy_tabener(), calc_self_energy_ti(), calc_self_fullelect(), calc_self_fullelect_go(), calc_self_fullelect_les(), calc_self_fullelect_pprof(), calc_self_fullelect_tabener(), calc_self_fullelect_ti(), calc_self_go(), calc_self_les(), calc_self_merge_fullelect(), calc_self_merge_fullelect_go(), calc_self_merge_fullelect_les(), calc_self_merge_fullelect_pprof(), calc_self_merge_fullelect_tabener(), calc_self_merge_fullelect_ti(), calc_self_pprof(), calc_self_slow_fullelect(), calc_self_slow_fullelect_go(), calc_self_slow_fullelect_les(), calc_self_slow_fullelect_pprof(), calc_self_slow_fullelect_tabener(), calc_self_slow_fullelect_ti(), calc_self_tabener(), calc_self_ti(), calcFullPair, calcFullPairEnergy, calcFullSelf, calcFullSelfEnergy, calcMergePair, calcMergePairEnergy, calcMergeSelf, calcMergeSelfEnergy, calcPair, calcPairEnergy, calcSelf, calcSelfEnergy, calcSlowPair, calcSlowPairEnergy, calcSlowSelf, calcSlowSelfEnergy, Parameters::columnsize, columnsize, commOnly, SimParameters::commOnly, corr_table, SimParameters::cutoff, cutoff, cutoff2, cutoff2_f, cutoff_3, cutoff_3_f, cutoff_6, cutoff_6_f, SimParameters::dielectric, dielectric_1, drudeNbthole, SimParameters::drudeNbtholeCut, SimParameters::drudeOn, endi(), ewaldcof, SimParameters::exclude, fast_table, SimParameters::fixedAtomsForces, fixedAtomsOn, SimParameters::fixedAtomsOn, SimParameters::FMAOn, SimParameters::FMMOn, full_table, SimParameters::fullDirectOn, Parameters::get_num_vdw_params(), LJTable::get_table_dim(), Parameters::get_vdw_pair_params(), Parameters::get_vdw_params(), SimParameters::goForcesOn, goForcesOn, SimParameters::goGroPair, goGroPair, SimParameters::goMethod, goMethod, iERROR(), iINFO(), iout, k_vdwa, k_vdwa_f, k_vdwb, k_vdwb_f, lambda_table, lesFactor, SimParameters::lesFactor, lesOn, SimParameters::lesOn, lesScaling, SimParameters::limitDist, ljTable, SimParameters::longSplitting, SimParameters::martiniSwitching, mol, Node::molecule, SimParameters::MSMOn, SimParameters::MSMSplit, NAMD_bug(), NAMD_die(), SimParameters::nonbondedScaling, Node::Object(), pairInteractionOn, SimParameters::pairInteractionOn, pairInteractionSelf, SimParameters::pairInteractionSelf, Node::parameters, pi_ewaldcof, SimParameters::PMEEwaldCoefficient, SimParameters::PMEOn, pressureProfileAtomTypes, SimParameters::pressureProfileAtomTypes, pressureProfileOn, SimParameters::pressureProfileOn, pressureProfileSlabs, SimParameters::pressureProfileSlabs, qmForcesOn, SimParameters::qmForcesOn, r2_delta, r2_delta_1, r2_delta_exp, r2_table, Parameters::rowsize, rowsize, SimParameters::scale14, scale14, SCALED14, scaling, scor_table, send_build_cuda_force_table(), SHARP, Node::simParameters, simParams, slow_table, SimParameters::soluteScalingOn, SPLIT_C1, SPLIT_C2, SPLIT_MARTINI, SPLIT_NONE, SPLIT_SHIFT, SPOLY, SimParameters::switchingActive, SimParameters::switchingDist, switchOn, switchOn2, switchOn_1, switchOn_f, table_alloc, Parameters::table_ener, table_ener, table_length, table_noshort, table_short, SimParameters::tabulatedEnergies, SimParameters::useAVXTiles, SimParameters::useCUDA2, v_vdwa, v_vdwa_f, v_vdwb, v_vdwb_f, vdw_switch_mode, VDW_SWITCH_MODE_ENERGY, VDW_SWITCH_MODE_FORCE, VDW_SWITCH_MODE_MARTINI, vdwa_table, vdwb_table, SimParameters::vdwForceSwitching, vdwForceSwitching, SimParameters::vdwGeometricSigma, x, and XPLOR.

Referenced by SimParameters::nonbonded_select(), and SimParameters::scriptSet().

254 {
255  if ( CkMyRank() ) return;
256 
257  // These defaults die cleanly if nothing appropriate is assigned.
274 
276  Parameters * params = Node::Object()->parameters;
277 
278  table_ener = params->table_ener;
279  rowsize = params->rowsize;
280  columnsize = params->columnsize;
281 
282  commOnly = simParams->commOnly;
283  fixedAtomsOn = ( simParams->fixedAtomsOn && ! simParams->fixedAtomsForces );
284 
285  qmForcesOn = simParams->qmForcesOn ;
286 
287  cutoff = simParams->cutoff;
289  cutoff2_f = cutoff2;
290 
291 //fepb
292  alchFepOn = simParams->alchFepOn;
293  alchThermIntOn = simParams->alchThermIntOn;
294  alchWCAOn = simParams->alchWCAOn;
295  alchDecouple = simParams->alchDecouple;
296 
297  lesOn = simParams->lesOn;
298  lesScaling = lesFactor = 0;
299 
300  Bool tabulatedEnergies = simParams->tabulatedEnergies;
303 
304  delete [] lambda_table;
305  lambda_table = 0;
306 
310 
311  // Ported by JLai -- Original JE - Go
312  goGroPair = simParams->goGroPair;
313  goForcesOn = simParams->goForcesOn;
314  goMethod = simParams->goMethod;
315  // End of port
316 
317  accelMDOn = simParams->accelMDOn;
318 
319  drudeNbthole = simParams->drudeOn && (simParams->drudeNbtholeCut > 0.0);
320 
321  if ( drudeNbthole ) {
322 #ifdef NAMD_CUDA
323  NAMD_die("drudeNbthole is not supported in CUDA version");
324 #endif
325  if ( lesOn )
326  NAMD_die("drudeNbthole is not supported with locally enhanced sampling");
327  if ( pairInteractionOn )
328  NAMD_die("drudeNbthole is not supported with pair interaction calculation");
329  if ( pressureProfileOn )
330  NAMD_die("drudeNbthole is not supported with pressure profile calculation");
331  }
332 
333  if ( alchFepOn ) {
334 #ifdef NAMD_CUDA
335  NAMD_die("Alchemical free-energy perturbation is not supported in CUDA version");
336 #endif
353  } else if ( alchThermIntOn ) {
354 #ifdef NAMD_CUDA
355  NAMD_die("Alchemical thermodynamic integration is not supported in CUDA version");
356 #endif
373  } else if ( lesOn ) {
374 #ifdef NAMD_CUDA
375  NAMD_die("Locally enhanced sampling is not supported in CUDA version");
376 #endif
377  lesFactor = simParams->lesFactor;
378  lesScaling = 1.0 / (double)lesFactor;
379  lambda_table = new BigReal[(lesFactor+1)*(lesFactor+1)];
380  for ( int ip=0; ip<=lesFactor; ++ip ) {
381  for ( int jp=0; jp<=lesFactor; ++jp ) {
382  BigReal lambda_pair = 1.0;
383  if (ip || jp ) {
384  if (ip && jp && ip != jp) {
385  lambda_pair = 0.0;
386  } else {
387  lambda_pair = lesScaling;
388  }
389  }
390  lambda_table[(lesFactor+1)*ip+jp] = lambda_pair;
391  }
392  }
409  } else if ( pressureProfileOn) {
410 #ifdef NAMD_CUDA
411  NAMD_die("Pressure profile calculation is not supported in CUDA version");
412 #endif
415 
432  } else if ( pairInteractionOn ) {
433 #ifdef NAMD_CUDA
434  NAMD_die("Pair interaction calculation is not supported in CUDA version");
435 #endif
442  } else if ( tabulatedEnergies ) {
443 #ifdef NAMD_CUDA
444  NAMD_die("Tabulated energies is not supported in CUDA version");
445 #endif
462  } else if ( goForcesOn ) {
463 #ifdef NAMD_CUDA
464  NAMD_die("Go forces is not supported in CUDA version");
465 #endif
482  } else {
499  }
500 
501 //fepe
502 
503  dielectric_1 = 1.0/simParams->dielectric;
504  if ( simParams->soluteScalingOn ) {
505  delete ljTable;
506  ljTable = 0;
507  }
508  if ( ! ljTable ) ljTable = new LJTable;
510  scaling = simParams->nonbondedScaling;
511  if ( simParams->exclude == SCALED14 )
512  {
513  scale14 = simParams->scale14;
514  }
515  else
516  {
517  scale14 = 1.;
518  }
519  if ( simParams->switchingActive )
520  {
521  switchOn = simParams->switchingDist;
522  switchOn_1 = 1.0/switchOn;
523  // d0 = 1.0/(cutoff-switchOn);
525  c0 = 1.0/(cutoff2-switchOn2);
526 
527  if ( simParams->vdwForceSwitching ) {
528  double switchOn3 = switchOn * switchOn2;
529  double cutoff3 = cutoff * cutoff2;
530  double switchOn6 = switchOn3 * switchOn3;
531  double cutoff6 = cutoff3 * cutoff3;
532  v_vdwa_f = v_vdwa = -1. / ( switchOn6 * cutoff6 );
533  v_vdwb_f = v_vdwb = -1. / ( switchOn3 * cutoff3 );
534  k_vdwa_f = k_vdwa = cutoff6 / ( cutoff6 - switchOn6 );
535  k_vdwb_f = k_vdwb = cutoff3 / ( cutoff3 - switchOn3 );
536  cutoff_3_f = cutoff_3 = 1. / cutoff3;
537  cutoff_6_f = cutoff_6 = 1. / cutoff6;
538 
539  } else if ( simParams->martiniSwitching ) { // switching fxn for Martini RBCG
540 
541  BigReal p6 = 6;
542  BigReal A6 = p6 * ((p6+1)*switchOn-(p6+4)*cutoff)/(pow(cutoff,p6+2)*pow(cutoff-switchOn,2));
543  BigReal B6 = -p6 * ((p6+1)*switchOn-(p6+3)*cutoff)/(pow(cutoff,p6+2)*pow(cutoff-switchOn,3));
544  BigReal C6 = 1.0/pow(cutoff,p6)-A6/3.0*pow(cutoff-switchOn,3)-B6/4.0*pow(cutoff-switchOn,4);
545 
546  BigReal p12 = 12;
547  BigReal A12 = p12 * ((p12+1)*switchOn-(p12+4)*cutoff)/(pow(cutoff,p12+2)*pow(cutoff-switchOn,2));
548  BigReal B12 = -p12 * ((p12+1)*switchOn-(p12+3)*cutoff)/(pow(cutoff,p12+2)*pow(cutoff-switchOn,3));
549  BigReal C12 = 1.0/pow(cutoff,p12)-A12/3.0*pow(cutoff-switchOn,3)-B12/4.0*pow(cutoff-switchOn,4);
550 
551  A6_f = A6; B6_f = B6; C6_f = C6;
552  A12_f = A12; B12_f = B12; C12_f = C12;
554 
555  }
556 
557  }
558  else
559  {
560  switchOn = cutoff;
561  switchOn_1 = 1.0/switchOn;
562  // d0 = 0.; // avoid division by zero
563  switchOn2 = switchOn*switchOn;
564  c0 = 0.; // avoid division by zero
565  }
566  c1 = c0*c0*c0;
567  c3 = 3.0 * (cutoff2 - switchOn2);
568  c5 = 0;
569  c6 = 0;
570  c7 = 0;
571  c8 = 0;
572 
573  const int PMEOn = simParams->PMEOn;
574  const int MSMOn = simParams->MSMOn;
575  const int MSMSplit = simParams->MSMSplit;
576 
577  if ( PMEOn ) {
578  ewaldcof = simParams->PMEEwaldCoefficient;
579  BigReal TwoBySqrtPi = 1.12837916709551;
580  pi_ewaldcof = TwoBySqrtPi * ewaldcof;
581  }
582 
583  int splitType = SPLIT_NONE;
584  if ( simParams->switchingActive ) splitType = SPLIT_SHIFT;
585  if ( simParams->martiniSwitching ) splitType = SPLIT_MARTINI;
586  if ( simParams->fullDirectOn || simParams->FMAOn || PMEOn || MSMOn ||
587  simParams->FMMOn ) {
588  switch ( simParams->longSplitting ) {
589  case C2:
590  splitType = SPLIT_C2;
591  break;
592 
593  case C1:
594  splitType = SPLIT_C1;
595  break;
596 
597  case XPLOR:
598  NAMD_die("Sorry, XPLOR splitting not supported.");
599  break;
600 
601  case SHARP:
602  NAMD_die("Sorry, SHARP splitting not supported.");
603  break;
604 
605  default:
606  NAMD_die("Unknown splitting type found!");
607 
608  }
609  }
610 
611  BigReal r2_tol = 0.1;
612 
613  r2_delta = 1.0;
614  r2_delta_exp = 0;
615  while ( r2_delta > r2_tol ) { r2_delta /= 2.0; r2_delta_exp += 1; }
616  r2_delta_1 = 1.0 / r2_delta;
617 
618  if ( ! CkMyPe() ) {
619  iout << iINFO << "NONBONDED TABLE R-SQUARED SPACING: " <<
620  r2_delta << "\n" << endi;
621  }
622 
623  BigReal r2_tmp = 1.0;
624  int cutoff2_exp = 0;
625  while ( (cutoff2 + r2_delta) > r2_tmp ) { r2_tmp *= 2.0; cutoff2_exp += 1; }
626 
627  int i;
628  int n = (r2_delta_exp + cutoff2_exp) * 64 + 1;
629  table_length = n;
630  #if defined(NAMD_MIC)
631  int n_16 = (n + 15) & (~15);
632  #endif
633 
634  if ( ! CkMyPe() ) {
635  iout << iINFO << "NONBONDED TABLE SIZE: " <<
636  n << " POINTS\n" << endi;
637  }
638 
639  if ( table_alloc ) delete [] table_alloc;
640  #if defined(NAMD_MIC)
641  table_alloc = new BigReal[61*n_16+16];
642  BigReal *table_align = table_alloc;
643  while ( ((long)table_align) % 128 ) ++table_align;
644  mic_table_base_ptr = table_align;
645  mic_table_n = n;
646  mic_table_n_16 = n_16;
647  table_noshort = table_align;
648  table_short = table_align + 16*n_16;
649  slow_table = table_align + 32*n_16;
650  fast_table = table_align + 36*n_16;
651  scor_table = table_align + 40*n_16;
652  corr_table = table_align + 44*n_16;
653  full_table = table_align + 48*n_16;
654  vdwa_table = table_align + 52*n_16;
655  vdwb_table = table_align + 56*n_16;
656  r2_table = table_align + 60*n_16;
657  #else
658  table_alloc = new BigReal[61*n+16];
659  BigReal *table_align = table_alloc;
660  while ( ((long)table_align) % 128 ) ++table_align;
661  table_noshort = table_align;
662  table_short = table_align + 16*n;
663  slow_table = table_align + 32*n;
664  fast_table = table_align + 36*n;
665  scor_table = table_align + 40*n;
666  corr_table = table_align + 44*n;
667  full_table = table_align + 48*n;
668  vdwa_table = table_align + 52*n;
669  vdwb_table = table_align + 56*n;
670  r2_table = table_align + 60*n;
671  #endif
672  BigReal *fast_i = fast_table + 4;
673  BigReal *scor_i = scor_table + 4;
674  BigReal *slow_i = slow_table + 4;
675  BigReal *vdwa_i = vdwa_table + 4;
676  BigReal *vdwb_i = vdwb_table + 4;
677  BigReal *r2_i = r2_table; *(r2_i++) = r2_delta;
678  BigReal r2_limit = simParams->limitDist * simParams->limitDist;
679  if ( r2_limit < r2_delta ) r2_limit = r2_delta;
680  int r2_delta_i = 0; // entry for r2 == r2_delta
681 
682 #ifdef NAMD_AVXTILES
683  {
684  avxTilesMode = 1;
685  if (!simParams->useAVXTiles)
686  avxTilesMode = 0;
687  if (avxTilesMode) {
688  if (simParams->vdwGeometricSigma) avxTilesMode = 2;
689  if ( simParams->fullDirectOn || simParams->FMAOn || PMEOn || MSMOn ||
690  simParams->FMMOn ) {
691  if ( simParams->longSplitting != C1)
692  avxTilesMode = 3;
693  } else
694  avxTilesMode = 3;
695  if (avxTilesMode == 1) {
696  const int table_dim = ljTable->get_table_dim();
697  Real A, B, A14, B14;
698  for (int i = 0; i < table_dim; i++)
699  for (int j = i+1; j < table_dim; j++)
700  if (params->get_vdw_pair_params(i, j, &A, &B, &A14, &B14))
701  avxTilesMode = 2;
702  }
703  if (avxTilesMode > 1)
704  iout << iINFO << "AVX-512 TILES WILL USE SHORT-RANGE INTERPOLATION ("
705  << avxTilesMode << ")\n";
706  else {
707  Parameters *params = Node::Object()->parameters;
708  const int num_params = params->get_num_vdw_params();
709  if ( avx_tiles_eps4_sigma ) delete [] avx_tiles_eps4_sigma;
710  if ( avx_tiles_eps4_sigma_14 ) delete [] avx_tiles_eps4_sigma_14;
711  avx_tiles_eps4_sigma = new float[num_params*2];
712  avx_tiles_eps4_sigma_14 = new float[num_params*2];
713  for (int i = 0; i < num_params; i++) {
714  Real sigma, sigma_14, epsilon, epsilon_14;
715  params->get_vdw_params(&sigma, &epsilon, &sigma_14,
716  &epsilon_14,i);
717  avx_tiles_eps4_sigma[i*2] = 4.0 * scaling * epsilon;
718  avx_tiles_eps4_sigma[i*2 + 1] = sigma;
719  avx_tiles_eps4_sigma_14[i*2] = 4.0 * scaling * epsilon_14;
720  avx_tiles_eps4_sigma_14[i*2 + 1] = sigma_14;
721  }
722  }
723  }
724  }
725 #endif
726 #if defined(NAMD_KNL) || defined(NAMD_AVXTILES)
727  if ( knl_table_alloc ) delete [] knl_table_alloc;
728  if ( KNL_TABLE_MAX_R_1 < 1.f || KNL_TABLE_FACTOR < 1 ||
729  KNL_TABLE_FACTOR !=
730  static_cast<int>(1.0 / KNL_TABLE_MAX_R_1 * KNL_TABLE_SIZE))
731  NAMD_bug("Inconsistent KNL preprocessor settings.");
732 #ifdef NAMD_KNL
733  knl_table_alloc = new float[10*KNL_TABLE_SIZE];
734 #else
735  knl_table_alloc = new float[8*KNL_TABLE_SIZE];
736 #endif
737  knl_fast_ener_table = knl_table_alloc;
738  knl_fast_grad_table = knl_table_alloc + KNL_TABLE_SIZE;
739  knl_scor_ener_table = knl_table_alloc + 2*KNL_TABLE_SIZE;
740  knl_scor_grad_table = knl_table_alloc + 3*KNL_TABLE_SIZE;
741  knl_slow_ener_table = knl_table_alloc + 4*KNL_TABLE_SIZE;
742  knl_slow_grad_table = knl_table_alloc + 5*KNL_TABLE_SIZE;
743  knl_excl_ener_table = knl_table_alloc + 6*KNL_TABLE_SIZE;
744  knl_excl_grad_table = knl_table_alloc + 7*KNL_TABLE_SIZE;
745  knl_fast_ener_table[0] = 0.;
746  knl_fast_grad_table[0] = 0.;
747  knl_scor_ener_table[0] = 0.;
748  knl_scor_grad_table[0] = 0.;
749  knl_slow_ener_table[0] = 0.;
750  knl_slow_grad_table[0] = 0.;
751  knl_excl_ener_table[0] = 0.;
752  knl_excl_grad_table[0] = 0.;
753 #ifdef NAMD_KNL
754  knl_corr_ener_table = knl_table_alloc + 8*KNL_TABLE_SIZE;
755  knl_corr_grad_table = knl_table_alloc + 9*KNL_TABLE_SIZE;
756  knl_corr_ener_table[0] = 0.;
757  knl_corr_grad_table[0] = 0.;
758 #endif
759  for ( int knl_table = 0; knl_table < 2; ++knl_table ) {
760  int nn = n;
761  if ( knl_table ) {
762  nn = KNL_TABLE_SIZE-1;
763  }
764  for ( i=1; i<nn; ++i ) {
765 #else
766  // fill in the table, fix up i==0 (r2==0) below
767  for ( i=1; i<n; ++i ) {
768 #endif
769 
770  const BigReal r2_base = r2_delta * ( 1 << (i/64) );
771  const BigReal r2_del = r2_base / 64.0;
772  BigReal r2 = r2_base - r2_delta + r2_del * (i%64);
773 
774  BigReal r = sqrt(r2);
775 
776 #if defined(NAMD_KNL) || defined(NAMD_AVXTILES)
777  if ( knl_table ) {
778  r = (double)(KNL_TABLE_FACTOR-2)/(double)(i);
779  r2 = r*r;
780  } else
781 #endif
782  if ( r2 <= r2_limit ) r2_delta_i = i;
783 
784  const BigReal r_1 = 1.0/r;
785  const BigReal r_2 = 1.0/r2;
786 
787  // fast_ is defined as (full_ - slow_)
788  // corr_ and fast_ are both zero at the cutoff, full_ is not
789  // all three are approx 1/r at short distances
790 
791  // for actual interpolation, we use fast_ for fast forces and
792  // scor_ = slow_ + corr_ - full_ and slow_ for slow forces
793  // since these last two are of small magnitude
794 
795  BigReal fast_energy, fast_gradient;
796  BigReal scor_energy, scor_gradient;
797  BigReal slow_energy, slow_gradient;
798 
799  // corr_ is PME direct sum, or similar correction term
800  // corr_energy is multiplied by r until later
801  // corr_gradient is multiplied by -r^2 until later
802  BigReal corr_energy, corr_gradient;
803 
804 
805  if ( PMEOn ) {
806  BigReal tmp_a = r * ewaldcof;
807  BigReal tmp_b = erfc(tmp_a);
808  corr_energy = tmp_b;
809  corr_gradient = pi_ewaldcof*exp(-(tmp_a*tmp_a))*r + tmp_b;
810  } else if ( MSMOn ) {
811  BigReal a_1 = 1.0/cutoff;
812  BigReal r_a = r * a_1;
813  BigReal g, dg;
814  SPOLY(&g, &dg, r_a, MSMSplit);
815  corr_energy = 1 - r_a * g;
816  corr_gradient = 1 + r_a*r_a * dg;
817  } else {
818  corr_energy = corr_gradient = 0;
819  }
820 
821  switch(splitType) {
822  case SPLIT_NONE:
823  fast_energy = 1.0/r;
824  fast_gradient = -1.0/r2;
825  scor_energy = scor_gradient = 0;
826  slow_energy = slow_gradient = 0;
827  break;
828  case SPLIT_SHIFT: {
829  BigReal shiftVal = r2/cutoff2 - 1.0;
830  shiftVal *= shiftVal;
831  BigReal dShiftVal = 2.0 * (r2/cutoff2 - 1.0) * 2.0*r/cutoff2;
832  fast_energy = shiftVal/r;
833  fast_gradient = dShiftVal/r - shiftVal/r2;
834  scor_energy = scor_gradient = 0;
835  slow_energy = slow_gradient = 0;
836  }
837  break;
838  case SPLIT_MARTINI: {
839  // in Martini, the Coulomb switching distance is zero
840  const BigReal COUL_SWITCH = 0.;
841  // Gromacs shifting function
842  const BigReal p1 = 1.;
843  BigReal A1 = p1 * ((p1+1)*COUL_SWITCH-(p1+4)*cutoff)/(pow(cutoff,p1+2)*pow(cutoff-COUL_SWITCH,2));
844  BigReal B1 = -p1 * ((p1+1)*COUL_SWITCH-(p1+3)*cutoff)/(pow(cutoff,p1+2)*pow(cutoff-COUL_SWITCH,3));
845  BigReal X1 = 1.0/pow(cutoff,p1)-A1/3.0*pow(cutoff-COUL_SWITCH,3)-B1/4.0*pow(cutoff-COUL_SWITCH,4);
846  BigReal r12 = (r-COUL_SWITCH)*(r-COUL_SWITCH);
847  BigReal r13 = (r-COUL_SWITCH)*(r-COUL_SWITCH)*(r-COUL_SWITCH);
848  BigReal shiftVal = -(A1/3.0)*r13 - (B1/4.0)*r12*r12 - X1;
849  BigReal dShiftVal = -A1*r12 - B1*r13;
850  fast_energy = (1/r) + shiftVal;
851  fast_gradient = -1/(r2) + dShiftVal;
852  scor_energy = scor_gradient = 0;
853  slow_energy = slow_gradient = 0;
854  }
855  break;
856  case SPLIT_C1:
857  // calculate actual energy and gradient
858  slow_energy = 0.5/cutoff * (3.0 - (r2/cutoff2));
859  slow_gradient = -1.0/cutoff2 * (r/cutoff);
860  // calculate scor from slow and corr
861  scor_energy = slow_energy + (corr_energy - 1.0)/r;
862  scor_gradient = slow_gradient - (corr_gradient - 1.0)/r2;
863  // calculate fast from slow
864  fast_energy = 1.0/r - slow_energy;
865  fast_gradient = -1.0/r2 - slow_gradient;
866  break;
867  case SPLIT_C2:
868  //
869  // Quintic splitting function contributed by
870  // Bruce Berne, Ruhong Zhou, and Joe Morrone
871  //
872  // calculate actual energy and gradient
873  slow_energy = r2/(cutoff*cutoff2) * (6.0 * (r2/cutoff2)
874  - 15.0*(r/cutoff) + 10.0);
875  slow_gradient = r/(cutoff*cutoff2) * (24.0 * (r2/cutoff2)
876  - 45.0 *(r/cutoff) + 20.0);
877  // calculate scor from slow and corr
878  scor_energy = slow_energy + (corr_energy - 1.0)/r;
879  scor_gradient = slow_gradient - (corr_gradient - 1.0)/r2;
880  // calculate fast from slow
881  fast_energy = 1.0/r - slow_energy;
882  fast_gradient = -1.0/r2 - slow_gradient;
883  break;
884  }
885 
886  // foo_gradient is calculated as ( d foo_energy / d r )
887  // and now divided by 2r to get ( d foo_energy / d r2 )
888 
889  fast_gradient *= 0.5 * r_1;
890  scor_gradient *= 0.5 * r_1;
891  slow_gradient *= 0.5 * r_1;
892 
893  // let modf be 1 if excluded, 1-scale14 if modified, 0 otherwise,
894  // add scor_ - modf * slow_ to slow terms and
895  // add fast_ - modf * fast_ to fast terms.
896 
897  BigReal vdwa_energy, vdwa_gradient;
898  BigReal vdwb_energy, vdwb_gradient;
899 
900  const BigReal r_6 = r_2*r_2*r_2;
901  const BigReal r_12 = r_6*r_6;
902 
903  // Lennard-Jones switching function
904  if ( simParams->vdwForceSwitching ) { // switch force
906 
907  // from Steinbach & Brooks, JCC 15, pgs 667-683, 1994, eqns 10-13
908  if ( r2 > switchOn2 ) {
909  BigReal tmpa = r_6 - cutoff_6;
910  vdwa_energy = k_vdwa * tmpa * tmpa;
911  BigReal tmpb = r_1 * r_2 - cutoff_3;
912  vdwb_energy = k_vdwb * tmpb * tmpb;
913  vdwa_gradient = -6.0 * k_vdwa * tmpa * r_2 * r_6;
914  vdwb_gradient = -3.0 * k_vdwb * tmpb * r_2 * r_2 * r_1;
915  } else {
916  vdwa_energy = r_12 + v_vdwa;
917  vdwb_energy = r_6 + v_vdwb;
918  vdwa_gradient = -6.0 * r_2 * r_12;
919  vdwb_gradient = -3.0 * r_2 * r_6;
920  }
921  } else if ( simParams->martiniSwitching ) { // switching fxn for Martini RBCG
923 
924  BigReal r12 = (r-switchOn)*(r-switchOn); BigReal r13 = (r-switchOn)*(r-switchOn)*(r-switchOn);
925 
926  BigReal p6 = 6;
927  BigReal A6 = p6 * ((p6+1)*switchOn-(p6+4)*cutoff)/(pow(cutoff,p6+2)*pow(cutoff-switchOn,2));
928  BigReal B6 = -p6 * ((p6+1)*switchOn-(p6+3)*cutoff)/(pow(cutoff,p6+2)*pow(cutoff-switchOn,3));
929  BigReal C6 = 1.0/pow(cutoff,p6)-A6/3.0*pow(cutoff-switchOn,3)-B6/4.0*pow(cutoff-switchOn,4);
930 
931  BigReal p12 = 12;
932  BigReal A12 = p12 * ((p12+1)*switchOn-(p12+4)*cutoff)/(pow(cutoff,p12+2)*pow(cutoff-switchOn,2));
933  BigReal B12 = -p12 * ((p12+1)*switchOn-(p12+3)*cutoff)/(pow(cutoff,p12+2)*pow(cutoff-switchOn,3));
934  BigReal C12 = 1.0/pow(cutoff,p12)-A12/3.0*pow(cutoff-switchOn,3)-B12/4.0*pow(cutoff-switchOn,4);
935 
936  BigReal LJshifttempA = -(A12/3)*r13 - (B12/4)*r12*r12 - C12;
937  BigReal LJshifttempB = -(A6/3)*r13 - (B6/4)*r12*r12 - C6;
938  const BigReal shiftValA = // used for Lennard-Jones
939  ( r2 > switchOn2 ? LJshifttempA : -C12);
940  const BigReal shiftValB = // used for Lennard-Jones
941  ( r2 > switchOn2 ? LJshifttempB : -C6);
942 
943  BigReal LJdshifttempA = -A12*r12 - B12*r13;
944  BigReal LJdshifttempB = -A6*r12 - B6*r13;
945  const BigReal dshiftValA = // used for Lennard-Jones
946  ( r2 > switchOn2 ? LJdshifttempA*0.5*r_1 : 0 );
947  const BigReal dshiftValB = // used for Lennard-Jones
948  ( r2 > switchOn2 ? LJdshifttempB*0.5*r_1 : 0 );
949 
950 
951 
952 
953  //have not addressed r > cutoff
954 
955  // dshiftValA*= 0.5*r_1;
956  // dshiftValB*= 0.5*r_1;
957 
958  vdwa_energy = r_12 + shiftValA;
959  vdwb_energy = r_6 + shiftValB;
960 
961  vdwa_gradient = -6/pow(r,14) + dshiftValA ;
962  vdwb_gradient = -3/pow(r,8) + dshiftValB;
963 
964  } else { // switch energy
966 
967  const BigReal c2 = cutoff2-r2;
968  const BigReal c4 = c2*(c3-2.0*c2);
969  const BigReal switchVal = // used for Lennard-Jones
970  ( r2 > switchOn2 ? c2*c4*c1 : 1.0 );
971  const BigReal dSwitchVal = // d switchVal / d r2
972  ( r2 > switchOn2 ? 2*c1*(c2*c2-c4) : 0.0 );
973 
974  vdwa_energy = switchVal * r_12;
975  vdwb_energy = switchVal * r_6;
976 
977  vdwa_gradient = ( dSwitchVal - 6.0 * switchVal * r_2 ) * r_12;
978  vdwb_gradient = ( dSwitchVal - 3.0 * switchVal * r_2 ) * r_6;
979  }
980 
981 
982 #if defined(NAMD_KNL) || defined(NAMD_AVXTILES)
983  if ( knl_table ) {
984  knl_fast_ener_table[i] = -1.*fast_energy;
985  knl_fast_grad_table[i] = -2.*fast_gradient;
986  knl_scor_ener_table[i] = -1.*scor_energy;
987  knl_scor_grad_table[i] = -2.*scor_gradient;
988  knl_slow_ener_table[i] = (-1.*scor_energy - (scale14-1)*slow_energy) /
989  scale14;
990  knl_slow_grad_table[i] = (-2.*scor_gradient -
991  (scale14-1)*2.*slow_gradient) / scale14;
992  knl_excl_ener_table[i] = slow_energy - scor_energy;
993  knl_excl_grad_table[i] = 2.*(slow_gradient - scor_gradient);
994 #ifdef NAMD_KNL
995  knl_corr_ener_table[i] = -1.*(fast_energy + scor_energy);
996  knl_corr_grad_table[i] = -2.*(fast_gradient + scor_gradient);
997 #endif
998  if ( i == nn-1 ) {
999  knl_fast_ener_table[nn] = knl_fast_ener_table[i];
1000  knl_fast_grad_table[nn] = knl_fast_grad_table[i];
1001  knl_scor_ener_table[nn] = knl_scor_ener_table[i];
1002  knl_scor_grad_table[nn] = knl_scor_grad_table[i];
1003  knl_slow_ener_table[nn] = knl_slow_ener_table[i];
1004  knl_slow_grad_table[nn] = knl_slow_grad_table[i];
1005  knl_excl_ener_table[nn] = knl_excl_ener_table[i];
1006  knl_excl_grad_table[nn] = knl_excl_grad_table[i];
1007 #ifdef NAMD_KNL
1008  knl_corr_ener_table[nn] = knl_corr_ener_table[i];
1009  knl_corr_grad_table[nn] = knl_corr_grad_table[i];
1010 #endif
1011  }
1012  } else {
1013 #endif
1014  *(fast_i++) = fast_energy;
1015  *(fast_i++) = fast_gradient;
1016  *(fast_i++) = 0;
1017  *(fast_i++) = 0;
1018  *(scor_i++) = scor_energy;
1019  *(scor_i++) = scor_gradient;
1020  *(scor_i++) = 0;
1021  *(scor_i++) = 0;
1022  *(slow_i++) = slow_energy;
1023  *(slow_i++) = slow_gradient;
1024  *(slow_i++) = 0;
1025  *(slow_i++) = 0;
1026  *(vdwa_i++) = vdwa_energy;
1027  *(vdwa_i++) = vdwa_gradient;
1028  *(vdwa_i++) = 0;
1029  *(vdwa_i++) = 0;
1030  *(vdwb_i++) = vdwb_energy;
1031  *(vdwb_i++) = vdwb_gradient;
1032  *(vdwb_i++) = 0;
1033  *(vdwb_i++) = 0;
1034  *(r2_i++) = r2 + r2_delta;
1035 #if defined(NAMD_KNL) || defined(NAMD_AVXTILES)
1036  }
1037 #endif
1038 
1039  }
1040 #if defined(NAMD_KNL) || defined(NAMD_AVXTILES)
1041  } // knl_table loop
1042 #endif
1043 
1044  if ( ! r2_delta_i ) {
1045  NAMD_bug("Failed to find table entry for r2 == r2_limit\n");
1046  }
1047  if ( r2_table[r2_delta_i] > r2_limit + r2_delta ) {
1048  NAMD_bug("Found bad table entry for r2 == r2_limit\n");
1049  }
1050 
1051  int j;
1052  const char *table_name = "XXXX";
1053  int smooth_short = 0;
1054  for ( j=0; j<5; ++j ) {
1055  BigReal *t0 = 0;
1056  switch (j) {
1057  case 0:
1058  t0 = fast_table;
1059  table_name = "FAST";
1060  smooth_short = 1;
1061  break;
1062  case 1:
1063  t0 = scor_table;
1064  table_name = "SCOR";
1065  smooth_short = 0;
1066  break;
1067  case 2:
1068  t0 = slow_table;
1069  table_name = "SLOW";
1070  smooth_short = 0;
1071  break;
1072  case 3:
1073  t0 = vdwa_table;
1074  table_name = "VDWA";
1075  smooth_short = 1;
1076  break;
1077  case 4:
1078  t0 = vdwb_table;
1079  table_name = "VDWB";
1080  smooth_short = 1;
1081  break;
1082  }
1083  // patch up data for i=0
1084  t0[0] = t0[4] - t0[5] * ( r2_delta / 64.0 ); // energy
1085  t0[1] = t0[5]; // gradient
1086  t0[2] = 0;
1087  t0[3] = 0;
1088  if ( smooth_short ) {
1089  BigReal energy0 = t0[4*r2_delta_i];
1090  BigReal gradient0 = t0[4*r2_delta_i+1];
1091  BigReal r20 = r2_table[r2_delta_i];
1092  t0[0] = energy0 - gradient0 * (r20 - r2_table[0]); // energy
1093  t0[1] = gradient0; // gradient
1094  }
1095  BigReal *t;
1096  for ( i=0,t=t0; i<(n-1); ++i,t+=4 ) {
1097  BigReal x = ( r2_delta * ( 1 << (i/64) ) ) / 64.0;
1098  if ( r2_table[i+1] != r2_table[i] + x ) {
1099  NAMD_bug("Bad table delta calculation.\n");
1100  }
1101  if ( smooth_short && i+1 < r2_delta_i ) {
1102  BigReal energy0 = t0[4*r2_delta_i];
1103  BigReal gradient0 = t0[4*r2_delta_i+1];
1104  BigReal r20 = r2_table[r2_delta_i];
1105  t[4] = energy0 - gradient0 * (r20 - r2_table[i+1]); // energy
1106  t[5] = gradient0; // gradient
1107  }
1108  BigReal v1 = t[0];
1109  BigReal g1 = t[1];
1110  BigReal v2 = t[4];
1111  BigReal g2 = t[5];
1112  // explicit formulas for v1 + g1 x + c x^2 + d x^3
1113  BigReal c = ( 3.0 * (v2 - v1) - x * (2.0 * g1 + g2) ) / ( x * x );
1114  BigReal d = ( -2.0 * (v2 - v1) + x * (g1 + g2) ) / ( x * x * x );
1115  // since v2 - v1 is imprecise, we refine c and d numerically
1116  // important because we need accurate forces (more than energies!)
1117  for ( int k=0; k < 2; ++k ) {
1118  BigReal dv = (v1 - v2) + ( ( d * x + c ) * x + g1 ) * x;
1119  BigReal dg = (g1 - g2) + ( 3.0 * d * x + 2.0 * c ) * x;
1120  c -= ( 3.0 * dv - x * dg ) / ( x * x );
1121  d -= ( -2.0 * dv + x * dg ) / ( x * x * x );
1122  }
1123  // store in the array;
1124  t[2] = c; t[3] = d;
1125  }
1126 
1127  if ( ! CkMyPe() ) {
1128  BigReal dvmax = 0;
1129  BigReal dgmax = 0;
1130  BigReal dvmax_r = 0;
1131  BigReal dgmax_r = 0;
1132  BigReal fdvmax = 0;
1133  BigReal fdgmax = 0;
1134  BigReal fdvmax_r = 0;
1135  BigReal fdgmax_r = 0;
1136  BigReal dgcdamax = 0;
1137  BigReal dgcdimax = 0;
1138  BigReal dgcaimax = 0;
1139  BigReal dgcdamax_r = 0;
1140  BigReal dgcdimax_r = 0;
1141  BigReal dgcaimax_r = 0;
1142  BigReal fdgcdamax = 0;
1143  BigReal fdgcdimax = 0;
1144  BigReal fdgcaimax = 0;
1145  BigReal fdgcdamax_r = 0;
1146  BigReal fdgcdimax_r = 0;
1147  BigReal fdgcaimax_r = 0;
1148  BigReal gcm = fabs(t0[1]); // gradient magnitude running average
1149  for ( i=0,t=t0; i<(n-1); ++i,t+=4 ) {
1150  const BigReal r2_base = r2_delta * ( 1 << (i/64) );
1151  const BigReal r2_del = r2_base / 64.0;
1152  const BigReal r2 = r2_base - r2_delta + r2_del * (i%64);
1153  const BigReal r = sqrt(r2);
1154  if ( r > cutoff ) break;
1155  BigReal x = r2_del;
1156  BigReal dv = ( ( t[3] * x + t[2] ) * x + t[1] ) * x + t[0] - t[4];
1157  BigReal dg = ( 3.0 * t[3] * x + 2.0 * t[2] ) * x + t[1] - t[5];
1158  if ( t[4] != 0. && fabs(dv/t[4]) > fdvmax ) {
1159  fdvmax = fabs(dv/t[4]); fdvmax_r = r;
1160  }
1161  if ( fabs(dv) > dvmax ) {
1162  dvmax = fabs(dv); dvmax_r = r;
1163  }
1164  if ( t[5] != 0. && fabs(dg/t[5]) > fdgmax ) {
1165  fdgmax = fabs(dg/t[5]); fdgmax_r = r;
1166  }
1167  if ( fabs(dg) > dgmax ) {
1168  dgmax = fabs(dg); dgmax_r = r;
1169  }
1170  BigReal gcd = (t[4] - t[0]) / x; // centered difference gradient
1171  BigReal gcd_prec = (fabs(t[0]) + fabs(t[4])) * 1.e-15 / x; // roundoff
1172  gcm = 0.9 * gcm + 0.1 * fabs(t[5]); // magnitude running average
1173  BigReal gca = 0.5 * (t[1] + t[5]); // centered average gradient
1174  BigReal gci = ( 0.75 * t[3] * x + t[2] ) * x + t[1]; // interpolated
1175  BigReal rc = sqrt(r2 + 0.5 * x);
1176  BigReal dgcda = gcd - gca;
1177  if ( dgcda != 0. && fabs(dgcda) < gcd_prec ) {
1178  // CkPrintf("ERROR %g < PREC %g AT %g AVG VAL %g\n", dgcda, gcd_prec, rc, gca);
1179  dgcda = 0.;
1180  }
1181  BigReal dgcdi = gcd - gci;
1182  if ( dgcdi != 0. && fabs(dgcdi) < gcd_prec ) {
1183  // CkPrintf("ERROR %g < PREC %g AT %g INT VAL %g\n", dgcdi, gcd_prec, rc, gci);
1184  dgcdi = 0.;
1185  }
1186  BigReal dgcai = gca - gci;
1187  if ( t[1]*t[5] > 0. && gcm != 0. && fabs(dgcda/gcm) > fdgcdamax ) {
1188  fdgcdamax = fabs(dgcda/gcm); fdgcdamax_r = rc;
1189  }
1190  if ( fabs(dgcda) > fdgcdamax ) {
1191  dgcdamax = fabs(dgcda); dgcdamax_r = rc;
1192  }
1193  if ( t[1]*t[5] > 0. && gcm != 0. && fabs(dgcdi/gcm) > fdgcdimax ) {
1194  fdgcdimax = fabs(dgcdi/gcm); fdgcdimax_r = rc;
1195  }
1196  if ( fabs(dgcdi) > fdgcdimax ) {
1197  dgcdimax = fabs(dgcdi); dgcdimax_r = rc;
1198  }
1199  if ( t[1]*t[5] > 0. && gcm != 0. && fabs(dgcai/gcm) > fdgcaimax ) {
1200  fdgcaimax = fabs(dgcai/gcm); fdgcaimax_r = rc;
1201  }
1202  if ( fabs(dgcai) > fdgcaimax ) {
1203  dgcaimax = fabs(dgcai); dgcaimax_r = rc;
1204  }
1205 #if 0
1206  CkPrintf("TABLE %s %g %g %g %g\n",table_name,rc,dgcda/gcm,dgcda,gci);
1207  if (dv != 0.) CkPrintf("TABLE %d ENERGY ERROR %g AT %g (%d)\n",j,dv,r,i);
1208  if (dg != 0.) CkPrintf("TABLE %d FORCE ERROR %g AT %g (%d)\n",j,dg,r,i);
1209 #endif
1210  }
1211  if ( dvmax != 0.0 ) {
1212  iout << iINFO << "ABSOLUTE IMPRECISION IN " << table_name <<
1213  " TABLE ENERGY: " << dvmax << " AT " << dvmax_r << "\n" << endi;
1214  }
1215  if ( fdvmax != 0.0 ) {
1216  iout << iINFO << "RELATIVE IMPRECISION IN " << table_name <<
1217  " TABLE ENERGY: " << fdvmax << " AT " << fdvmax_r << "\n" << endi;
1218  }
1219  if ( dgmax != 0.0 ) {
1220  iout << iINFO << "ABSOLUTE IMPRECISION IN " << table_name <<
1221  " TABLE FORCE: " << dgmax << " AT " << dgmax_r << "\n" << endi;
1222  }
1223  if ( fdgmax != 0.0 ) {
1224  iout << iINFO << "RELATIVE IMPRECISION IN " << table_name <<
1225  " TABLE FORCE: " << fdgmax << " AT " << fdgmax_r << "\n" << endi;
1226  }
1227  if (fdgcdamax != 0.0 ) {
1228  iout << iINFO << "INCONSISTENCY IN " << table_name <<
1229  " TABLE ENERGY VS FORCE: " << fdgcdamax << " AT " << fdgcdamax_r << "\n" << endi;
1230  if ( fdgcdamax > 0.1 ) {
1231  iout << iERROR << "\n";
1232  iout << iERROR << "CALCULATED " << table_name <<
1233  " FORCE MAY NOT MATCH ENERGY! POSSIBLE BUG!\n";
1234  iout << iERROR << "\n";
1235  }
1236  }
1237  if (0 && fdgcdimax != 0.0 ) {
1238  iout << iINFO << "INCONSISTENCY IN " << table_name <<
1239  " TABLE ENERGY VS FORCE: " << fdgcdimax << " AT " << fdgcdimax_r << "\n" << endi;
1240  }
1241  if ( 0 && fdgcaimax != 0.0 ) {
1242  iout << iINFO << "INCONSISTENCY IN " << table_name <<
1243  " TABLE AVG VS INT FORCE: " << fdgcaimax << " AT " << fdgcaimax_r << "\n" << endi;
1244  }
1245  }
1246 
1247  }
1248 
1249  for ( i=0; i<4*n; ++i ) {
1250  corr_table[i] = fast_table[i] + scor_table[i];
1251  full_table[i] = fast_table[i] + slow_table[i];
1252  }
1253 
1254 #if 0
1255  for ( i=0; i<n; ++i ) {
1256  for ( int j=0; j<4; ++j ) {
1257  table_short[16*i+6-2*j] = table_noshort[16*i+6-2*j] = vdwa_table[4*i+j];
1258  table_short[16*i+7-2*j] = table_noshort[16*i+7-2*j] = vdwb_table[4*i+j];
1259  table_short[16*i+8+3-j] = fast_table[4*i+j];
1260  table_short[16*i+12+3-j] = scor_table[4*i+j];
1261  table_noshort[16*i+8+3-j] = corr_table[4*i+j];
1262  table_noshort[16*i+12+3-j] = full_table[4*i+j];
1263  }
1264  }
1265 #endif
1266 
1267  for ( i=0; i<n; ++i ) {
1268  table_short[16*i+0] = table_noshort[16*i+0] = -6.*vdwa_table[4*i+3];
1269  table_short[16*i+1] = table_noshort[16*i+1] = -4.*vdwa_table[4*i+2];
1270  table_short[16*i+2] = table_noshort[16*i+2] = -2.*vdwa_table[4*i+1];
1271  table_short[16*i+3] = table_noshort[16*i+3] = -1.*vdwa_table[4*i+0];
1272 
1273  table_short[16*i+4] = table_noshort[16*i+4] = -6.*vdwb_table[4*i+3];
1274  table_short[16*i+5] = table_noshort[16*i+5] = -4.*vdwb_table[4*i+2];
1275  table_short[16*i+6] = table_noshort[16*i+6] = -2.*vdwb_table[4*i+1];
1276  table_short[16*i+7] = table_noshort[16*i+7] = -1.*vdwb_table[4*i+0];
1277 
1278  table_short[16*i+8] = -6.*fast_table[4*i+3];
1279  table_short[16*i+9] = -4.*fast_table[4*i+2];
1280  table_short[16*i+10] = -2.*fast_table[4*i+1];
1281  table_short[16*i+11] = -1.*fast_table[4*i+0];
1282 
1283  table_noshort[16*i+8] = -6.*corr_table[4*i+3];
1284  table_noshort[16*i+9] = -4.*corr_table[4*i+2];
1285  table_noshort[16*i+10] = -2.*corr_table[4*i+1];
1286  table_noshort[16*i+11] = -1.*corr_table[4*i+0];
1287 
1288  table_short[16*i+12] = -6.*scor_table[4*i+3];
1289  table_short[16*i+13] = -4.*scor_table[4*i+2];
1290  table_short[16*i+14] = -2.*scor_table[4*i+1];
1291  table_short[16*i+15] = -1.*scor_table[4*i+0];
1292 
1293  table_noshort[16*i+12] = -6.*full_table[4*i+3];
1294  table_noshort[16*i+13] = -4.*full_table[4*i+2];
1295  table_noshort[16*i+14] = -2.*full_table[4*i+1];
1296  table_noshort[16*i+15] = -1.*full_table[4*i+0];
1297  }
1298 
1299 #if 0
1300  char fname[100];
1301  sprintf(fname,"/tmp/namd.table.pe%d.dat",CkMyPe());
1302  FILE *f = fopen(fname,"w");
1303  for ( i=0; i<(n-1); ++i ) {
1304  const BigReal r2_base = r2_delta * ( 1 << (i/64) );
1305  const BigReal r2_del = r2_base / 64.0;
1306  const BigReal r2 = r2_base - r2_delta + r2_del * (i%64);
1307  BigReal *t;
1308  if ( r2 + r2_delta != r2_table[i] ) fprintf(f,"r2 error! ");
1309  fprintf(f,"%g",r2);
1310  t = fast_table + 4*i;
1311  fprintf(f," %g %g %g %g", t[0], t[1], t[2], t[3]);
1312  t = scor_table + 4*i;
1313  fprintf(f," %g %g %g %g", t[0], t[1], t[2], t[3]);
1314  t = slow_table + 4*i;
1315  fprintf(f," %g %g %g %g", t[0], t[1], t[2], t[3]);
1316  t = corr_table + 4*i;
1317  fprintf(f," %g %g %g %g", t[0], t[1], t[2], t[3]);
1318  t = full_table + 4*i;
1319  fprintf(f," %g %g %g %g", t[0], t[1], t[2], t[3]);
1320  t = vdwa_table + 4*i;
1321  fprintf(f," %g %g %g %g", t[0], t[1], t[2], t[3]);
1322  t = vdwb_table + 4*i;
1323  fprintf(f," %g %g %g %g", t[0], t[1], t[2], t[3]);
1324  fprintf(f,"\n");
1325  }
1326  fclose(f);
1327 #endif
1328 
1329  //Flip slow table to match table_four_i
1330  for ( i=0; i<n; ++i ) {
1331  BigReal tmp0, tmp1, tmp2, tmp3;
1332  tmp0 = slow_table [i*4 + 0];
1333  tmp1 = slow_table [i*4 + 1];
1334  tmp2 = slow_table [i*4 + 2];
1335  tmp3 = slow_table [i*4 + 3];
1336 
1337  slow_table [i*4 + 0] = tmp3;
1338  slow_table [i*4 + 1] = tmp2;
1339  slow_table [i*4 + 2] = tmp1;
1340  slow_table [i*4 + 3] = tmp0;
1341  }
1342 
1343 #ifdef NAMD_CUDA
1344  if (!simParams->useCUDA2) {
1346  }
1347 #endif
1348 
1349  #ifdef NAMD_MIC
1350  send_build_mic_force_table();
1351  #endif
1352 }
static Node * Object()
Definition: Node.h:86
static void calc_pair_fullelect_pprof(nonbonded *)
static BigReal * fast_table
#define SCALED14
Definition: SimParameters.h:43
static void calc_pair_energy_merge_fullelect_tabener(nonbonded *)
static void calc_self_energy_go(nonbonded *)
std::ostream & iINFO(std::ostream &s)
Definition: InfoStream.C:107
static void calc_self_energy_merge_fullelect_ti(nonbonded *)
static BigReal * scor_table
static void calc_pair_les(nonbonded *)
static void calc_self_energy_slow_fullelect_fep(nonbonded *)
static void calc_pair_merge_fullelect(nonbonded *)
int columnsize
Definition: Parameters.h:253
static void calc_self_energy_merge_fullelect_int(nonbonded *)
static void calc_self_energy_slow_fullelect(nonbonded *)
#define XPLOR
Definition: SimParameters.h:55
static void calc_self_energy_merge_fullelect_tabener(nonbonded *)
Bool vdwGeometricSigma
static void calc_self_energy_slow_fullelect_ti(nonbonded *)
static void calc_self_energy_fullelect_int(nonbonded *)
static void calc_self_ti(nonbonded *)
static void calc_self_fullelect_pprof(nonbonded *)
static void calc_self_tabener(nonbonded *)
static void calc_self_energy_fullelect(nonbonded *)
static void calc_pair_slow_fullelect_ti(nonbonded *)
#define SHARP
Definition: SimParameters.h:54
static void(* calcSelf)(nonbonded *)
static void calc_pair_merge_fullelect_tabener(nonbonded *)
static void calc_self_les(nonbonded *)
const BigReal A
SimParameters * simParameters
Definition: Node.h:178
BigReal nonbondedScaling
static void calc_pair_merge_fullelect_go(nonbonded *)
#define SPLIT_NONE
static void calc_pair_energy_merge_fullelect(nonbonded *)
static void calc_pair_slow_fullelect_pprof(nonbonded *)
static const Molecule * mol
static void calc_pair_energy_fullelect_fep(nonbonded *)
static void calc_self_energy_fullelect_pprof(nonbonded *)
float Real
Definition: common.h:107
static void calc_self_energy_fullelect_les(nonbonded *)
static void calc_self_energy_fullelect_ti(nonbonded *)
BigReal limitDist
static void calc_self_fullelect(nonbonded *)
#define VDW_SWITCH_MODE_MARTINI
static void calc_self_energy_ti(nonbonded *)
static BigReal * vdwa_table
static void calc_self_energy_int(nonbonded *)
int get_table_dim() const
Definition: LJTable.h:44
static void calc_pair_slow_fullelect(nonbonded *)
static void calc_pair(nonbonded *)
static void calc_self_go(nonbonded *)
#define iout
Definition: InfoStream.h:87
static void(* calcMergePair)(nonbonded *)
int pressureProfileSlabs
static void calc_pair_energy_tabener(nonbonded *)
static void calc_self_slow_fullelect_pprof(nonbonded *)
static void calc_pair_energy_slow_fullelect_go(nonbonded *)
static void calc_self_energy_merge_fullelect_fep(nonbonded *)
static void(* calcMergePairEnergy)(nonbonded *)
static void calc_pair_energy_go(nonbonded *)
static void calc_pair_merge_fullelect_ti(nonbonded *)
#define C1
Definition: SimParameters.h:56
Bool pairInteractionOn
static BigReal * full_table
static void calc_pair_merge_fullelect_les(nonbonded *)
static void calc_pair_slow_fullelect_go(nonbonded *)
#define SPLIT_MARTINI
static void calc_pair_energy_merge_fullelect_fep(nonbonded *)
BigReal switchingDist
BigReal drudeNbtholeCut
static void(* calcSlowPairEnergy)(nonbonded *)
void send_build_cuda_force_table()
static void(* calcPair)(nonbonded *)
static void(* calcSlowPair)(nonbonded *)
#define SPLIT_SHIFT
static void calc_pair_energy_fullelect_go(nonbonded *)
static void calc_pair_energy_slow_fullelect_tabener(nonbonded *)
static void calc_self_slow_fullelect(nonbonded *)
static void calc_self_energy_les(nonbonded *)
static void calc_pair_energy_fep(nonbonded *)
static void(* calcMergeSelfEnergy)(nonbonded *)
static void calc_pair_tabener(nonbonded *)
static void calc_pair_energy_pprof(nonbonded *)
static BigReal * table_noshort
static void calc_self_energy_slow_fullelect_tabener(nonbonded *)
void NAMD_bug(const char *err_msg)
Definition: common.C:123
static void calc_self_energy_fullelect_tabener(nonbonded *)
static void calc_pair_energy_int(nonbonded *)
static void calc_self_slow_fullelect_tabener(nonbonded *)
static void calc_pair_energy_slow_fullelect_les(nonbonded *)
static void calc_pair_energy_ti(nonbonded *)
static void calc_pair_energy_slow_fullelect_fep(nonbonded *)
static void calc_self_slow_fullelect_ti(nonbonded *)
static void calc_pair_slow_fullelect_les(nonbonded *)
GoChoices goMethod
static void calc_pair_fullelect_ti(nonbonded *)
static void calc_pair_energy(nonbonded *)
static BigReal * table_ener
#define C2
Definition: SimParameters.h:57
int Bool
Definition: common.h:131
static void calc_pair_pprof(nonbonded *)
static void calc_pair_energy_fullelect_ti(nonbonded *)
static void calc_self_energy_merge_fullelect_les(nonbonded *)
static void calc_self_slow_fullelect_go(nonbonded *)
static void calc_pair_energy_merge_fullelect_go(nonbonded *)
static void calc_error(nonbonded *)
static void calc_self_energy_fullelect_go(nonbonded *)
BigReal PMEEwaldCoefficient
int get_vdw_pair_params(Index ind1, Index ind2, Real *, Real *, Real *, Real *)
Definition: Parameters.C:3680
static void calc_self_fullelect_tabener(nonbonded *)
static void(* calcFullSelf)(nonbonded *)
void NAMD_die(const char *err_msg)
Definition: common.C:83
static void calc_self_merge_fullelect_ti(nonbonded *)
static void(* calcSlowSelf)(nonbonded *)
#define SPLIT_C1
static void calc_self_fullelect_les(nonbonded *)
static void calc_self_merge_fullelect_go(nonbonded *)
int get_num_vdw_params(void)
Definition: Parameters.h:531
static void calc_self_energy_merge_fullelect_go(nonbonded *)
static void calc_self_energy_merge_fullelect(nonbonded *)
Bool vdwForceSwitching
static void calc_pair_energy_fullelect_int(nonbonded *)
static void calc_pair_energy_merge_fullelect_pprof(nonbonded *)
static BigReal * lambda_table
static void calc_self_energy_fep(nonbonded *)
static void(* calcSlowSelfEnergy)(nonbonded *)
static void calc_pair_energy_slow_fullelect_pprof(nonbonded *)
Parameters * parameters
Definition: Node.h:177
static BigReal * slow_table
static void(* calcSelfEnergy)(nonbonded *)
static void(* calcPairEnergy)(nonbonded *)
static void calc_pair_fullelect_les(nonbonded *)
static void calc_pair_energy_les(nonbonded *)
int pressureProfileAtomTypes
#define simParams
Definition: Output.C:127
static void calc_self_merge_fullelect(nonbonded *)
static void calc_self_energy_tabener(nonbonded *)
static void calc_pair_energy_merge_fullelect_int(nonbonded *)
static void calc_self_energy_slow_fullelect_pprof(nonbonded *)
static void calc_self_energy_pprof(nonbonded *)
static void calc_pair_energy_fullelect_pprof(nonbonded *)
static void calc_pair_fullelect_go(nonbonded *)
static void calc_pair_energy_slow_fullelect(nonbonded *)
static void calc_pair_energy_fullelect_les(nonbonded *)
static BigReal * vdwb_table
static void calc_pair_energy_fullelect_tabener(nonbonded *)
#define SPLIT_C2
BigReal * table_ener
Definition: Parameters.h:254
static void(* calcFullPair)(nonbonded *)
#define VDW_SWITCH_MODE_FORCE
static void calc_pair_merge_fullelect_pprof(nonbonded *)
static const LJTable * ljTable
static void calc_self_energy_merge_fullelect_pprof(nonbonded *)
const BigReal B
#define VDW_SWITCH_MODE_ENERGY
Bool pressureProfileOn
static void(* calcFullPairEnergy)(nonbonded *)
static BigReal * corr_table
static BigReal * table_short
Bool pairInteractionSelf
static void calc_self(nonbonded *)
#define SPOLY(pg, pdg, ra, split)
Definition: msm_defn.h:140
static void calc_self_fullelect_ti(nonbonded *)
BigReal dielectric
static void calc_pair_fullelect_tabener(nonbonded *)
static void calc_pair_energy_merge_fullelect_ti(nonbonded *)
std::ostream & iERROR(std::ostream &s)
Definition: InfoStream.C:109
infostream & endi(infostream &s)
Definition: InfoStream.C:38
static BigReal * table_alloc
static void calc_self_energy_fullelect_fep(nonbonded *)
Bool tabulatedEnergies
static void calc_self_merge_fullelect_tabener(nonbonded *)
static BigReal alchVdwShiftCoeff
static void calc_pair_go(nonbonded *)
gridSize x
static void calc_pair_ti(nonbonded *)
ExclusionSettings exclude
static void calc_self_energy(nonbonded *)
void get_vdw_params(Real *sigma, Real *epsilon, Real *sigma14, Real *epsilon14, Index index)
Definition: Parameters.h:497
static void calc_self_fullelect_go(nonbonded *)
static void calc_pair_energy_merge_fullelect_les(nonbonded *)
static void calc_self_pprof(nonbonded *)
static void calc_self_merge_fullelect_les(nonbonded *)
Molecule * molecule
Definition: Node.h:176
static void calc_pair_slow_fullelect_tabener(nonbonded *)
static void calc_pair_energy_fullelect(nonbonded *)
static void calc_self_merge_fullelect_pprof(nonbonded *)
static void calc_self_energy_slow_fullelect_go(nonbonded *)
static void calc_pair_energy_slow_fullelect_ti(nonbonded *)
static void(* calcMergeSelf)(nonbonded *)
static void calc_self_energy_slow_fullelect_les(nonbonded *)
double BigReal
Definition: common.h:112
static void(* calcFullSelfEnergy)(nonbonded *)
BigReal alchVdwShiftCoeff
static void calc_pair_fullelect(nonbonded *)
static void calc_self_slow_fullelect_les(nonbonded *)
static BigReal ComputeNonbondedUtil::square ( const BigReal x,
const BigReal y,
const BigReal z 
)
inlinestatic

Definition at line 428 of file ComputeNonbondedUtil.h.

431  {
432  return(x*x+y*y+z*z);
433  }
gridSize z
gridSize y
gridSize x
void ComputeNonbondedUtil::submitPressureProfileData ( BigReal data,
SubmitReduction reduction 
)
static

Definition at line 218 of file ComputeNonbondedUtil.C.

References SubmitReduction::add(), pressureProfileAtomTypes, and pressureProfileSlabs.

Referenced by ComputeNonbondedPair::doForce(), and ComputeNonbondedSelf::doForce().

220 {
221  if (!reduction) return;
222  int numAtomTypes = pressureProfileAtomTypes;
223  // For ease of calculation we stored interactions between types
224  // i and j in (ni+j). For efficiency now we coalesce the
225  // cross interactions so that just i<=j are stored.
226  const int arraysize = 3*pressureProfileSlabs;
227  size_t nelems = arraysize*(numAtomTypes*(numAtomTypes+1))/2;
228  BigReal *arr = new BigReal[nelems];
229  memset(arr, 0, nelems*sizeof(BigReal));
230 
231  int i, j;
232  for (i=0; i<numAtomTypes; i++) {
233  for (j=0; j<numAtomTypes; j++) {
234  int ii=i;
235  int jj=j;
236  if (ii > jj) { int tmp=ii; ii=jj; jj=tmp; }
237  const int reductionOffset = (ii*numAtomTypes - (ii*(ii+1))/2 + jj)*arraysize;
238  for (int k=0; k<arraysize; k++) {
239  arr[reductionOffset+k] += data[k];
240  }
241  data += arraysize;
242  }
243  }
244  // copy into reduction
245  reduction->add(nelems, arr);
246  delete [] arr;
247 }
void add(int nitems, const BigReal *arr)
Definition: ReductionMgr.h:320
double BigReal
Definition: common.h:112
void ComputeNonbondedUtil::submitReductionData ( BigReal data,
SubmitReduction reduction 
)
static

Definition at line 186 of file ComputeNonbondedUtil.C.

References ADD_TENSOR, ADD_VECTOR, electEnergyIndex, electEnergyIndex_s, electEnergyIndex_ti_1, electEnergyIndex_ti_2, exclChecksumIndex, fullElectEnergyIndex, fullElectEnergyIndex_s, fullElectEnergyIndex_ti_1, fullElectEnergyIndex_ti_2, goNativeEnergyIndex, goNonnativeEnergyIndex, groGaussEnergyIndex, groLJEnergyIndex, SubmitReduction::item(), pairlistWarningIndex, REDUCTION_COMPUTE_CHECKSUM, REDUCTION_ELECT_ENERGY, REDUCTION_ELECT_ENERGY_F, REDUCTION_ELECT_ENERGY_SLOW, REDUCTION_ELECT_ENERGY_SLOW_F, REDUCTION_ELECT_ENERGY_SLOW_TI_1, REDUCTION_ELECT_ENERGY_SLOW_TI_2, REDUCTION_ELECT_ENERGY_TI_1, REDUCTION_ELECT_ENERGY_TI_2, REDUCTION_EXCLUSION_CHECKSUM, REDUCTION_GO_NATIVE_ENERGY, REDUCTION_GO_NONNATIVE_ENERGY, REDUCTION_GRO_GAUSS_ENERGY, REDUCTION_GRO_LJ_ENERGY, REDUCTION_LJ_ENERGY, REDUCTION_LJ_ENERGY_F, REDUCTION_LJ_ENERGY_TI_1, REDUCTION_LJ_ENERGY_TI_2, REDUCTION_PAIRLIST_WARNINGS, vdwEnergyIndex, vdwEnergyIndex_s, vdwEnergyIndex_ti_1, and vdwEnergyIndex_ti_2.

Referenced by ComputeNonbondedPair::doForce(), and ComputeNonbondedSelf::doForce().

187 {
190  reduction->item(REDUCTION_ELECT_ENERGY) += data[electEnergyIndex];
192  reduction->item(REDUCTION_LJ_ENERGY) += data[vdwEnergyIndex];
193  // Ported by JLai
194  reduction->item(REDUCTION_GRO_LJ_ENERGY) += data[groLJEnergyIndex];
198  // End of port -- JLai
199 //fepb
200  reduction->item(REDUCTION_ELECT_ENERGY_F) += data[electEnergyIndex_s];
202  reduction->item(REDUCTION_LJ_ENERGY_F) += data[vdwEnergyIndex_s];
203 
210 //fepe
211  ADD_TENSOR(reduction,REDUCTION_VIRIAL_NBOND,data,virialIndex);
212  ADD_TENSOR(reduction,REDUCTION_VIRIAL_SLOW,data,fullElectVirialIndex);
213  ADD_VECTOR(reduction,REDUCTION_PAIR_VDW_FORCE,data,pairVDWForceIndex);
214  ADD_VECTOR(reduction,REDUCTION_PAIR_ELECT_FORCE,data,pairElectForceIndex);
215  reduction->item(REDUCTION_COMPUTE_CHECKSUM) += 1.;
216 }
#define ADD_TENSOR(R, RL, D, DL)
Definition: ReductionMgr.h:32
BigReal & item(int i)
Definition: ReductionMgr.h:312
#define ADD_VECTOR(R, RL, D, DL)
Definition: ReductionMgr.h:22

Member Data Documentation

float ComputeNonbondedUtil::A12_f
static

Definition at line 373 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::A6_f
static

Definition at line 370 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::accelMDOn
static

Definition at line 407 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::alchDecouple
static

Definition at line 390 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::alchFepOn
static

Definition at line 385 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::alchThermIntOn
static

Definition at line 386 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::alchVdwShiftCoeff
static

Definition at line 388 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::alchWCAOn
static

Definition at line 387 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::B12_f
static

Definition at line 374 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::B6_f
static

Definition at line 371 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::c0
static

Definition at line 376 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::c1
static

Definition at line 377 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::C12_f
static

Definition at line 375 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::c3
static

Definition at line 378 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::c5
static

Definition at line 379 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::c6
static

Definition at line 380 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::C6_f
static

Definition at line 372 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::c7
static

Definition at line 381 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::c8
static

Definition at line 382 of file ComputeNonbondedUtil.h.

Referenced by select().

void(* ComputeNonbondedUtil::calcFullPair)(nonbonded *)
static

Definition at line 256 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedPair::doForce(), and select().

void(* ComputeNonbondedUtil::calcFullPairEnergy)(nonbonded *)
static

Definition at line 257 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedPair::doForce(), and select().

void(* ComputeNonbondedUtil::calcFullSelf)(nonbonded *)
static

Definition at line 258 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedSelf::doForce(), and select().

void(* ComputeNonbondedUtil::calcFullSelfEnergy)(nonbonded *)
static

Definition at line 259 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedSelf::doForce(), and select().

void(* ComputeNonbondedUtil::calcMergePair)(nonbonded *)
static

Definition at line 261 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedPair::doForce(), and select().

void(* ComputeNonbondedUtil::calcMergePairEnergy)(nonbonded *)
static

Definition at line 262 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedPair::doForce(), and select().

void(* ComputeNonbondedUtil::calcMergeSelf)(nonbonded *)
static

Definition at line 263 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedSelf::doForce(), and select().

void(* ComputeNonbondedUtil::calcMergeSelfEnergy)(nonbonded *)
static

Definition at line 264 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedSelf::doForce(), and select().

void(* ComputeNonbondedUtil::calcPair)(nonbonded *)
static

Definition at line 251 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedPair::doForce(), and select().

void(* ComputeNonbondedUtil::calcPairEnergy)(nonbonded *)
static

Definition at line 252 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedPair::doForce(), and select().

void(* ComputeNonbondedUtil::calcSelf)(nonbonded *)
static

Definition at line 253 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedSelf::doForce(), and select().

void(* ComputeNonbondedUtil::calcSelfEnergy)(nonbonded *)
static

Definition at line 254 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedSelf::doForce(), and select().

void(* ComputeNonbondedUtil::calcSlowPair)(nonbonded *)
static

Definition at line 266 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedPair::doForce(), and select().

void(* ComputeNonbondedUtil::calcSlowPairEnergy)(nonbonded *)
static

Definition at line 267 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedPair::doForce(), and select().

void(* ComputeNonbondedUtil::calcSlowSelf)(nonbonded *)
static

Definition at line 268 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedSelf::doForce(), and select().

void(* ComputeNonbondedUtil::calcSlowSelfEnergy)(nonbonded *)
static

Definition at line 269 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedSelf::doForce(), and select().

int ComputeNonbondedUtil::columnsize
static

Definition at line 297 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::commOnly
static
BigReal * ComputeNonbondedUtil::corr_table
static

Definition at line 306 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::cutoff
static
BigReal ComputeNonbondedUtil::cutoff2
static
float ComputeNonbondedUtil::cutoff2_f
static

Definition at line 291 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::cutoff_3
static

Definition at line 361 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::cutoff_3_f
static

Definition at line 367 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::cutoff_6
static

Definition at line 362 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::cutoff_6_f
static

Definition at line 368 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::dielectric_1
static
Bool ComputeNonbondedUtil::drudeNbthole
static

Definition at line 409 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::ewaldcof
static
BigReal * ComputeNonbondedUtil::fast_table
static
Bool ComputeNonbondedUtil::fixedAtomsOn
static

Definition at line 287 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedCUDA::doWork(), and select().

BigReal * ComputeNonbondedUtil::full_table
static

Definition at line 307 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::goForcesOn
static

Definition at line 423 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::goGroPair
static

Definition at line 422 of file ComputeNonbondedUtil.h.

Referenced by select().

int ComputeNonbondedUtil::goMethod
static

Definition at line 424 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::k_vdwa
static

Definition at line 359 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::k_vdwa_f
static

Definition at line 365 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::k_vdwb
static

Definition at line 360 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::k_vdwb_f
static

Definition at line 366 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal * ComputeNonbondedUtil::lambda_table = 0
static

Definition at line 396 of file ComputeNonbondedUtil.h.

Referenced by select().

int ComputeNonbondedUtil::lesFactor
static

Definition at line 393 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::lesOn
static

Definition at line 392 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::lesScaling
static

Definition at line 394 of file ComputeNonbondedUtil.h.

Referenced by select().

const LJTable * ComputeNonbondedUtil::ljTable = 0
static
const Molecule * ComputeNonbondedUtil::mol
static
Bool ComputeNonbondedUtil::pairInteractionOn
static

Definition at line 398 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::pairInteractionSelf
static

Definition at line 399 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::pi_ewaldcof
static

Definition at line 413 of file ComputeNonbondedUtil.h.

Referenced by select().

int ComputeNonbondedUtil::pressureProfileAtomTypes
static
BigReal ComputeNonbondedUtil::pressureProfileMin
static
Bool ComputeNonbondedUtil::pressureProfileOn
static
int ComputeNonbondedUtil::pressureProfileSlabs
static
BigReal ComputeNonbondedUtil::pressureProfileThickness
static
Bool ComputeNonbondedUtil::qmForcesOn
static

Definition at line 288 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::r2_delta
static
BigReal ComputeNonbondedUtil::r2_delta_1
static

Definition at line 295 of file ComputeNonbondedUtil.h.

Referenced by select().

int ComputeNonbondedUtil::r2_delta_exp
static
BigReal * ComputeNonbondedUtil::r2_table
static
int ComputeNonbondedUtil::rowsize
static

Definition at line 296 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::scale14
static

Definition at line 353 of file ComputeNonbondedUtil.h.

Referenced by ExclElem::computeForce(), and select().

BigReal ComputeNonbondedUtil::scaling
static
BigReal * ComputeNonbondedUtil::scor_table
static

Definition at line 304 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedCUDA::build_force_table(), and select().

BigReal * ComputeNonbondedUtil::slow_table
static

Definition at line 305 of file ComputeNonbondedUtil.h.

Referenced by ExclElem::computeForce(), and select().

BigReal ComputeNonbondedUtil::switchOn
static

Definition at line 354 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::switchOn2
static

Definition at line 356 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::switchOn_1
static

Definition at line 355 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::switchOn_f
static

Definition at line 369 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal * ComputeNonbondedUtil::table_alloc = 0
static

Definition at line 299 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal * ComputeNonbondedUtil::table_ener = 0
static

Definition at line 300 of file ComputeNonbondedUtil.h.

Referenced by select().

int ComputeNonbondedUtil::table_length
static

Definition at line 311 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal * ComputeNonbondedUtil::table_noshort
static

Definition at line 302 of file ComputeNonbondedUtil.h.

Referenced by ExclElem::computeForce(), and select().

BigReal * ComputeNonbondedUtil::table_short
static

Definition at line 301 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::v_vdwa
static

Definition at line 357 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::v_vdwa_f
static

Definition at line 363 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::v_vdwb
static

Definition at line 358 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::v_vdwb_f
static

Definition at line 364 of file ComputeNonbondedUtil.h.

Referenced by select().

int ComputeNonbondedUtil::vdw_switch_mode
static

Definition at line 419 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal * ComputeNonbondedUtil::vdwa_table
static

Definition at line 308 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedCUDA::build_force_table(), and select().

BigReal * ComputeNonbondedUtil::vdwb_table
static

Definition at line 309 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedCUDA::build_force_table(), and select().

Bool ComputeNonbondedUtil::vdwForceSwitching
static

Definition at line 389 of file ComputeNonbondedUtil.h.

Referenced by select().


The documentation for this class was generated from the following files: