ComputeNonbondedUtil Class Reference

#include <ComputeNonbondedUtil.h>

Inheritance diagram for ComputeNonbondedUtil:

ComputeLCPO ComputeNonbondedCUDA ComputeNonbondedMIC ComputeNonbondedPair ComputeNonbondedSelf CudaComputeNonbonded ExclElem List of all members.

Public Types

 exclChecksumIndex
 pairlistWarningIndex
 electEnergyIndex
 fullElectEnergyIndex
 vdwEnergyIndex
 goNativeEnergyIndex
 goNonnativeEnergyIndex
 groLJEnergyIndex
 groGaussEnergyIndex
 electEnergyIndex_s
 fullElectEnergyIndex_s
 vdwEnergyIndex_s
 vdwEnergyIndex_s_Left
 electEnergyIndex_ti_1
 fullElectEnergyIndex_ti_1
 vdwEnergyIndex_ti_1
 electEnergyIndex_ti_2
 fullElectEnergyIndex_ti_2
 vdwEnergyIndex_ti_2
 virialIndex
 fullElectVirialIndex
 pairVDWForceIndex
 pairElectForceIndex
 reductionDataSize
enum  {
  exclChecksumIndex, pairlistWarningIndex, electEnergyIndex, fullElectEnergyIndex,
  vdwEnergyIndex, goNativeEnergyIndex, goNonnativeEnergyIndex, groLJEnergyIndex,
  groGaussEnergyIndex, electEnergyIndex_s, fullElectEnergyIndex_s, vdwEnergyIndex_s,
  vdwEnergyIndex_s_Left, electEnergyIndex_ti_1, fullElectEnergyIndex_ti_1, vdwEnergyIndex_ti_1,
  electEnergyIndex_ti_2, fullElectEnergyIndex_ti_2, vdwEnergyIndex_ti_2, virialIndex,
  fullElectVirialIndex, pairVDWForceIndex, pairElectForceIndex, 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 BigReal alchLambda2
static BigReal alchVdwShiftCoeff
static Bool vdwForceSwitching
static Bool LJcorrection
static Bool Fep_WCA_repuOn
static Bool Fep_WCA_dispOn
static Bool Fep_ElecOn
static Bool Fep_Wham
static BigReal WCA_rcut1
static BigReal WCA_rcut2
static BigReal WCA_rcut3
static Bool alchDecouple
static BigReal alchRepLambda
static BigReal alchDispLambda
static BigReal alchElecLambda
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 235 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 
vdwEnergyIndex_s_Left 
electEnergyIndex_ti_1 
fullElectEnergyIndex_ti_1 
vdwEnergyIndex_ti_1 
electEnergyIndex_ti_2 
fullElectEnergyIndex_ti_2 
vdwEnergyIndex_ti_2 
virialIndex 
fullElectVirialIndex 
pairVDWForceIndex 
pairElectForceIndex 
reductionDataSize 

Definition at line 264 of file ComputeNonbondedUtil.h.


Constructor & Destructor Documentation

ComputeNonbondedUtil::ComputeNonbondedUtil (  )  [inline]

Definition at line 239 of file ComputeNonbondedUtil.h.

00239 {}

ComputeNonbondedUtil::~ComputeNonbondedUtil (  )  [inline]

Definition at line 240 of file ComputeNonbondedUtil.h.

00240 {}


Member Function Documentation

void ComputeNonbondedUtil::calc_error ( nonbonded  )  [static]

Definition at line 254 of file ComputeNonbondedUtil.C.

References NAMD_bug().

Referenced by select().

00254                                                  {
00255   NAMD_bug("Tried to call missing nonbonded compute routine.");
00256 }

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, j, 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 ComputeNonbondedSelf::doForce(), and ComputeNonbondedPair::doForce().

00261                                                                                   {
00262 //CkPrintf("SEQ%03i, P%i, CID%05i(%02i,%02i) ENTER\n",gbisParams->sequence,gbisParams->gbisPhase,gbisParams->cid,gbisParams->patchID[0],gbisParams->patchID[1]);
00263 #if CHECK_PRIORITIES
00264 CkPrintf("PE%i, S%09i, P%i\n",CkMyPe(),gbisParams->sequence,gbisParams->gbisPhase);
00265 #endif
00266   if (params->numAtoms[0] == 0 || params->numAtoms[1] == 0) return;
00267 
00268   const BigReal offset_x = params->offset.x;
00269   const BigReal offset_y = params->offset.y;
00270   const BigReal offset_z = params->offset.z;
00271 
00272   int partSize = params->numAtoms[0] / params->numParts;
00273   int minIg = 0;
00274   for (int s = 0; s < params->minPart; s++) {
00275     minIg+=params->p[0][minIg].nonbondedGroupSize;
00276   }
00277   int maxI = params->numAtoms[0];
00278   int strideIg = params->numParts;
00279 
00280   int unique = (gbisParams->numPatches == 1) ? 1 : 0;//should inner loop be unique from ourter loop
00281   int numGBISPairlists = 4;
00282   float r_cut = gbisParams->cutoff;
00283   float fsMax = FS_MAX; // gbisParams->fsMax;//FS_MAX;
00284   float a_cut = gbisParams->a_cut-fsMax;
00285   float a_cut2 = a_cut*a_cut;
00286   float a_cut_ps = a_cut + fsMax;//max screen radius
00287   float r_cut2 = r_cut*r_cut;
00288   float a_cut_ps2 = a_cut_ps*a_cut_ps;
00289   //put PL pointer back to beginning of lists
00290   for (int k = 0; k < numGBISPairlists; k++)
00291     gbisParams->gbisStepPairlists[k]->reset();
00292       
00293 
00294 /***********************************************************
00295 * GBIS Phase 1
00296 ***********************************************************/
00297 if (gbisParams->gbisPhase == 1) {
00298 //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);
00299 
00300   pairlistFromAll(params,gbisParams,minIg,strideIg,maxI);
00301 
00302 #ifdef BENCHMARK
00303   int nops = 0;
00304   int domains[] = {0, 0, 0, 0, 0, 0, 0, 0};
00305   int numDom = 7;
00306   double t1 = 1.0*clock()/CLOCKS_PER_SEC;
00307 #endif
00308   register GBReal psiI;
00309 
00310   register float dr;
00311   register float r2;
00312   register float r, r_i, r2_i;
00313   float rhoi0, rhois, rhojs, rhoj0;
00314   Position ri, rj;
00315   register int j;
00316   int numPairs;
00317   register float ta = TA;
00318   register float tb = TB;
00319   register float tc = TC;
00320   register float td = TD;
00321   register float te = TE;
00322 
00323   register float hij,hji;
00324   int dij,dji;
00325   float k;
00326   float rhois2, rhojs2;
00327 
00328   //calculate piecewise-22 Pairs
00329   int c = 0;
00330   for (int ngi = minIg; ngi < maxI;  ) {
00331     int iGroupSize = params->p[0][ngi].nonbondedGroupSize;
00332   for (int i = ngi; i < ngi+iGroupSize; i++) {
00333     ri = params->p[0][i].position;
00334     ri.x += offset_x;
00335     ri.y += offset_y;
00336     ri.z += offset_z;
00337     rhoi0 = gbisParams->intRad[0][2*i+0];
00338     rhois = gbisParams->intRad[0][2*i+1];
00339     rhois2 = rhois*rhois;
00340     psiI = ZERO;
00341     plint *pairs;
00342     gbisParams->gbisStepPairlists[c]->nextlist(&pairs,&numPairs);
00343     for (register int jj = 0; jj < numPairs; jj++) {
00344 #ifdef BENCHMARK
00345       nops++;
00346 #endif
00347       j = pairs[jj];
00348       rj = params->p[1][j].position;
00349 
00350       dr = (ri.x - rj.x);
00351       r2 = dr*dr;
00352       dr = (ri.y - rj.y);
00353       r2 += dr*dr;
00354       dr = (ri.z - rj.z);
00355       r2 += dr*dr;
00356       r2_i = 1.0/r2;
00357 
00358       rhoj0 = gbisParams->intRad[1][2*j+0];
00359       rhojs = gbisParams->intRad[1][2*j+1];
00360       rhojs2 = rhojs*rhojs;
00361 
00362       k = rhojs2*r2_i;//k=(rs/r)^2
00363       hij = rhojs*r2_i*k*(ta+k*(tb+k*(tc+k*(td+k*te))));
00364 
00365       k = rhois2*r2_i;//k=(rs/r)^2
00366       hji = rhois*r2_i*k*(ta+k*(tb+k*(tc+k*(td+k*te))));
00367 
00368 //#if 1
00369 #ifdef PRINT_COMP
00370       int id1 = params->pExt[0][i].id;
00371       int id2 = params->pExt[1][j].id;
00372       float h1 = hij;
00373       float h2 = hji;
00374       float r10 = rhoi0;
00375       float r1s = rhojs;
00376       float r20 = rhoj0;
00377       float r2s = rhois;
00378 /*printf("PSIPAIR %05i %05i%9.5f%6.3f%6.3f%2i% 13.5e\n",
00379 id1,id2,sqrt(r2),
00380 rhoi0, rhojs,
00381 2,hij);
00382 printf("PSIPAIR %05i %05i%9.5f%6.3f%6.3f%2i% 13.5e\n",
00383 id2,id1,sqrt(r2),
00384 rhoj0, rhois,
00385 2,hji);
00386 */
00387       if (id1 > id2) {
00388         int tmp = id1;
00389         id1 = id2;
00390         id2 = tmp;
00391         h1 = hji;
00392         h2 = hij;
00393         r20 = rhoi0;
00394         r2s = rhojs;
00395         r10 = rhoj0;
00396         r1s = rhois;
00397       }
00398 //      CkPrintf("PSIPAIR%5i%5i%10.5f%5i%14.8f%7.4f%7.4f\n",id1,id2,sqrt(r2),2,h1,r10,r1s);
00399 //      CkPrintf("PSIPAIR%5i%5i%10.5f%5i%14.8f%7.4f%7.4f\n",id2,id1,sqrt(r2),2,h2,r20,r2s);
00400       //CkPrintf("PPSI(%04i)[%04i,%04i] = 22\n",gbisParams->cid,id1,id2);
00401 #endif
00402 
00403       psiI += hij;
00404       gbisParams->psiSum[1][j] += hji;
00405     }//end inner j
00406     gbisParams->psiSum[0][i] += psiI;
00407   }//end outer i
00408   for (int s = 0; s < strideIg; s++) {
00409     ngi+=params->p[0][ngi].nonbondedGroupSize;
00410   }
00411   }
00412 #ifdef BENCHMARK
00413   double t2 = 1.0*clock()/CLOCKS_PER_SEC;
00414   //nops *= (9 + 2*DIV_FLOPS+SQRT_FLOPS) + (14 + 0*DIV_FLOPS + 0*LOG_FLOPS);
00415   //double flops = 1.0 * nops / (t2 - t1);
00416   //double gflops = flops / 1000000000.0;
00417   CkPrintf("PHASE1.1: %8.3f ms @ %8.3f ns/iter for %i iter\n",1000.0*(t2-t1), 1000000000.0*(t2-t1)/nops, nops);
00418 nops = 0;
00419   t1 = 1.0*clock()/CLOCKS_PER_SEC;
00420   nops = 0;
00421 #endif
00422 
00423   float rmris, rmrjs;
00424   float rmrsi;
00425   float rmrs2;
00426   float rs2;
00427   float logri, logrj;
00428   float rci2;
00429   float a_cut_i = 1.0 / a_cut;
00430   float a_cut_i2 = a_cut_i*a_cut_i;
00431 
00432   //calculate piecewise-11 pairs
00433   c = 1;
00434   for (int ngi = minIg; ngi < maxI;  ) {
00435     int iGroupSize = params->p[0][ngi].nonbondedGroupSize;
00436   for (int i = ngi; i < ngi+iGroupSize; i++) {
00437     ri = params->p[0][i].position;
00438     ri.x += offset_x;
00439     ri.y += offset_y;
00440     ri.z += offset_z;
00441     rhoi0 = gbisParams->intRad[0][2*i+0];
00442     rhois = gbisParams->intRad[0][2*i+1];
00443     psiI = ZERO;
00444     plint *pairs;
00445     gbisParams->gbisStepPairlists[c]->nextlist(&pairs,&numPairs);
00446     for (register int jj = 0; jj < numPairs; jj++) {
00447       j = pairs[jj];
00448       rj = params->p[1][j].position;
00449 
00450       dr = (ri.x - rj.x);
00451       r2 = dr*dr;
00452       dr = (ri.y - rj.y);
00453       r2 += dr*dr;
00454       dr = (ri.z - rj.z);
00455       r2 += dr*dr;
00456       r_i = 1.0/sqrt(r2);
00457       r = r2*r_i;
00458 
00459       rhoj0 = gbisParams->intRad[1][2*j+0];
00460       rhojs = gbisParams->intRad[1][2*j+1];
00461 
00462       float tmp1 = 0.125*r_i;
00463       float tmp2 = r2 - 4.0*a_cut*r;
00464       float rr = 2.0*r;
00465 
00466 
00467       rmrjs = r-rhojs;
00468       rmris = r-rhois;
00469       logri = log(rmris*a_cut_i);
00470       logrj = log(rmrjs*a_cut_i);
00471 
00472       rmrsi = 1.0/rmrjs;
00473       //rmrs2 = rmrjs*rmrjs;
00474       rs2 = rhojs*rhojs;
00475       hij = /*0.125*r_i*/tmp1*(1 + rr*rmrsi +
00476         a_cut_i2*(/*r2 - 4.0*a_cut*r*/tmp2 - rs2) + logrj+logrj);
00477 
00478 
00479       rmrsi = 1.0/rmris;
00480       //rmrs2 = rmris*rmris;
00481       rs2 = rhois*rhois;
00482       hji = /*0.125*r_i*/tmp1*(1 + rr*rmrsi +
00483         a_cut_i2*(/*r2 - 4.0*a_cut*r*/tmp2 - rs2) + 2.0* logri);
00484 //#if 1
00485 #ifdef PRINT_COMP
00486       int id1 = params->pExt[0][i].id;
00487       int id2 = params->pExt[1][j].id;
00488       float h1 = hij;
00489       float h2 = hji;
00490       float r10 = rhoi0;
00491       float r1s = rhojs;
00492       float r20 = rhoj0;
00493       float r2s = rhois;
00494 /*printf("PSIPAIR %05i %05i%9.5f%6.3f%6.3f%2i% 13.5e\n",
00495 id1,id2,sqrt(r2),
00496 rhoi0, rhojs,
00497 1,hij);
00498 printf("PSIPAIR %05i %05i%9.5f%6.3f%6.3f%2i% 13.5e\n",
00499 id2,id1,sqrt(r2),
00500 rhoj0, rhois,
00501 1,hji);*/
00502       if (id1 > id2) {
00503         int tmp = id1;
00504         id1 = id2;
00505         id2 = tmp;
00506         h1 = hji;
00507         h2 = hij;
00508         r20 = rhoi0;
00509         r2s = rhojs;
00510         r10 = rhoj0;
00511         r1s = rhois;
00512       }
00513 //      CkPrintf("PSIPAIR%5i%5i%10.5f%5i%14.8f%7.4f%7.4f\n",id1,id2,sqrt(r2),1,h1,r10,r1s);
00514 //      CkPrintf("PSIPAIR%5i%5i%10.5f%5i%14.8f%7.4f%7.4f\n",id2,id1,sqrt(r2),1,h2,r20,r2s);
00515       //CkPrintf("PSI(%04i)[%04i,%04i] = 11 % .4e % .4e\n",gbisParams->sequence,id1,id2,h1, h2);
00516       //CkPrintf("PPSI(%04i)[%04i,%04i] = 11\n",gbisParams->cid,id1,id2);
00517 #endif
00518 
00519 #ifdef BENCHMARK
00520       nops++;
00521 #endif
00522           
00523       psiI += hij;
00524       gbisParams->psiSum[1][j] += hji;
00525     }//end inner j
00526     gbisParams->psiSum[0][i] += psiI;
00527   }//end outer i
00528   for (int s = 0; s < strideIg; s++) {
00529     ngi+=params->p[0][ngi].nonbondedGroupSize;
00530   }
00531   }
00532 #ifdef BENCHMARK
00533   t2 = 1.0*clock()/CLOCKS_PER_SEC;
00534   CkPrintf("PHASE1.2: %8.3f ms @ %8.3f ns/iter for %i iter\n",1000.0*(t2-t1), 1000000000.0*(t2-t1)/nops, nops);
00535 nops = 0;
00536   t1 = 1.0*clock()/CLOCKS_PER_SEC;
00537   nops = 0;
00538 #endif
00539 
00540   //calculate all other piecewise pairs
00541   c = 2;
00542   for (int ngi = minIg; ngi < maxI;  ) {
00543     int iGroupSize = params->p[0][ngi].nonbondedGroupSize;
00544   for (int i = ngi; i < ngi+iGroupSize; i++) {
00545     ri = params->p[0][i].position;
00546     ri.x += offset_x;
00547     ri.y += offset_y;
00548     ri.z += offset_z;
00549     rhoi0 = gbisParams->intRad[0][2*i+0];
00550     rhois = gbisParams->intRad[0][2*i+1];
00551     psiI = ZERO;
00552     plint *pairs;
00553     gbisParams->gbisStepPairlists[c]->nextlist(&pairs,&numPairs);
00554     for (register int jj = 0; jj < numPairs; jj++) {
00555       j = pairs[jj];
00556       rj = params->p[1][j].position;
00557 
00558       dr = (ri.x - rj.x);
00559       r2 = dr*dr;
00560       dr = (ri.y - rj.y);
00561       r2 += dr*dr;
00562       dr = (ri.z - rj.z);
00563       r2 += dr*dr;
00564       rhojs = gbisParams->intRad[1][2*j+1];
00565       rhoj0 = gbisParams->intRad[1][2*j+0];
00566       r_i = 1.0/sqrt(r2);
00567       r = r2 * r_i;
00568 
00569       CalcHPair(r,r2,r_i,a_cut,
00570           rhoi0, rhojs,
00571           rhoj0, rhois,
00572           dij,dji,hij,hji);
00573 //#if 1
00574 #ifdef PRINT_COMP
00575       int id1 = params->pExt[0][i].id;
00576       int id2 = params->pExt[1][j].id;
00577       float h1 = hij;
00578       float h2 = hji;
00579       int d1 = dij;
00580       int d2 = dji;
00581       float r10 = rhoi0;
00582       float r1s = rhojs;
00583       float r20 = rhoj0;
00584       float r2s = rhois;
00585 /*  if (dij > 0 ) {
00586 printf("PSIPAIR %05i %05i%9.5f%6.3f%6.3f%2i% 13.5e\n",
00587 id1,id2,sqrt(r2),
00588 rhoi0, rhojs,
00589 dij,hij);
00590   }
00591   if (dji > 0 ) {
00592 printf("PSIPAIR %05i %05i%9.5f%6.3f%6.3f%2i% 13.5e\n",
00593 id2,id1,sqrt(r2),
00594 rhoj0, rhois,
00595 dji,hji);
00596   }*/
00597 //      CkPrintf("PSIPAIR%5i%5i%10.5f%5i%14.8f%7.4f%7.4f\n",id1,id2,sqrt(r2),d1,h1,r10,r1s);
00598       if (id1 > id2) {
00599         int tmp = id1;
00600         id1 = id2;
00601         id2 = tmp;
00602         h1 = hji;
00603         h2 = hij;
00604         d1 = dji;
00605         d2 = dij;
00606         r20 = rhoi0;
00607         r2s = rhojs;
00608         r10 = rhoj0;
00609         r1s = rhois;
00610       }
00611 //      CkPrintf("PSIPAIR%5i%5i%10.5f%5i%14.8f%7.4f%7.4f\n",id2,id1,sqrt(r2),d2,h2,r20,r2s);
00612       //CkPrintf("PSI(%04i)[%04i,%04i] = %i%i % .4e % .4e\n",gbisParams->sequence,id1,id2,d1,d2,h1, h2);
00613       //CkPrintf("PPSI(%04i)[%04i,%04i] = %i%i\n",gbisParams->cid,id1,id2,d1,d2);
00614 #endif
00615 
00616 #ifdef BENCHMARK
00617       nops++;
00618 #endif
00619       psiI += hij;
00620       gbisParams->psiSum[1][j] += hji;
00621     }//end inner j
00622     gbisParams->psiSum[0][i] += psiI;
00623   }//end outer i
00624   for (int s = 0; s < strideIg; s++) {
00625     ngi+=params->p[0][ngi].nonbondedGroupSize;
00626   }
00627   }
00628 
00629 #ifdef BENCHMARK
00630   t2 = 1.0*clock()/CLOCKS_PER_SEC;
00631   CkPrintf("PHASE1.3: %8.3f ms @ %8.3f ns/iter for %i iter\n",1000.0*(t2-t1), 1000000000.0*(t2-t1)/nops,nops);
00632 #endif
00633 
00634 /***********************************************************
00635 * GBIS Phase 2
00636 ***********************************************************/
00637 } else if (gbisParams->gbisPhase == 2) {
00638 
00639   float epsilon_s = gbisParams->epsilon_s;
00640   float epsilon_p = gbisParams->epsilon_p;
00641   float epsilon_s_i = 1/epsilon_s;
00642   float epsilon_p_i = 1/epsilon_p;
00643   float kappa = gbisParams->kappa;
00644 
00645   //values used in loop
00646   float r_cut_2 = 1.0 / r_cut2;
00647   float r_cut_4 = 4.0*r_cut_2*r_cut_2;
00648   float coulEij=0,ddrCoulEij=0,gbEij=0,ddrGbEij=0;
00649   float dEdai=0,dEdaj=0, qiqj=0;
00650   float scale=0, ddrScale=0;
00651   float rnx=0,rny=0,rnz=0;
00652   float fx=0,fy=0,fz=0,forceCoul=0, forcedEdr=0;
00653 
00654   int nops = 0;
00655   double t1 = 1.0*clock()/CLOCKS_PER_SEC;
00656   float r2;
00657   float dr;
00658   BigReal dx, dy, dz;
00659   float r, r_i, ratio;
00660   float fIx, fIy, fIz;
00661   GBReal dEdaSumI;
00662   float bornRadI, bornRadJ;
00663   float qi;
00664   Position ri, rj;
00665   float aiaj,expr2aiaj4,fij,f_i,expkappa,Dij;
00666   float aiaj4,ddrDij,ddrf_i,ddrfij,tmp_dEda;
00667 
00668   for (int c = 0; c < 4/*dEdrPLs*/; c++) {
00669   for (int ngi = minIg; ngi < maxI;  ) {
00670     int iGroupSize = params->p[0][ngi].nonbondedGroupSize;
00671   for (int i = ngi; i < ngi+iGroupSize; i++) {
00672     ri = params->p[0][i].position;
00673     ri.x += offset_x;
00674     ri.y += offset_y;
00675     ri.z += offset_z;
00676     qi = - COULOMB * params->p[0][i].charge * scaling;
00677   //printf("ATOM(%05i) %.3e %.3e %.3e\n", params->pExt[0][i].id, params->p[0][i].charge, COULOMB, scaling);
00678     int numPairs;
00679     plint *pairs;
00680     gbisParams->gbisStepPairlists[c]->nextlist(&pairs,&numPairs);
00681     fIx = fIy = fIz = 0.0;
00682     dEdaSumI = 0.0;
00683     bornRadI = gbisParams->bornRad[0][i];
00684     for (int jj = 0; jj < numPairs; jj++) {
00685       int j = pairs[jj];
00686       rj = params->p[1][j].position;
00687 
00688       //distance
00689       dx = (ri.x - rj.x);
00690       dy = (ri.y - rj.y);
00691       dz = (ri.z - rj.z);
00692       r2 = dx*dx + dy*dy + dz*dz;
00693       if (r2 > r_cut2) continue;
00694       qiqj = qi*params->p[1][j].charge;
00695       bornRadJ = gbisParams->bornRad[1][j];
00696       r_i = 1.0/sqrt(r2);
00697       r = r2 * r_i;
00698 
00699       //pairwise calculation
00700 /*      Phase2_Pair(r, r2, r_i, qiqj,
00701           bornRadI,
00702           bornRadJ,
00703           epsilon_p_i, epsilon_s_i,
00704           kappa, gbisParams->doFullElectrostatics,
00705           gbEij, ddrGbEij, dEdai, dEdaj);
00706 */
00707 
00708   //calculate GB energy
00709   aiaj = bornRadI*bornRadJ;
00710   aiaj4 = 4*aiaj;
00711   expr2aiaj4 = exp(-r2/aiaj4);
00712   fij = sqrt(r2+aiaj*expr2aiaj4);
00713   f_i = 1/fij;
00714   expkappa = (kappa > 0) ? exp(-kappa*fij) : 1.0;
00715   Dij = epsilon_p_i - expkappa*epsilon_s_i;
00716   gbEij = qiqj*Dij*f_i;
00717 
00718   //calculate energy derivatives
00719   ddrfij = r*f_i*(1 - 0.25*expr2aiaj4);
00720   ddrf_i = -ddrfij*f_i*f_i;
00721   ddrDij = kappa*expkappa*ddrfij*epsilon_s_i;
00722   ddrGbEij = qiqj*(ddrDij*f_i+Dij*ddrf_i);
00723 
00724   //calc dEda
00725       //NAMD smoothing function
00726       scale = 1;
00727       ddrScale = 0;
00728       if (gbisParams->doSmoothing) {
00729         scale = r2 * r_cut_2 - 1;
00730         scale *= scale;
00731         ddrScale = r*(r2-r_cut2)*r_cut_4;
00732         //CkPrintf("SCALE %f %f\n",scale,ddrScale);
00733         gbisParams->gbInterEnergy += gbEij * scale;
00734         forcedEdr = -(ddrGbEij)*scale-(gbEij)*ddrScale;
00735       } else {
00736         gbisParams->gbInterEnergy += gbEij;
00737         forcedEdr = -ddrGbEij;
00738       }
00739 
00740       //add dEda
00741       if (gbisParams->doFullElectrostatics) {
00742         //gbisParams->dEdaSum[0][i] += dEdai*scale;
00743         tmp_dEda = 0.5*qiqj*f_i*f_i
00744                       *(kappa*epsilon_s_i*expkappa-Dij*f_i)
00745                       *(aiaj+0.25*r2)*expr2aiaj4;//0
00746         dEdai = tmp_dEda/bornRadI;
00747         dEdaj = tmp_dEda/bornRadJ;
00748         dEdaSumI += dEdai*scale;
00749         gbisParams->dEdaSum[1][j] += dEdaj*scale;
00750       }
00751 
00752 #if 1
00753 //#ifdef PRINT_COMP
00754       int id1 = params->pExt[0][i].id;
00755       int id2 = params->pExt[1][j].id;
00756       float deda1 = dEdai;
00757       float deda2 = dEdaj;
00758       float bR1 = bornRadI;
00759       float bR2 = bornRadJ;
00760       if (id1 > id2) {
00761         int tmp = id1;
00762         id1 = id2;
00763         id2 = tmp;
00764         deda1 = dEdaj;
00765         deda2 = dEdai;
00766         bR1 = bornRadJ;
00767         bR2 = bornRadI;
00768       }
00769       //CkPrintf("DEDR(%04i)[%04i,%04i] = % .4e\n",gbisParams->sequence,id1,id2,forcedEdr);
00770       //CkPrintf("DASM(%04i)[%04i,%04i] = % .4e % .4e\n",gbisParams->sequence,id1, id2, deda1,deda2);
00771       //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);
00772 /*CkPrintf("P2PAIR %05i %05i%9.5f%6.3f%6.3f% 13.5e% 13.5e% 13.5e% 13.5e% 13.5e\n",
00773 params->pExt[0][i].id, params->pExt[1][j].id,sqrt(r2),
00774 bornRadI, bornRadJ, forcedEdr, dEdai, qiqj, Dij, scale
00775 );
00776 CkPrintf("P2PAIR %05i %05i%9.5f%6.3f%6.3f% 13.5e% 13.5e% 13.5e% 13.5e% 13.5e\n",
00777 params->pExt[1][j].id, params->pExt[0][i].id,sqrt(r2),
00778 bornRadJ, bornRadI, forcedEdr, dEdaj, qiqj, Dij, scale
00779 );*/
00780 #endif
00781 
00782       forcedEdr *= r_i;
00783       fx = dx*forcedEdr;
00784       fy = dy*forcedEdr;
00785       fz = dz*forcedEdr;
00786 
00787       params->ff[1][j].x -= fx;
00788       params->ff[1][j].y -= fy;
00789       params->ff[1][j].z -= fz;
00790 
00791       fIx += fx;
00792       fIy += fy;
00793       fIz += fz;
00794 
00795 #ifdef BENCHMARK
00796       nops ++;//= (59 + 4*DIV_FLOPS + 2*EXP_FLOPS+SQRT_FLOPS);//56 w/o nops
00797 #endif
00798 
00799     }//end inner j
00800     gbisParams->dEdaSum[0][i] += dEdaSumI;
00801     params->ff[0][i].x += fIx;
00802     params->ff[0][i].y += fIy;
00803     params->ff[0][i].z += fIz;
00804 
00805     //self energy of each atom
00806     if (c == 0 && gbisParams->doEnergy && gbisParams->numPatches == 1) {
00807       float fij = bornRadI;//inf
00808       float expkappa = exp(-kappa*fij);//0
00809       float Dij = epsilon_p_i - expkappa*epsilon_s_i;
00810       float gbEij = qi*params->p[0][i].charge*Dij/fij;
00811       gbisParams->gbSelfEnergy += 0.5*gbEij;//self energy
00812     }
00813   }// end outer i
00814   for (int s = 0; s < strideIg; s++) {
00815     ngi+=params->p[0][ngi].nonbondedGroupSize;
00816   }//end i
00817   }//end ig
00818   }//end c
00819 #ifdef BENCHMARK
00820   double t2 = 1.0*clock()/CLOCKS_PER_SEC;
00821   //double flops = 1.0 * nops / (t2 - t1);
00822   //double gflops = flops / 1000000000.0;
00823   
00824   CkPrintf("PHASE2.0: %8.3f ms @ %8.3f ns/iter for %i iter\n",1000.0*(t2-t1), 1000000000.0*(t2-t1)/nops,nops);
00825 #endif
00826 
00827 /***********************************************************
00828 * GBIS Phase 3
00829 ***********************************************************/
00830 } else if (gbisParams->gbisPhase == 3 && gbisParams->doFullElectrostatics) {
00831 
00832 #ifdef BENCHMARK
00833   //int domains[] = {0, 0, 0, 0, 0, 0, 0, 0};
00834   double t1 = 1.0*clock()/CLOCKS_PER_SEC;
00835   double t2;
00836   int nops = 0;
00837 #endif
00838   //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]);
00839 
00840   register BigReal dx, dy, dz;
00841   register float  r2;
00842   register float r, r_i;
00843   register float rhoi0, rhois;
00844   float rhojs, rhoj0;
00845   float fx, fy, fz;
00846   float forceAlpha;
00847   register float fIx, fIy, fIz;
00848 
00849   float dhij;
00850   float dhji;
00851   int dij;
00852   int dji;
00853   register float dHdrPrefixI;
00854   float dHdrPrefixJ;
00855   register Position ri;
00856   register Position rj;
00857   register int c, numPairs, jj, j;
00858   register float k;
00859   register float da = DA;
00860   register float db = DB;
00861   register float dc = DC;
00862   register float dd = DD;
00863   register float de = DE;
00864   float r_i3;
00865 
00866   //piecewise 22
00867   c = 0;
00868   for (int ngi = minIg; ngi < maxI;  ) {
00869     int iGroupSize = params->p[0][ngi].nonbondedGroupSize;
00870   for (int i = ngi; i < ngi+iGroupSize; i++) {
00871     ri = params->p[0][i].position;
00872     ri.x += offset_x;
00873     ri.y += offset_y;
00874     ri.z += offset_z;
00875     rhois = gbisParams->intRad[0][2*i+1];
00876     plint *pairs;
00877     gbisParams->gbisStepPairlists[c]->nextlist(&pairs,&numPairs);
00878     fIx = fIy = fIz = 0.0;
00879     dHdrPrefixI = gbisParams->dHdrPrefix[0][i];
00880     for (jj = 0; jj < numPairs; jj++) {
00881       j = pairs[jj];
00882       rj = params->p[1][j].position;
00883 
00884       dx = (ri.x - rj.x);
00885       dy = (ri.y - rj.y);
00886       dz = (ri.z - rj.z);
00887       r2 = dx*dx + dy*dy + dz*dz;
00888       dHdrPrefixJ = gbisParams->dHdrPrefix[1][j];
00889 
00890       r_i = 1.0/sqrt(r2);//rptI takes 50% of loop time
00891       r_i3 = r_i*r_i*r_i;
00892 
00893       rhojs = gbisParams->intRad[1][2*j+1];
00894 
00895       k = rhojs*r_i; k*=k;//k=(rs/r)^2
00896       dhij = -rhojs*r_i3*k*
00897               (da+k*(db+k*(dc+k*(dd+k*de))));
00898 
00899       k = rhois*r_i; k*=k;//k=(rs/r)^2
00900       dhji = -rhois*r_i3*k*
00901               (da+k*(db+k*(dc+k*(dd+k*de))));
00902 
00903       //add dEda*dadr force
00904       forceAlpha = -r_i*(dHdrPrefixI*dhij+dHdrPrefixJ*dhji);
00905       fx = dx * forceAlpha;
00906       fy = dy * forceAlpha;
00907       fz = dz * forceAlpha;
00908 
00909       params->fullf[1][j].x -= fx;
00910       params->fullf[1][j].y -= fy;
00911       params->fullf[1][j].z -= fz;
00912 
00913       fIx += fx;
00914       fIy += fy;
00915       fIz += fz;
00916 
00917 #if 1
00918 //#ifdef PRINT_COMP
00919       int id1 = params->pExt[0][i].id;
00920       int id2 = params->pExt[1][j].id;
00921       float h1 = dhij;
00922       float h2 = dhji;
00923       if (id1 > id2) {
00924         int tmp = id1;
00925         id1 = id2;
00926         id2 = tmp;
00927         h1 = dhji;
00928         h2 = dhij;
00929       }
00930 /*CkPrintf("P3PAIR %05i %05i%9.5f% 13.5e% 13.5e% 13.5e% 13.5e% 13.5e %i\n",
00931 params->pExt[0][i].id, params->pExt[1][j].id,sqrt(r2),
00932 dHdrPrefixI, dHdrPrefixJ, dhij, dhji, forceAlpha, 2
00933 );
00934 CkPrintf("P3PAIR %05i %05i%9.5f% 13.5e% 13.5e% 13.5e% 13.5e% 13.5e %i\n",
00935 params->pExt[1][j].id, params->pExt[0][i].id,sqrt(r2),
00936 dHdrPrefixJ, dHdrPrefixI, dhji, dhij, forceAlpha, 2
00937 );*/
00938       //CkPrintf("DEDA(%04i)[%04i,%04i] = 22 % .4e % .4e % .4e\n",gbisParams->sequence,id1,id2,h1,h2, forceAlpha);
00939 #endif
00940 
00941 #ifdef BENCHMARK
00942       nops++;//= (24 + 2*DIV_FLOPS+SQRT_FLOPS);// 8 w/o nops
00943 #endif
00944 
00945     }//end inner j
00946     params->fullf[0][i].x += fIx;
00947     params->fullf[0][i].y += fIy;
00948     params->fullf[0][i].z += fIz;
00949   }//end outer i
00950   for (int s = 0; s < strideIg; s++) {
00951     ngi+=params->p[0][ngi].nonbondedGroupSize;
00952   }
00953   }
00954 
00955 #ifdef BENCHMARK
00956   t2 = 1.0*clock()/CLOCKS_PER_SEC;
00957   CkPrintf("PHASE3.1: %8.3f ms @ %8.3f ns/iter for %i iter\n",1000.0*(t2-t1), 1000000000.0*(t2-t1)/nops,nops);
00958 nops = 0;
00959   t1 = 1.0*clock()/CLOCKS_PER_SEC;
00960   nops = 0;
00961 #endif
00962 
00963   float a_cut_i = 1.0/a_cut;
00964   float a_cut_i2 = a_cut_i*a_cut_i;
00965   float a_cut2 = a_cut*a_cut;
00966   float rmrs;
00967   float rmrsi;
00968   float rmrs2;
00969   float rhois2, rhojs2;
00970   float logri, logrj;
00971   float r_i2;
00972 
00973   //piecewise 11
00974   c = 1;
00975   for (int ngi = minIg; ngi < maxI;  ) {
00976     int iGroupSize = params->p[0][ngi].nonbondedGroupSize;
00977   for (int i = ngi; i < ngi+iGroupSize; i++) {
00978     ri = params->p[0][i].position;
00979     ri.x += offset_x;
00980     ri.y += offset_y;
00981     ri.z += offset_z;
00982     rhois = gbisParams->intRad[0][2*i+1];
00983     rhois2 = rhois*rhois;
00984     plint *pairs;
00985     gbisParams->gbisStepPairlists[c]->nextlist(&pairs,&numPairs);
00986     fIx = fIy = fIz = 0.0;
00987     dHdrPrefixI = gbisParams->dHdrPrefix[0][i];
00988     for (jj = 0; jj < numPairs; jj++) {
00989       j = pairs[jj];
00990       rj = params->p[1][j].position;
00991       dHdrPrefixJ = gbisParams->dHdrPrefix[1][j];
00992 
00993       dx = (ri.x - rj.x);
00994       dy = (ri.y - rj.y);
00995       dz = (ri.z - rj.z);
00996       r2 = dx*dx + dy*dy + dz*dz;
00997       r_i = 1.0/sqrt(r2);//rptI
00998       r = r2* r_i;
00999       r_i2 = r_i*r_i;
01000 
01001       rhojs = gbisParams->intRad[1][2*j+1];
01002       rhojs2 = rhojs*rhojs;
01003 
01004 
01005       rmrs = r-rhojs;// 4 times
01006       rmrsi = 1.0/rmrs;
01007       rmrs2 = rmrs*rmrs;
01008       logrj = log(rmrs*a_cut_i);
01009       dhij = r_i2*(-0.25*logrj - (a_cut2 - rmrs2)*(rhojs2 + r2)*0.125*a_cut_i2*rmrsi*rmrsi);
01010 
01011 
01012       rmrs = r-rhois;// 4 times
01013       rmrsi = 1.0/rmrs;
01014       rmrs2 = rmrs*rmrs;
01015       logri = log(rmrs*a_cut_i);
01016       dhji = r_i2*(-0.25*logri - (a_cut2 - rmrs2)*(rhois2 + r2)*0.125*a_cut_i2*rmrsi*rmrsi);
01017 
01018       //add dEda*dadr force
01019       forceAlpha = -r_i*(dHdrPrefixI*dhij+dHdrPrefixJ*dhji);
01020       fx = dx * forceAlpha;
01021       fy = dy * forceAlpha;
01022       fz = dz * forceAlpha;
01023 
01024       params->fullf[1][j].x -= fx;
01025       params->fullf[1][j].y -= fy;
01026       params->fullf[1][j].z -= fz;
01027 
01028       fIx += fx;
01029       fIy += fy;
01030       fIz += fz;
01031 
01032 #if 1
01033 //#ifdef PRINT_COMP
01034       int id1 = params->pExt[0][i].id;
01035       int id2 = params->pExt[1][j].id;
01036       float h1 = dhij;
01037       float h2 = dhji;
01038       if (id1 > id2) {
01039         int tmp = id1;
01040         id1 = id2;
01041         id2 = tmp;
01042         h1 = dhji;
01043         h2 = dhij;
01044       }
01045       //CkPrintf("DEDA(%04i)[%04i,%04i] = 11 % .4e % .4e % .4e\n",gbisParams->sequence,id1,id2,h1,h2, forceAlpha);
01046 /*CkPrintf("P3PAIR %05i %05i%9.5f% 13.5e% 13.5e% 13.5e% 13.5e% 13.5e %i\n",
01047 params->pExt[0][i].id, params->pExt[1][j].id,sqrt(r2),
01048 dHdrPrefixI, dHdrPrefixJ, dhij, dhji, forceAlpha, 1
01049 );
01050 CkPrintf("P3PAIR %05i %05i%9.5f% 13.5e% 13.5e% 13.5e% 13.5e% 13.5e %i\n",
01051 params->pExt[1][j].id, params->pExt[0][i].id,sqrt(r2),
01052 dHdrPrefixJ, dHdrPrefixI, dhji, dhij, forceAlpha, 1
01053 );*/
01054 #endif
01055 
01056 #ifdef BENCHMARK
01057       nops++;
01058 #endif
01059 
01060     }//end inner j
01061     params->fullf[0][i].x += fIx;
01062     params->fullf[0][i].y += fIy;
01063     params->fullf[0][i].z += fIz;
01064   }//end outer i
01065   for (int s = 0; s < strideIg; s++) {
01066     ngi+=params->p[0][ngi].nonbondedGroupSize;
01067   }
01068   }
01069 
01070 #ifdef BENCHMARK
01071   t2 = 1.0*clock()/CLOCKS_PER_SEC;
01072   CkPrintf("PHASE3.2: %8.3f ms @ %8.3f ns/iter for %i iter\n",1000.0*(t2-t1), 1000000000.0*(t2-t1)/nops,nops);
01073 nops = 0;
01074   t1 = 1.0*clock()/CLOCKS_PER_SEC;
01075   nops = 0;
01076 #endif
01077 
01078   //piecewise all others
01079   c = 2;
01080   for (int ngi = minIg; ngi < maxI;  ) {
01081     int iGroupSize = params->p[0][ngi].nonbondedGroupSize;
01082   for (int i = ngi; i < ngi+iGroupSize; i++) {
01083     ri = params->p[0][i].position;
01084     ri.x += offset_x;
01085     ri.y += offset_y;
01086     ri.z += offset_z;
01087     rhoi0 = gbisParams->intRad[0][2*i+0];
01088     rhois = gbisParams->intRad[0][2*i+1];
01089     plint *pairs;
01090     gbisParams->gbisStepPairlists[c]->nextlist(&pairs,&numPairs);
01091     fIx = fIy = fIz = 0.0;
01092     dHdrPrefixI = gbisParams->dHdrPrefix[0][i];
01093     for (jj = 0; jj < numPairs; jj++) {
01094       j = pairs[jj];
01095       rj = params->p[1][j].position;
01096       dHdrPrefixJ = gbisParams->dHdrPrefix[1][j];
01097 
01098       dx = (ri.x - rj.x);
01099       dy = (ri.y - rj.y);
01100       dz = (ri.z - rj.z);
01101       r2 = dx*dx + dy*dy + dz*dz;
01102 
01103       r_i = 1.0/sqrt(r2);//rptI
01104       r = r2* r_i;
01105 
01106       rhojs = gbisParams->intRad[1][2*j+1];
01107       rhoj0 = gbisParams->intRad[1][2*j+0];
01108 
01109       CalcDHPair(r,r2,r_i,a_cut,
01110           rhoi0,rhojs,
01111           rhoj0,rhois,
01112           dij,dji,dhij,dhji);
01113 
01114       //add dEda*dadr force
01115       forceAlpha = -r_i*(dHdrPrefixI*dhij+dHdrPrefixJ*dhji); // *scaling ?
01116       fx = dx * forceAlpha;
01117       fy = dy * forceAlpha;
01118       fz = dz * forceAlpha;
01119 
01120       fIx += fx;
01121       fIy += fy;
01122       fIz += fz;
01123 
01124       params->fullf[1][j].x -= fx;
01125       params->fullf[1][j].y -= fy;
01126       params->fullf[1][j].z -= fz;
01127 
01128 #if 1
01129 //#ifdef PRINT_COMP
01130       int id1 = params->pExt[0][i].id;
01131       int id2 = params->pExt[1][j].id;
01132       int d1 = dij;
01133       int d2 = dji;
01134       float h1 = dhij;
01135       float h2 = dhji;
01136       if (id1 > id2) {
01137         int tmp = id1;
01138         id1 = id2;
01139         id2 = tmp;
01140         d1 = dji;
01141         d2 = dij;
01142         h1 = dhji;
01143         h2 = dhij;
01144       }
01145 //      CkPrintf("DEDA(%04i)[%04i,%04i] = %i%i % .4e % .4e % .4e\n",gbisParams->sequence,id1,id2,d1,d2,h1,h2, forceAlpha);
01146 //      CkPrintf("DEDA(%04i)[%04i,%04i] = %i%i % .4e % .4e % .4e\n",gbisParams->sequence,id1,id2,d1,d2,h1,h2, forceAlpha);
01147 /*if ( dij > 0 ) {
01148 CkPrintf("P3PAIR %05i %05i%9.5f% 13.5e% 13.5e% 13.5e% 13.5e% 13.5e %i\n",
01149 params->pExt[0][i].id, params->pExt[1][j].id,sqrt(r2),
01150 dHdrPrefixI, dHdrPrefixJ, dhij, dhji, forceAlpha, dij
01151 );
01152 }
01153 if ( dji > 0 ) {
01154 CkPrintf("P3PAIR %05i %05i%9.5f% 13.5e% 13.5e% 13.5e% 13.5e% 13.5e %i\n",
01155 params->pExt[1][j].id, params->pExt[0][i].id,sqrt(r2),
01156 dHdrPrefixJ, dHdrPrefixI, dhji, dhij, forceAlpha, dji
01157 );
01158 }*/
01159 #endif
01160 
01161 #ifdef BENCHMARK
01162       nops++;
01163 #endif
01164 
01165     }//end inner j
01166     params->fullf[0][i].x += fIx;
01167     params->fullf[0][i].y += fIy;
01168     params->fullf[0][i].z += fIz;
01169   }//end outer i
01170   for (int s = 0; s < strideIg; s++) {
01171     ngi+=params->p[0][ngi].nonbondedGroupSize;
01172   }
01173   }
01174 
01175 
01176 #ifdef BENCHMARK
01177   t2 = 1.0*clock()/CLOCKS_PER_SEC;
01178   CkPrintf("PHASE3.3: %8.3f ms @ %8.3f ns/iter for %i iter\n",1000.0*(t2-t1), 1000000000.0*(t2-t1)/nops, nops);
01179 #endif
01180 
01181 }//end if gbisPhase
01182 
01183 }//end calcGBIS

void ComputeNonbondedUtil::select ( void   )  [static]

Definition at line 258 of file ComputeNonbondedUtil.C.

References A12_f, A6_f, accelMDOn, alchDecouple, alchDispLambda, alchElecLambda, alchFepOn, alchLambda2, alchRepLambda, alchThermIntOn, alchVdwShiftCoeff, 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, corr_table, cutoff, cutoff2, cutoff2_f, cutoff_3, cutoff_3_f, cutoff_6, cutoff_6_f, dielectric_1, drudeNbthole, endi(), ewaldcof, f, fast_table, Fep_ElecOn, Fep_WCA_dispOn, Fep_WCA_repuOn, Fep_Wham, fixedAtomsOn, full_table, goForcesOn, goGroPair, goMethod, iERROR(), iINFO(), iout, j, k_vdwa, k_vdwa_f, k_vdwb, k_vdwb_f, lambda_table, lesFactor, lesOn, lesScaling, LJcorrection, ljTable, mol, Node::molecule, NAMD_bug(), NAMD_die(), Node::Object(), pairInteractionOn, pairInteractionSelf, Node::parameters, pi_ewaldcof, pressureProfileAtomTypes, pressureProfileOn, pressureProfileSlabs, qmForcesOn, r2_delta, r2_delta_1, r2_delta_exp, r2_table, Parameters::rowsize, rowsize, scale14, SCALED14, scaling, scor_table, send_build_cuda_force_table(), SHARP, Node::simParameters, simParams, slow_table, SPLIT_C1, SPLIT_C2, SPLIT_MARTINI, SPLIT_NONE, SPLIT_SHIFT, SPOLY, switchOn, switchOn2, switchOn_1, switchOn_f, table_alloc, Parameters::table_ener, table_ener, table_length, table_noshort, table_short, 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, vdwForceSwitching, WCA_rcut1, WCA_rcut2, WCA_rcut3, x, and XPLOR.

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

00259 {
00260   if ( CkMyRank() ) return;
00261 
00262   // These defaults die cleanly if nothing appropriate is assigned.
00263   ComputeNonbondedUtil::calcPair = calc_error;
00264   ComputeNonbondedUtil::calcPairEnergy = calc_error;
00265   ComputeNonbondedUtil::calcSelf = calc_error;
00266   ComputeNonbondedUtil::calcSelfEnergy = calc_error;
00267   ComputeNonbondedUtil::calcFullPair = calc_error;
00268   ComputeNonbondedUtil::calcFullPairEnergy = calc_error;
00269   ComputeNonbondedUtil::calcFullSelf = calc_error;
00270   ComputeNonbondedUtil::calcFullSelfEnergy = calc_error;
00271   ComputeNonbondedUtil::calcMergePair = calc_error;
00272   ComputeNonbondedUtil::calcMergePairEnergy = calc_error;
00273   ComputeNonbondedUtil::calcMergeSelf = calc_error;
00274   ComputeNonbondedUtil::calcMergeSelfEnergy = calc_error;
00275   ComputeNonbondedUtil::calcSlowPair = calc_error;
00276   ComputeNonbondedUtil::calcSlowPairEnergy = calc_error;
00277   ComputeNonbondedUtil::calcSlowSelf = calc_error;
00278   ComputeNonbondedUtil::calcSlowSelfEnergy = calc_error;
00279 
00280   SimParameters * simParams = Node::Object()->simParameters;
00281   Parameters * params = Node::Object()->parameters;
00282 
00283   table_ener = params->table_ener;
00284   rowsize = params->rowsize;
00285   columnsize = params->columnsize;
00286 
00287   commOnly = simParams->commOnly;
00288   fixedAtomsOn = ( simParams->fixedAtomsOn && ! simParams->fixedAtomsForces );
00289 
00290   qmForcesOn = simParams->qmForcesOn ;
00291   
00292   cutoff = simParams->cutoff;
00293   cutoff2 = cutoff*cutoff;
00294   cutoff2_f = cutoff2;
00295 
00296 //fepb
00297   alchFepOn = simParams->alchFepOn;
00298   Fep_WCA_repuOn = simParams->alchFepWCARepuOn;
00299   Fep_WCA_dispOn = simParams->alchFepWCADispOn;
00300   Fep_ElecOn = simParams->alchFepElecOn;
00301   Fep_Wham = simParams->alchFepWhamOn;
00302   alchThermIntOn = simParams->alchThermIntOn;
00303   alchLambda2 = 0;
00304   lesOn = simParams->lesOn;
00305   lesScaling = lesFactor = 0;
00306   Bool tabulatedEnergies = simParams->tabulatedEnergies;
00307   alchVdwShiftCoeff = simParams->alchVdwShiftCoeff;
00308   vdwForceSwitching = simParams->vdwForceSwitching;
00309   LJcorrection = simParams->LJcorrection;
00310   WCA_rcut1 = simParams->alchFepWCArcut1;
00311   WCA_rcut2 = simParams->alchFepWCArcut2;
00312   WCA_rcut3 = simParams->alchFepWCArcut3;
00313 
00314   alchRepLambda = simParams->alchRepLambda;
00315   alchDispLambda = simParams->alchDispLambda;
00316   alchElecLambda = simParams->alchElecLambda;
00317 
00318   alchDecouple = simParams->alchDecouple;
00319 
00320   delete [] lambda_table;
00321   lambda_table = 0;
00322 
00323   pairInteractionOn = simParams->pairInteractionOn;
00324   pairInteractionSelf = simParams->pairInteractionSelf;
00325   pressureProfileOn = simParams->pressureProfileOn;
00326 
00327   // Ported by JLai -- Original JE - Go
00328   goGroPair = simParams->goGroPair;
00329   goForcesOn = simParams->goForcesOn;
00330   goMethod = simParams->goMethod; 
00331   // End of port
00332 
00333   accelMDOn = simParams->accelMDOn;
00334 
00335   drudeNbthole = simParams->drudeOn && (simParams->drudeNbtholeCut > 0.0);
00336 
00337   if ( drudeNbthole ) {
00338 #ifdef NAMD_CUDA
00339     NAMD_die("drudeNbthole is not supported in CUDA version");
00340 #endif
00341     if ( lesOn )
00342       NAMD_die("drudeNbthole is not supported with locally enhanced sampling");
00343     if ( pairInteractionOn )
00344       NAMD_die("drudeNbthole is not supported with pair interaction calculation");
00345     if ( pressureProfileOn )
00346       NAMD_die("drudeNbthole is not supported with pressure profile calculation");
00347   }
00348 
00349   if ( alchFepOn ) {
00350 #ifdef NAMD_CUDA
00351     NAMD_die("Alchemical free-energy perturbation is not supported in CUDA version");
00352 #endif
00353     alchLambda2 = simParams->alchLambda2;
00354     ComputeNonbondedUtil::calcPair = calc_pair_energy_fep;
00355     ComputeNonbondedUtil::calcPairEnergy = calc_pair_energy_fep;
00356     ComputeNonbondedUtil::calcSelf = calc_self_energy_fep;
00357     ComputeNonbondedUtil::calcSelfEnergy = calc_self_energy_fep;
00358     ComputeNonbondedUtil::calcFullPair = calc_pair_energy_fullelect_fep;
00359     ComputeNonbondedUtil::calcFullPairEnergy = calc_pair_energy_fullelect_fep;
00360     ComputeNonbondedUtil::calcFullSelf = calc_self_energy_fullelect_fep;
00361     ComputeNonbondedUtil::calcFullSelfEnergy = calc_self_energy_fullelect_fep;
00362     ComputeNonbondedUtil::calcMergePair = calc_pair_energy_merge_fullelect_fep;
00363     ComputeNonbondedUtil::calcMergePairEnergy = calc_pair_energy_merge_fullelect_fep;
00364     ComputeNonbondedUtil::calcMergeSelf = calc_self_energy_merge_fullelect_fep;
00365     ComputeNonbondedUtil::calcMergeSelfEnergy = calc_self_energy_merge_fullelect_fep;
00366     ComputeNonbondedUtil::calcSlowPair = calc_pair_energy_slow_fullelect_fep;
00367     ComputeNonbondedUtil::calcSlowPairEnergy = calc_pair_energy_slow_fullelect_fep;
00368     ComputeNonbondedUtil::calcSlowSelf = calc_self_energy_slow_fullelect_fep;
00369     ComputeNonbondedUtil::calcSlowSelfEnergy = calc_self_energy_slow_fullelect_fep;
00370   }  else if ( alchThermIntOn ) {
00371 #ifdef NAMD_CUDA
00372     NAMD_die("Alchemical thermodynamic integration is not supported in CUDA version");
00373 #endif
00374     alchLambda2 = simParams->alchLambda2;
00375     ComputeNonbondedUtil::calcPair = calc_pair_ti;
00376     ComputeNonbondedUtil::calcPairEnergy = calc_pair_energy_ti;
00377     ComputeNonbondedUtil::calcSelf = calc_self_ti;
00378     ComputeNonbondedUtil::calcSelfEnergy = calc_self_energy_ti;
00379     ComputeNonbondedUtil::calcFullPair = calc_pair_fullelect_ti;
00380     ComputeNonbondedUtil::calcFullPairEnergy = calc_pair_energy_fullelect_ti;
00381     ComputeNonbondedUtil::calcFullSelf = calc_self_fullelect_ti;
00382     ComputeNonbondedUtil::calcFullSelfEnergy = calc_self_energy_fullelect_ti;
00383     ComputeNonbondedUtil::calcMergePair = calc_pair_merge_fullelect_ti;
00384     ComputeNonbondedUtil::calcMergePairEnergy = calc_pair_energy_merge_fullelect_ti;
00385     ComputeNonbondedUtil::calcMergeSelf = calc_self_merge_fullelect_ti;
00386     ComputeNonbondedUtil::calcMergeSelfEnergy = calc_self_energy_merge_fullelect_ti;
00387     ComputeNonbondedUtil::calcSlowPair = calc_pair_slow_fullelect_ti;
00388     ComputeNonbondedUtil::calcSlowPairEnergy = calc_pair_energy_slow_fullelect_ti;
00389     ComputeNonbondedUtil::calcSlowSelf = calc_self_slow_fullelect_ti;
00390     ComputeNonbondedUtil::calcSlowSelfEnergy = calc_self_energy_slow_fullelect_ti;
00391   } else if ( lesOn ) {
00392 #ifdef NAMD_CUDA
00393     NAMD_die("Locally enhanced sampling is not supported in CUDA version");
00394 #endif
00395     lesFactor = simParams->lesFactor;
00396     lesScaling = 1.0 / (double)lesFactor;
00397     lambda_table = new BigReal[(lesFactor+1)*(lesFactor+1)];
00398     for ( int ip=0; ip<=lesFactor; ++ip ) {
00399       for ( int jp=0; jp<=lesFactor; ++jp ) {
00400         BigReal lambda_pair = 1.0;
00401         if (ip || jp ) {
00402           if (ip && jp && ip != jp) {
00403             lambda_pair = 0.0;
00404           } else {
00405             lambda_pair = lesScaling;
00406           }
00407         }
00408         lambda_table[(lesFactor+1)*ip+jp] = lambda_pair;
00409       }
00410     }
00411     ComputeNonbondedUtil::calcPair = calc_pair_les;
00412     ComputeNonbondedUtil::calcPairEnergy = calc_pair_energy_les;
00413     ComputeNonbondedUtil::calcSelf = calc_self_les;
00414     ComputeNonbondedUtil::calcSelfEnergy = calc_self_energy_les;
00415     ComputeNonbondedUtil::calcFullPair = calc_pair_fullelect_les;
00416     ComputeNonbondedUtil::calcFullPairEnergy = calc_pair_energy_fullelect_les;
00417     ComputeNonbondedUtil::calcFullSelf = calc_self_fullelect_les;
00418     ComputeNonbondedUtil::calcFullSelfEnergy = calc_self_energy_fullelect_les;
00419     ComputeNonbondedUtil::calcMergePair = calc_pair_merge_fullelect_les;
00420     ComputeNonbondedUtil::calcMergePairEnergy = calc_pair_energy_merge_fullelect_les;
00421     ComputeNonbondedUtil::calcMergeSelf = calc_self_merge_fullelect_les;
00422     ComputeNonbondedUtil::calcMergeSelfEnergy = calc_self_energy_merge_fullelect_les;
00423     ComputeNonbondedUtil::calcSlowPair = calc_pair_slow_fullelect_les;
00424     ComputeNonbondedUtil::calcSlowPairEnergy = calc_pair_energy_slow_fullelect_les;
00425     ComputeNonbondedUtil::calcSlowSelf = calc_self_slow_fullelect_les;
00426     ComputeNonbondedUtil::calcSlowSelfEnergy = calc_self_energy_slow_fullelect_les;
00427   } else if ( pressureProfileOn) {
00428 #ifdef NAMD_CUDA
00429     NAMD_die("Pressure profile calculation is not supported in CUDA version");
00430 #endif
00431     pressureProfileSlabs = simParams->pressureProfileSlabs;
00432     pressureProfileAtomTypes = simParams->pressureProfileAtomTypes;
00433 
00434     ComputeNonbondedUtil::calcPair = calc_pair_pprof;
00435     ComputeNonbondedUtil::calcPairEnergy = calc_pair_energy_pprof;
00436     ComputeNonbondedUtil::calcSelf = calc_self_pprof;
00437     ComputeNonbondedUtil::calcSelfEnergy = calc_self_energy_pprof;
00438     ComputeNonbondedUtil::calcFullPair = calc_pair_fullelect_pprof;
00439     ComputeNonbondedUtil::calcFullPairEnergy = calc_pair_energy_fullelect_pprof;
00440     ComputeNonbondedUtil::calcFullSelf = calc_self_fullelect_pprof;
00441     ComputeNonbondedUtil::calcFullSelfEnergy = calc_self_energy_fullelect_pprof;
00442     ComputeNonbondedUtil::calcMergePair = calc_pair_merge_fullelect_pprof;
00443     ComputeNonbondedUtil::calcMergePairEnergy = calc_pair_energy_merge_fullelect_pprof;
00444     ComputeNonbondedUtil::calcMergeSelf = calc_self_merge_fullelect_pprof;
00445     ComputeNonbondedUtil::calcMergeSelfEnergy = calc_self_energy_merge_fullelect_pprof;
00446     ComputeNonbondedUtil::calcSlowPair = calc_pair_slow_fullelect_pprof;
00447     ComputeNonbondedUtil::calcSlowPairEnergy = calc_pair_energy_slow_fullelect_pprof;
00448     ComputeNonbondedUtil::calcSlowSelf = calc_self_slow_fullelect_pprof;
00449     ComputeNonbondedUtil::calcSlowSelfEnergy = calc_self_energy_slow_fullelect_pprof;
00450   } else if ( pairInteractionOn ) {
00451 #ifdef NAMD_CUDA
00452     NAMD_die("Pair interaction calculation is not supported in CUDA version");
00453 #endif
00454     ComputeNonbondedUtil::calcPairEnergy = calc_pair_energy_int;
00455     ComputeNonbondedUtil::calcSelfEnergy = calc_self_energy_int;
00456     ComputeNonbondedUtil::calcFullPairEnergy = calc_pair_energy_fullelect_int;
00457     ComputeNonbondedUtil::calcFullSelfEnergy = calc_self_energy_fullelect_int;
00458     ComputeNonbondedUtil::calcMergePairEnergy = calc_pair_energy_merge_fullelect_int;
00459     ComputeNonbondedUtil::calcMergeSelfEnergy = calc_self_energy_merge_fullelect_int;
00460   } else if ( tabulatedEnergies ) {
00461 #ifdef NAMD_CUDA
00462     NAMD_die("Tabulated energies is not supported in CUDA version");
00463 #endif
00464     ComputeNonbondedUtil::calcPair = calc_pair_tabener;
00465     ComputeNonbondedUtil::calcPairEnergy = calc_pair_energy_tabener;
00466     ComputeNonbondedUtil::calcSelf = calc_self_tabener;
00467     ComputeNonbondedUtil::calcSelfEnergy = calc_self_energy_tabener;
00468     ComputeNonbondedUtil::calcFullPair = calc_pair_fullelect_tabener;
00469     ComputeNonbondedUtil::calcFullPairEnergy = calc_pair_energy_fullelect_tabener;
00470     ComputeNonbondedUtil::calcFullSelf = calc_self_fullelect_tabener;
00471     ComputeNonbondedUtil::calcFullSelfEnergy = calc_self_energy_fullelect_tabener;
00472     ComputeNonbondedUtil::calcMergePair = calc_pair_merge_fullelect_tabener;
00473     ComputeNonbondedUtil::calcMergePairEnergy = calc_pair_energy_merge_fullelect_tabener;
00474     ComputeNonbondedUtil::calcMergeSelf = calc_self_merge_fullelect_tabener;
00475     ComputeNonbondedUtil::calcMergeSelfEnergy = calc_self_energy_merge_fullelect_tabener;
00476     ComputeNonbondedUtil::calcSlowPair = calc_pair_slow_fullelect_tabener;
00477     ComputeNonbondedUtil::calcSlowPairEnergy = calc_pair_energy_slow_fullelect_tabener;
00478     ComputeNonbondedUtil::calcSlowSelf = calc_self_slow_fullelect_tabener;
00479     ComputeNonbondedUtil::calcSlowSelfEnergy = calc_self_energy_slow_fullelect_tabener;
00480   } else if ( goForcesOn ) {
00481 #ifdef NAMD_CUDA
00482     NAMD_die("Go forces is not supported in CUDA version");
00483 #endif
00484     ComputeNonbondedUtil::calcPair = calc_pair_go;
00485     ComputeNonbondedUtil::calcPairEnergy = calc_pair_energy_go;
00486     ComputeNonbondedUtil::calcSelf = calc_self_go;
00487     ComputeNonbondedUtil::calcSelfEnergy = calc_self_energy_go;
00488     ComputeNonbondedUtil::calcFullPair = calc_pair_fullelect_go;
00489     ComputeNonbondedUtil::calcFullPairEnergy = calc_pair_energy_fullelect_go;
00490     ComputeNonbondedUtil::calcFullSelf = calc_self_fullelect_go;
00491     ComputeNonbondedUtil::calcFullSelfEnergy = calc_self_energy_fullelect_go;
00492     ComputeNonbondedUtil::calcMergePair = calc_pair_merge_fullelect_go;
00493     ComputeNonbondedUtil::calcMergePairEnergy = calc_pair_energy_merge_fullelect_go;
00494     ComputeNonbondedUtil::calcMergeSelf = calc_self_merge_fullelect_go;
00495     ComputeNonbondedUtil::calcMergeSelfEnergy = calc_self_energy_merge_fullelect_go;
00496     ComputeNonbondedUtil::calcSlowPair = calc_pair_slow_fullelect_go;
00497     ComputeNonbondedUtil::calcSlowPairEnergy = calc_pair_energy_slow_fullelect_go;
00498     ComputeNonbondedUtil::calcSlowSelf = calc_self_slow_fullelect_go;
00499     ComputeNonbondedUtil::calcSlowSelfEnergy = calc_self_energy_slow_fullelect_go;
00500   } else {
00501     ComputeNonbondedUtil::calcPair = calc_pair;
00502     ComputeNonbondedUtil::calcPairEnergy = calc_pair_energy;
00503     ComputeNonbondedUtil::calcSelf = calc_self;
00504     ComputeNonbondedUtil::calcSelfEnergy = calc_self_energy;
00505     ComputeNonbondedUtil::calcFullPair = calc_pair_fullelect;
00506     ComputeNonbondedUtil::calcFullPairEnergy = calc_pair_energy_fullelect;
00507     ComputeNonbondedUtil::calcFullSelf = calc_self_fullelect;
00508     ComputeNonbondedUtil::calcFullSelfEnergy = calc_self_energy_fullelect;
00509     ComputeNonbondedUtil::calcMergePair = calc_pair_merge_fullelect;
00510     ComputeNonbondedUtil::calcMergePairEnergy = calc_pair_energy_merge_fullelect;
00511     ComputeNonbondedUtil::calcMergeSelf = calc_self_merge_fullelect;
00512     ComputeNonbondedUtil::calcMergeSelfEnergy = calc_self_energy_merge_fullelect;
00513     ComputeNonbondedUtil::calcSlowPair = calc_pair_slow_fullelect;
00514     ComputeNonbondedUtil::calcSlowPairEnergy = calc_pair_energy_slow_fullelect;
00515     ComputeNonbondedUtil::calcSlowSelf = calc_self_slow_fullelect;
00516     ComputeNonbondedUtil::calcSlowSelfEnergy = calc_self_energy_slow_fullelect;
00517   }
00518 
00519 //fepe
00520 
00521   dielectric_1 = 1.0/simParams->dielectric;
00522   if ( ! ljTable ) ljTable = new LJTable;
00523   mol = Node::Object()->molecule;
00524   scaling = simParams->nonbondedScaling;
00525   if ( simParams->exclude == SCALED14 )
00526   {
00527     scale14 = simParams->scale14;
00528   }
00529   else
00530   {
00531     scale14 = 1.;
00532   }
00533   if ( simParams->switchingActive )
00534   {
00535     switchOn = simParams->switchingDist;
00536     switchOn_1 = 1.0/switchOn;
00537     // d0 = 1.0/(cutoff-switchOn);
00538     switchOn2 = switchOn*switchOn;
00539     c0 = 1.0/(cutoff2-switchOn2);
00540 
00541     if ( simParams->vdwForceSwitching ) {
00542       double switchOn3 = switchOn * switchOn2;
00543       double cutoff3 = cutoff * cutoff2;
00544       double switchOn6 = switchOn3 * switchOn3;
00545       double cutoff6 = cutoff3 * cutoff3;
00546       v_vdwa_f = v_vdwa = -1. / ( switchOn6 * cutoff6 );
00547       v_vdwb_f = v_vdwb = -1. / ( switchOn3 * cutoff3 );
00548       k_vdwa_f = k_vdwa = cutoff6 / ( cutoff6 - switchOn6 );
00549       k_vdwb_f = k_vdwb = cutoff3 / ( cutoff3 - switchOn3 );
00550       cutoff_3_f = cutoff_3 = 1. / cutoff3;
00551       cutoff_6_f = cutoff_6 = 1. / cutoff6;
00552 
00553     } else if ( simParams->martiniSwitching ) { // switching fxn for Martini RBCG
00554 
00555       BigReal p6 = 6;
00556       BigReal A6 = p6 * ((p6+1)*switchOn-(p6+4)*cutoff)/(pow(cutoff,p6+2)*pow(cutoff-switchOn,2));
00557       BigReal B6 = -p6 * ((p6+1)*switchOn-(p6+3)*cutoff)/(pow(cutoff,p6+2)*pow(cutoff-switchOn,3));        
00558       BigReal C6 = 1.0/pow(cutoff,p6)-A6/3.0*pow(cutoff-switchOn,3)-B6/4.0*pow(cutoff-switchOn,4);
00559 
00560       BigReal p12 = 12;
00561       BigReal A12 = p12 * ((p12+1)*switchOn-(p12+4)*cutoff)/(pow(cutoff,p12+2)*pow(cutoff-switchOn,2));
00562       BigReal B12 = -p12 * ((p12+1)*switchOn-(p12+3)*cutoff)/(pow(cutoff,p12+2)*pow(cutoff-switchOn,3));
00563       BigReal C12 = 1.0/pow(cutoff,p12)-A12/3.0*pow(cutoff-switchOn,3)-B12/4.0*pow(cutoff-switchOn,4);
00564 
00565       A6_f =  A6;  B6_f  = B6;  C6_f =  C6;
00566       A12_f = A12; B12_f = B12; C12_f = C12;
00567       switchOn_f = switchOn;
00568 
00569     }
00570 
00571   }
00572   else
00573   {
00574     switchOn = cutoff;
00575     switchOn_1 = 1.0/switchOn;
00576     // d0 = 0.;  // avoid division by zero
00577     switchOn2 = switchOn*switchOn;
00578     c0 = 0.;  // avoid division by zero
00579   }
00580   c1 = c0*c0*c0;
00581   c3 = 3.0 * (cutoff2 - switchOn2);
00582   c5 = 0;
00583   c6 = 0;
00584   c7 = 0;
00585   c8 = 0;
00586 
00587   const int PMEOn = simParams->PMEOn;
00588   const int MSMOn = simParams->MSMOn;
00589   const int MSMSplit = simParams->MSMSplit;
00590 
00591   if ( PMEOn ) {
00592     ewaldcof = simParams->PMEEwaldCoefficient;
00593     BigReal TwoBySqrtPi = 1.12837916709551;
00594     pi_ewaldcof = TwoBySqrtPi * ewaldcof;
00595   }
00596 
00597   int splitType = SPLIT_NONE;
00598   if ( simParams->switchingActive ) splitType = SPLIT_SHIFT;
00599   if ( simParams->martiniSwitching ) splitType = SPLIT_MARTINI;
00600   if ( simParams->fullDirectOn || simParams->FMAOn || PMEOn || MSMOn ||
00601       simParams->FMMOn ) {
00602     switch ( simParams->longSplitting ) {
00603       case C2:
00604       splitType = SPLIT_C2;
00605       break;
00606 
00607       case C1:
00608       splitType = SPLIT_C1;
00609       break;
00610 
00611       case XPLOR:
00612       NAMD_die("Sorry, XPLOR splitting not supported.");
00613       break;
00614 
00615       case SHARP:
00616       NAMD_die("Sorry, SHARP splitting not supported.");
00617       break;
00618 
00619       default:
00620       NAMD_die("Unknown splitting type found!");
00621 
00622     }
00623   }
00624 
00625   BigReal r2_tol = 0.1;
00626   
00627   r2_delta = 1.0;
00628   r2_delta_exp = 0;
00629   while ( r2_delta > r2_tol ) { r2_delta /= 2.0; r2_delta_exp += 1; }
00630   r2_delta_1 = 1.0 / r2_delta;
00631 
00632   if ( ! CkMyPe() ) {
00633     iout << iINFO << "NONBONDED TABLE R-SQUARED SPACING: " <<
00634                                 r2_delta << "\n" << endi;
00635   }
00636 
00637   BigReal r2_tmp = 1.0;
00638   int cutoff2_exp = 0;
00639   while ( (cutoff2 + r2_delta) > r2_tmp ) { r2_tmp *= 2.0; cutoff2_exp += 1; }
00640 
00641   int i;
00642   int n = (r2_delta_exp + cutoff2_exp) * 64 + 1;
00643   table_length = n;
00644   #if defined(NAMD_MIC)
00645     int n_16 = (n + 15) & (~15);
00646   #endif
00647 
00648   if ( ! CkMyPe() ) {
00649     iout << iINFO << "NONBONDED TABLE SIZE: " <<
00650                                 n << " POINTS\n" << endi;
00651   }
00652 
00653   if ( table_alloc ) delete [] table_alloc;
00654   #if defined(NAMD_MIC)
00655     table_alloc = new BigReal[61*n_16+16];
00656     BigReal *table_align = table_alloc;
00657     while ( ((long)table_align) % 128 ) ++table_align;
00658     mic_table_base_ptr = table_align;
00659     mic_table_n = n;
00660     mic_table_n_16 = n_16;
00661     table_noshort = table_align;
00662     table_short = table_align + 16*n_16;
00663     slow_table = table_align + 32*n_16;
00664     fast_table = table_align + 36*n_16;
00665     scor_table = table_align + 40*n_16;
00666     corr_table = table_align + 44*n_16;
00667     full_table = table_align + 48*n_16;
00668     vdwa_table = table_align + 52*n_16;
00669     vdwb_table = table_align + 56*n_16;
00670     r2_table = table_align + 60*n_16;
00671   #else
00672   table_alloc = new BigReal[61*n+16];
00673   BigReal *table_align = table_alloc;
00674   while ( ((long)table_align) % 128 ) ++table_align;
00675   table_noshort = table_align;
00676   table_short = table_align + 16*n;
00677   slow_table = table_align + 32*n;
00678   fast_table = table_align + 36*n;
00679   scor_table = table_align + 40*n;
00680   corr_table = table_align + 44*n;
00681   full_table = table_align + 48*n;
00682   vdwa_table = table_align + 52*n;
00683   vdwb_table = table_align + 56*n;
00684   r2_table = table_align + 60*n;
00685   #endif
00686   BigReal *fast_i = fast_table + 4;
00687   BigReal *scor_i = scor_table + 4;
00688   BigReal *slow_i = slow_table + 4;
00689   BigReal *vdwa_i = vdwa_table + 4;
00690   BigReal *vdwb_i = vdwb_table + 4;
00691   BigReal *r2_i = r2_table;  *(r2_i++) = r2_delta;
00692   BigReal r2_limit = simParams->limitDist * simParams->limitDist;
00693   if ( r2_limit < r2_delta ) r2_limit = r2_delta;
00694   int r2_delta_i = 0;  // entry for r2 == r2_delta
00695 
00696 #ifdef NAMD_KNL
00697  if ( knl_table_alloc ) delete [] knl_table_alloc;
00698  knl_table_alloc = new float[10*KNL_TABLE_SIZE];
00699  knl_fast_ener_table = knl_table_alloc;
00700  knl_fast_grad_table = knl_table_alloc + KNL_TABLE_SIZE;
00701  knl_scor_ener_table = knl_table_alloc + 2*KNL_TABLE_SIZE;
00702  knl_scor_grad_table = knl_table_alloc + 3*KNL_TABLE_SIZE;
00703  knl_slow_ener_table = knl_table_alloc + 4*KNL_TABLE_SIZE;
00704  knl_slow_grad_table = knl_table_alloc + 5*KNL_TABLE_SIZE;
00705  knl_corr_ener_table = knl_table_alloc + 6*KNL_TABLE_SIZE;
00706  knl_corr_grad_table = knl_table_alloc + 7*KNL_TABLE_SIZE;
00707  knl_full_ener_table = knl_table_alloc + 8*KNL_TABLE_SIZE;
00708  knl_full_grad_table = knl_table_alloc + 9*KNL_TABLE_SIZE;
00709  knl_fast_ener_table[0] = 0.;
00710  knl_fast_grad_table[0] = 0.;
00711  knl_scor_ener_table[0] = 0.;
00712  knl_scor_grad_table[0] = 0.;
00713  knl_slow_ener_table[0] = 0.;
00714  knl_slow_grad_table[0] = 0.;
00715  knl_corr_ener_table[0] = 0.;
00716  knl_corr_grad_table[0] = 0.;
00717  knl_full_ener_table[0] = 0.;
00718  knl_full_grad_table[0] = 0.;
00719  for ( int knl_table = 0; knl_table < 2; ++knl_table ) {
00720   int nn = n;
00721   if ( knl_table ) {
00722     nn = KNL_TABLE_SIZE-1;
00723   }
00724   for ( i=1; i<nn; ++i ) {
00725 #else
00726   // fill in the table, fix up i==0 (r2==0) below
00727   for ( i=1; i<n; ++i ) {
00728 #endif
00729 
00730     const BigReal r2_base = r2_delta * ( 1 << (i/64) );
00731     const BigReal r2_del = r2_base / 64.0;
00732     BigReal r2 = r2_base - r2_delta + r2_del * (i%64);
00733 
00734     BigReal r = sqrt(r2);
00735 
00736 #ifdef NAMD_KNL
00737     if ( knl_table ) {
00738       r = (double)(nn-1)/(double)(i);
00739       r2 = r*r;
00740     } else
00741 #endif
00742     if ( r2 <= r2_limit ) r2_delta_i = i;
00743 
00744     const BigReal r_1 = 1.0/r;
00745     const BigReal r_2 = 1.0/r2;
00746 
00747     // fast_ is defined as (full_ - slow_)
00748     // corr_ and fast_ are both zero at the cutoff, full_ is not
00749     // all three are approx 1/r at short distances
00750 
00751     // for actual interpolation, we use fast_ for fast forces and
00752     // scor_ = slow_ + corr_ - full_ and slow_ for slow forces
00753     // since these last two are of small magnitude
00754 
00755     BigReal fast_energy, fast_gradient;
00756     BigReal scor_energy, scor_gradient;
00757     BigReal slow_energy, slow_gradient;
00758 
00759     // corr_ is PME direct sum, or similar correction term
00760     // corr_energy is multiplied by r until later
00761     // corr_gradient is multiplied by -r^2 until later
00762     BigReal corr_energy, corr_gradient;
00763 
00764     
00765     if ( PMEOn ) {
00766       BigReal tmp_a = r * ewaldcof;
00767       BigReal tmp_b = erfc(tmp_a);
00768       corr_energy = tmp_b;
00769       corr_gradient = pi_ewaldcof*exp(-(tmp_a*tmp_a))*r + tmp_b;
00770     } else if ( MSMOn ) {
00771       BigReal a_1 = 1.0/cutoff;
00772       BigReal r_a = r * a_1;
00773       BigReal g, dg;
00774       SPOLY(&g, &dg, r_a, MSMSplit);
00775       corr_energy = 1 - r_a * g;
00776       corr_gradient = 1 + r_a*r_a * dg;
00777     } else {
00778       corr_energy = corr_gradient = 0;
00779     }
00780 
00781     switch(splitType) {
00782       case SPLIT_NONE:
00783         fast_energy = 1.0/r;
00784         fast_gradient = -1.0/r2;
00785         scor_energy = scor_gradient = 0;
00786         slow_energy = slow_gradient = 0;
00787         break;
00788       case SPLIT_SHIFT: {
00789         BigReal shiftVal = r2/cutoff2 - 1.0;
00790         shiftVal *= shiftVal;
00791         BigReal dShiftVal = 2.0 * (r2/cutoff2 - 1.0) * 2.0*r/cutoff2;
00792         fast_energy = shiftVal/r;
00793         fast_gradient = dShiftVal/r - shiftVal/r2;
00794         scor_energy = scor_gradient = 0;
00795         slow_energy = slow_gradient = 0;
00796         } 
00797         break;
00798       case SPLIT_MARTINI: { 
00799         // in Martini, the Coulomb switching distance is zero
00800         const BigReal COUL_SWITCH = 0.;
00801         // Gromacs shifting function
00802         const BigReal p1 = 1.;
00803         BigReal A1 = p1 * ((p1+1)*COUL_SWITCH-(p1+4)*cutoff)/(pow(cutoff,p1+2)*pow(cutoff-COUL_SWITCH,2));
00804         BigReal B1 = -p1 * ((p1+1)*COUL_SWITCH-(p1+3)*cutoff)/(pow(cutoff,p1+2)*pow(cutoff-COUL_SWITCH,3));
00805         BigReal X1 = 1.0/pow(cutoff,p1)-A1/3.0*pow(cutoff-COUL_SWITCH,3)-B1/4.0*pow(cutoff-COUL_SWITCH,4);
00806         BigReal r12 = (r-COUL_SWITCH)*(r-COUL_SWITCH);
00807         BigReal r13 = (r-COUL_SWITCH)*(r-COUL_SWITCH)*(r-COUL_SWITCH);
00808         BigReal shiftVal = -(A1/3.0)*r13 - (B1/4.0)*r12*r12 - X1;
00809         BigReal dShiftVal = -A1*r12 - B1*r13;
00810         fast_energy = (1/r) + shiftVal;
00811         fast_gradient = -1/(r2) + dShiftVal;
00812         scor_energy = scor_gradient = 0;
00813         slow_energy = slow_gradient = 0;
00814         } 
00815         break;
00816       case SPLIT_C1:
00817         // calculate actual energy and gradient
00818         slow_energy = 0.5/cutoff * (3.0 - (r2/cutoff2));
00819         slow_gradient = -1.0/cutoff2 * (r/cutoff);
00820         // calculate scor from slow and corr
00821         scor_energy = slow_energy + (corr_energy - 1.0)/r;
00822         scor_gradient = slow_gradient - (corr_gradient - 1.0)/r2;
00823         // calculate fast from slow
00824         fast_energy = 1.0/r - slow_energy;
00825         fast_gradient = -1.0/r2 - slow_gradient;
00826         break;
00827       case SPLIT_C2:
00828         //
00829         // Quintic splitting function contributed by
00830         // Bruce Berne, Ruhong Zhou, and Joe Morrone
00831         //
00832         // calculate actual energy and gradient
00833         slow_energy = r2/(cutoff*cutoff2) * (6.0 * (r2/cutoff2)
00834             - 15.0*(r/cutoff) + 10.0);
00835         slow_gradient = r/(cutoff*cutoff2) * (24.0 * (r2/cutoff2)
00836             - 45.0 *(r/cutoff) + 20.0);
00837         // calculate scor from slow and corr
00838         scor_energy = slow_energy + (corr_energy - 1.0)/r;
00839         scor_gradient = slow_gradient - (corr_gradient - 1.0)/r2;
00840         // calculate fast from slow
00841         fast_energy = 1.0/r - slow_energy;
00842         fast_gradient = -1.0/r2 - slow_gradient;
00843         break;
00844     }
00845 
00846     // foo_gradient is calculated as ( d foo_energy / d r )
00847     // and now divided by 2r to get ( d foo_energy / d r2 )
00848 
00849     fast_gradient *= 0.5 * r_1;
00850     scor_gradient *= 0.5 * r_1;
00851     slow_gradient *= 0.5 * r_1;
00852 
00853     // let modf be 1 if excluded, 1-scale14 if modified, 0 otherwise,
00854     // add scor_ - modf * slow_ to slow terms and
00855     // add fast_ - modf * fast_ to fast terms.
00856 
00857     BigReal vdwa_energy, vdwa_gradient;
00858     BigReal vdwb_energy, vdwb_gradient;
00859 
00860     const BigReal r_6 = r_2*r_2*r_2;
00861     const BigReal r_12 = r_6*r_6;
00862 
00863     // Lennard-Jones switching function
00864   if ( simParams->vdwForceSwitching ) {  // switch force
00865     vdw_switch_mode = VDW_SWITCH_MODE_FORCE;
00866 
00867     // from Steinbach & Brooks, JCC 15, pgs 667-683, 1994, eqns 10-13
00868     if ( r2 > switchOn2 ) {
00869       BigReal tmpa = r_6 - cutoff_6;
00870       vdwa_energy = k_vdwa * tmpa * tmpa - (LJcorrection ? v_vdwa : 0.0);
00871       BigReal tmpb = r_1 * r_2 - cutoff_3;
00872       vdwb_energy = k_vdwb * tmpb * tmpb - (LJcorrection ? v_vdwb : 0.0);
00873       vdwa_gradient = -6.0 * k_vdwa * tmpa * r_2 * r_6;
00874       vdwb_gradient = -3.0 * k_vdwb * tmpb * r_2 * r_2 * r_1;
00875     } else {
00876       vdwa_energy = r_12 + (LJcorrection ? 0.0 : v_vdwa);
00877       vdwb_energy = r_6 + (LJcorrection ? 0.0 : v_vdwb);
00878       vdwa_gradient = -6.0 * r_2 * r_12;
00879       vdwb_gradient = -3.0 * r_2 * r_6;
00880     }
00881   } else if ( simParams->martiniSwitching ) { // switching fxn for Martini RBCG
00882     vdw_switch_mode = VDW_SWITCH_MODE_MARTINI;
00883 
00884     BigReal r12 = (r-switchOn)*(r-switchOn);        BigReal r13 = (r-switchOn)*(r-switchOn)*(r-switchOn);
00885 
00886     BigReal p6 = 6;
00887     BigReal A6 = p6 * ((p6+1)*switchOn-(p6+4)*cutoff)/(pow(cutoff,p6+2)*pow(cutoff-switchOn,2));
00888     BigReal B6 = -p6 * ((p6+1)*switchOn-(p6+3)*cutoff)/(pow(cutoff,p6+2)*pow(cutoff-switchOn,3));        
00889     BigReal C6 = 1.0/pow(cutoff,p6)-A6/3.0*pow(cutoff-switchOn,3)-B6/4.0*pow(cutoff-switchOn,4);
00890 
00891     BigReal p12 = 12;
00892     BigReal A12 = p12 * ((p12+1)*switchOn-(p12+4)*cutoff)/(pow(cutoff,p12+2)*pow(cutoff-switchOn,2));
00893     BigReal B12 = -p12 * ((p12+1)*switchOn-(p12+3)*cutoff)/(pow(cutoff,p12+2)*pow(cutoff-switchOn,3));
00894     BigReal C12 = 1.0/pow(cutoff,p12)-A12/3.0*pow(cutoff-switchOn,3)-B12/4.0*pow(cutoff-switchOn,4);
00895 
00896     BigReal LJshifttempA = -(A12/3)*r13 - (B12/4)*r12*r12 - C12;
00897     BigReal LJshifttempB = -(A6/3)*r13 - (B6/4)*r12*r12 - C6;
00898     const BigReal shiftValA =         // used for Lennard-Jones
00899                         ( r2 > switchOn2 ? LJshifttempA : -C12);
00900     const BigReal shiftValB =         // used for Lennard-Jones
00901                         ( r2 > switchOn2 ? LJshifttempB : -C6);
00902 
00903     BigReal LJdshifttempA = -A12*r12 - B12*r13;
00904     BigReal LJdshifttempB = -A6*r12 - B6*r13;
00905     const BigReal dshiftValA =         // used for Lennard-Jones
00906                         ( r2 > switchOn2 ? LJdshifttempA*0.5*r_1 : 0 );
00907     const BigReal dshiftValB =         // used for Lennard-Jones
00908                         ( r2 > switchOn2 ? LJdshifttempB*0.5*r_1 : 0 );
00909 
00910 
00911 
00912 
00913     //have not addressed r > cutoff
00914 
00915     //  dshiftValA*= 0.5*r_1;
00916     //  dshiftValB*= 0.5*r_1;
00917 
00918     vdwa_energy = r_12 + shiftValA;
00919     vdwb_energy = r_6 + shiftValB;
00920    
00921     vdwa_gradient = -6/pow(r,14) + dshiftValA ;
00922     vdwb_gradient = -3/pow(r,8) + dshiftValB;
00923 
00924   } else {  // switch energy
00925     vdw_switch_mode = VDW_SWITCH_MODE_ENERGY;
00926 
00927     const BigReal c2 = cutoff2-r2;
00928     const BigReal c4 = c2*(c3-2.0*c2);
00929     const BigReal switchVal =         // used for Lennard-Jones
00930                         ( r2 > switchOn2 ? c2*c4*c1 : 1.0 );
00931     const BigReal dSwitchVal =        // d switchVal / d r2
00932                         ( r2 > switchOn2 ? 2*c1*(c2*c2-c4) : 0.0 );
00933 
00934     vdwa_energy = switchVal * r_12;
00935     vdwb_energy = switchVal * r_6;
00936 
00937     vdwa_gradient = ( dSwitchVal - 6.0 * switchVal * r_2 ) * r_12;
00938     vdwb_gradient = ( dSwitchVal - 3.0 * switchVal * r_2 ) * r_6;
00939   }
00940 
00941 
00942 #ifdef NAMD_KNL
00943    if ( knl_table ) {
00944     knl_fast_ener_table[i] = -1.*fast_energy;
00945     knl_fast_grad_table[i] = -2.*fast_gradient;
00946     knl_scor_ener_table[i] = -1.*scor_energy;
00947     knl_scor_grad_table[i] = -2.*scor_gradient;
00948     knl_slow_ener_table[i] = -1.*slow_energy;
00949     knl_slow_grad_table[i] = -2.*slow_gradient;
00950     knl_corr_ener_table[i] = -1.*(fast_energy + scor_energy);
00951     knl_corr_grad_table[i] = -2.*(fast_gradient + scor_gradient);
00952     knl_full_ener_table[i] = -1.*(fast_energy + slow_energy);
00953     knl_full_grad_table[i] = -2.*(fast_gradient + slow_gradient);
00954     if ( i == nn-1 ) {
00955       knl_fast_ener_table[nn] = knl_fast_ener_table[i];
00956       knl_fast_grad_table[nn] = knl_fast_grad_table[i];
00957       knl_scor_ener_table[nn] = knl_scor_ener_table[i];
00958       knl_scor_grad_table[nn] = knl_scor_grad_table[i];
00959       knl_slow_ener_table[nn] = knl_slow_ener_table[i];
00960       knl_slow_grad_table[nn] = knl_slow_grad_table[i];
00961       knl_corr_ener_table[nn] = knl_corr_ener_table[i];
00962       knl_corr_grad_table[nn] = knl_corr_grad_table[i];
00963       knl_full_ener_table[nn] = knl_full_ener_table[i];
00964       knl_full_grad_table[nn] = knl_full_grad_table[i];
00965     }
00966    } else {
00967 #endif
00968     *(fast_i++) = fast_energy;
00969     *(fast_i++) = fast_gradient;
00970     *(fast_i++) = 0;
00971     *(fast_i++) = 0;
00972     *(scor_i++) = scor_energy;
00973     *(scor_i++) = scor_gradient;
00974     *(scor_i++) = 0;
00975     *(scor_i++) = 0;
00976     *(slow_i++) = slow_energy;
00977     *(slow_i++) = slow_gradient;
00978     *(slow_i++) = 0;
00979     *(slow_i++) = 0;
00980     *(vdwa_i++) = vdwa_energy;
00981     *(vdwa_i++) = vdwa_gradient;
00982     *(vdwa_i++) = 0;
00983     *(vdwa_i++) = 0;
00984     *(vdwb_i++) = vdwb_energy;
00985     *(vdwb_i++) = vdwb_gradient;
00986     *(vdwb_i++) = 0;
00987     *(vdwb_i++) = 0;
00988     *(r2_i++) = r2 + r2_delta;
00989 #ifdef NAMD_KNL
00990    }
00991 #endif
00992 
00993   }
00994 #ifdef NAMD_KNL
00995  } // knl_table loop
00996 #endif
00997 
00998   if ( ! r2_delta_i ) {
00999     NAMD_bug("Failed to find table entry for r2 == r2_limit\n");
01000   }
01001   if ( r2_table[r2_delta_i] > r2_limit + r2_delta ) {
01002     NAMD_bug("Found bad table entry for r2 == r2_limit\n");
01003   }
01004 
01005   int j;
01006   const char *table_name = "XXXX";
01007   int smooth_short = 0;
01008   for ( j=0; j<5; ++j ) {
01009     BigReal *t0 = 0;
01010     switch (j) {
01011       case 0: 
01012         t0 = fast_table;
01013         table_name = "FAST";
01014         smooth_short = 1;
01015       break;
01016       case 1: 
01017         t0 = scor_table;
01018         table_name = "SCOR";
01019         smooth_short = 0;
01020       break;
01021       case 2: 
01022         t0 = slow_table;
01023         table_name = "SLOW";
01024         smooth_short = 0;
01025       break;
01026       case 3: 
01027         t0 = vdwa_table;
01028         table_name = "VDWA";
01029         smooth_short = 1;
01030       break;
01031       case 4: 
01032         t0 = vdwb_table;
01033         table_name = "VDWB";
01034         smooth_short = 1;
01035       break;
01036     }
01037     // patch up data for i=0
01038     t0[0] = t0[4] - t0[5] * ( r2_delta / 64.0 );  // energy
01039     t0[1] = t0[5];  // gradient
01040     t0[2] = 0;
01041     t0[3] = 0;
01042     if ( smooth_short ) {
01043       BigReal energy0 = t0[4*r2_delta_i];
01044       BigReal gradient0 = t0[4*r2_delta_i+1];
01045       BigReal r20 = r2_table[r2_delta_i];
01046       t0[0] = energy0 - gradient0 * (r20 - r2_table[0]);  // energy
01047       t0[1] = gradient0;  // gradient
01048     }
01049     BigReal *t;
01050     for ( i=0,t=t0; i<(n-1); ++i,t+=4 ) {
01051       BigReal x = ( r2_delta * ( 1 << (i/64) ) ) / 64.0;
01052       if ( r2_table[i+1] != r2_table[i] + x ) {
01053         NAMD_bug("Bad table delta calculation.\n");
01054       }
01055       if ( smooth_short && i+1 < r2_delta_i ) {
01056         BigReal energy0 = t0[4*r2_delta_i];
01057         BigReal gradient0 = t0[4*r2_delta_i+1];
01058         BigReal r20 = r2_table[r2_delta_i];
01059         t[4] = energy0 - gradient0 * (r20 - r2_table[i+1]);  // energy
01060         t[5] = gradient0;  // gradient
01061       }
01062       BigReal v1 = t[0];
01063       BigReal g1 = t[1];
01064       BigReal v2 = t[4];
01065       BigReal g2 = t[5];
01066       // explicit formulas for v1 + g1 x + c x^2 + d x^3
01067       BigReal c = ( 3.0 * (v2 - v1) - x * (2.0 * g1 + g2) ) / ( x * x );
01068       BigReal d = ( -2.0 * (v2 - v1) + x * (g1 + g2) ) / ( x * x * x );
01069       // since v2 - v1 is imprecise, we refine c and d numerically
01070       // important because we need accurate forces (more than energies!)
01071       for ( int k=0; k < 2; ++k ) {
01072         BigReal dv = (v1 - v2) + ( ( d * x + c ) * x + g1 ) * x;
01073         BigReal dg = (g1 - g2) + ( 3.0 * d * x + 2.0 * c ) * x;
01074         c -= ( 3.0 * dv - x * dg ) / ( x * x );
01075         d -= ( -2.0 * dv + x * dg ) / ( x * x * x );
01076       }
01077       // store in the array;
01078       t[2] = c;  t[3] = d;
01079     }
01080 
01081     if ( ! CkMyPe() ) {
01082     BigReal dvmax = 0;
01083     BigReal dgmax = 0;
01084     BigReal dvmax_r = 0;
01085     BigReal dgmax_r = 0;
01086     BigReal fdvmax = 0;
01087     BigReal fdgmax = 0;
01088     BigReal fdvmax_r = 0;
01089     BigReal fdgmax_r = 0;
01090     BigReal dgcdamax = 0;
01091     BigReal dgcdimax = 0;
01092     BigReal dgcaimax = 0;
01093     BigReal dgcdamax_r = 0;
01094     BigReal dgcdimax_r = 0;
01095     BigReal dgcaimax_r = 0;
01096     BigReal fdgcdamax = 0;
01097     BigReal fdgcdimax = 0;
01098     BigReal fdgcaimax = 0;
01099     BigReal fdgcdamax_r = 0;
01100     BigReal fdgcdimax_r = 0;
01101     BigReal fdgcaimax_r = 0;
01102     BigReal gcm = fabs(t0[1]);  // gradient magnitude running average
01103     for ( i=0,t=t0; i<(n-1); ++i,t+=4 ) {
01104       const BigReal r2_base = r2_delta * ( 1 << (i/64) );
01105       const BigReal r2_del = r2_base / 64.0;
01106       const BigReal r2 = r2_base - r2_delta + r2_del * (i%64);
01107       const BigReal r = sqrt(r2);
01108       if ( r > cutoff ) break;
01109       BigReal x = r2_del;
01110       BigReal dv = ( ( t[3] * x + t[2] ) * x + t[1] ) * x + t[0] - t[4];
01111       BigReal dg = ( 3.0 * t[3] * x + 2.0 * t[2] ) * x + t[1] - t[5];
01112       if ( t[4] != 0. && fabs(dv/t[4]) > fdvmax ) {
01113         fdvmax = fabs(dv/t[4]); fdvmax_r = r;
01114       }
01115       if ( fabs(dv) > dvmax ) {
01116         dvmax = fabs(dv); dvmax_r = r;
01117       }
01118       if ( t[5] != 0. && fabs(dg/t[5]) > fdgmax ) {
01119         fdgmax = fabs(dg/t[5]); fdgmax_r = r;
01120       }
01121       if ( fabs(dg) > dgmax ) {
01122         dgmax = fabs(dg); dgmax_r = r;
01123       }
01124       BigReal gcd = (t[4] - t[0]) / x;  // centered difference gradient
01125       BigReal gcd_prec = (fabs(t[0]) + fabs(t[4])) * 1.e-15 / x;  // roundoff
01126       gcm = 0.9 * gcm + 0.1 * fabs(t[5]);  // magnitude running average
01127       BigReal gca = 0.5  * (t[1] + t[5]);  // centered average gradient
01128       BigReal gci = ( 0.75 * t[3] * x + t[2] ) * x + t[1];  // interpolated
01129       BigReal rc = sqrt(r2 + 0.5 * x);
01130       BigReal dgcda = gcd - gca;
01131       if ( dgcda != 0. && fabs(dgcda) < gcd_prec ) {
01132         // CkPrintf("ERROR %g < PREC %g AT %g AVG VAL %g\n", dgcda, gcd_prec, rc, gca);
01133         dgcda = 0.;
01134       }
01135       BigReal dgcdi = gcd - gci;
01136       if ( dgcdi != 0. && fabs(dgcdi) < gcd_prec ) {
01137         // CkPrintf("ERROR %g < PREC %g AT %g INT VAL %g\n", dgcdi, gcd_prec, rc, gci);
01138         dgcdi = 0.;
01139       }
01140       BigReal dgcai = gca - gci;
01141       if ( t[1]*t[5] > 0. && gcm != 0. && fabs(dgcda/gcm) > fdgcdamax ) {
01142         fdgcdamax = fabs(dgcda/gcm); fdgcdamax_r = rc;
01143       }
01144       if ( fabs(dgcda) > fdgcdamax ) {
01145         dgcdamax = fabs(dgcda); dgcdamax_r = rc;
01146       }
01147       if ( t[1]*t[5] > 0. && gcm != 0. && fabs(dgcdi/gcm) > fdgcdimax ) {
01148         fdgcdimax = fabs(dgcdi/gcm); fdgcdimax_r = rc;
01149       }
01150       if ( fabs(dgcdi) > fdgcdimax ) {
01151         dgcdimax = fabs(dgcdi); dgcdimax_r = rc;
01152       }
01153       if ( t[1]*t[5] > 0. && gcm != 0. && fabs(dgcai/gcm) > fdgcaimax ) {
01154         fdgcaimax = fabs(dgcai/gcm); fdgcaimax_r = rc;
01155       }
01156       if ( fabs(dgcai) > fdgcaimax ) {
01157         dgcaimax = fabs(dgcai); dgcaimax_r = rc;
01158       }
01159 #if 0
01160       CkPrintf("TABLE %s %g %g %g %g\n",table_name,rc,dgcda/gcm,dgcda,gci);
01161       if (dv != 0.) CkPrintf("TABLE %d ENERGY ERROR %g AT %g (%d)\n",j,dv,r,i);
01162       if (dg != 0.) CkPrintf("TABLE %d FORCE ERROR %g AT %g (%d)\n",j,dg,r,i);
01163 #endif
01164     }
01165     if ( dvmax != 0.0 ) {
01166       iout << iINFO << "ABSOLUTE IMPRECISION IN " << table_name <<
01167         " TABLE ENERGY: " << dvmax << " AT " << dvmax_r << "\n" << endi;
01168     }
01169     if ( fdvmax != 0.0 ) {
01170       iout << iINFO << "RELATIVE IMPRECISION IN " << table_name <<
01171         " TABLE ENERGY: " << fdvmax << " AT " << fdvmax_r << "\n" << endi;
01172     }
01173     if ( dgmax != 0.0 ) {
01174       iout << iINFO << "ABSOLUTE IMPRECISION IN " << table_name <<
01175         " TABLE FORCE: " << dgmax << " AT " << dgmax_r << "\n" << endi;
01176     }
01177     if ( fdgmax != 0.0 ) {
01178       iout << iINFO << "RELATIVE IMPRECISION IN " << table_name <<
01179         " TABLE FORCE: " << fdgmax << " AT " << fdgmax_r << "\n" << endi;
01180     }
01181     if (fdgcdamax != 0.0 ) {
01182       iout << iINFO << "INCONSISTENCY IN " << table_name <<
01183         " TABLE ENERGY VS FORCE: " << fdgcdamax << " AT " << fdgcdamax_r << "\n" << endi;
01184       if ( fdgcdamax > 0.1 ) {
01185         iout << iERROR << "\n";
01186         iout << iERROR << "CALCULATED " << table_name <<
01187           " FORCE MAY NOT MATCH ENERGY! POSSIBLE BUG!\n";
01188         iout << iERROR << "\n";
01189       }
01190     }
01191     if (0 && fdgcdimax != 0.0 ) {
01192       iout << iINFO << "INCONSISTENCY IN " << table_name <<
01193         " TABLE ENERGY VS FORCE: " << fdgcdimax << " AT " << fdgcdimax_r << "\n" << endi;
01194     }
01195     if ( 0 && fdgcaimax != 0.0 ) {
01196       iout << iINFO << "INCONSISTENCY IN " << table_name <<
01197         " TABLE AVG VS INT FORCE: " << fdgcaimax << " AT " << fdgcaimax_r << "\n" << endi;
01198     }
01199     }
01200 
01201   }
01202 
01203   for ( i=0; i<4*n; ++i ) {
01204     corr_table[i] = fast_table[i] + scor_table[i];
01205     full_table[i] = fast_table[i] + slow_table[i];
01206   }
01207 
01208 #if 0  
01209   for ( i=0; i<n; ++i ) {
01210    for ( int j=0; j<4; ++j ) {
01211     table_short[16*i+6-2*j] = table_noshort[16*i+6-2*j] = vdwa_table[4*i+j];
01212     table_short[16*i+7-2*j] = table_noshort[16*i+7-2*j] = vdwb_table[4*i+j];
01213     table_short[16*i+8+3-j] = fast_table[4*i+j];
01214     table_short[16*i+12+3-j] = scor_table[4*i+j];
01215     table_noshort[16*i+8+3-j] = corr_table[4*i+j];
01216     table_noshort[16*i+12+3-j] = full_table[4*i+j];
01217    }
01218   }
01219 #endif 
01220 
01221   for ( i=0; i<n; ++i ) {
01222     table_short[16*i+0] = table_noshort[16*i+0] = -6.*vdwa_table[4*i+3];
01223     table_short[16*i+1] = table_noshort[16*i+1] = -4.*vdwa_table[4*i+2];
01224     table_short[16*i+2] = table_noshort[16*i+2] = -2.*vdwa_table[4*i+1];
01225     table_short[16*i+3] = table_noshort[16*i+3] = -1.*vdwa_table[4*i+0];
01226     
01227     table_short[16*i+4] = table_noshort[16*i+4] = -6.*vdwb_table[4*i+3];
01228     table_short[16*i+5] = table_noshort[16*i+5] = -4.*vdwb_table[4*i+2];
01229     table_short[16*i+6] = table_noshort[16*i+6] = -2.*vdwb_table[4*i+1];
01230     table_short[16*i+7] = table_noshort[16*i+7] = -1.*vdwb_table[4*i+0];
01231     
01232     table_short[16*i+8]  = -6.*fast_table[4*i+3];
01233     table_short[16*i+9]  = -4.*fast_table[4*i+2];
01234     table_short[16*i+10] = -2.*fast_table[4*i+1];
01235     table_short[16*i+11] = -1.*fast_table[4*i+0];
01236 
01237     table_noshort[16*i+8]  = -6.*corr_table[4*i+3];
01238     table_noshort[16*i+9]  = -4.*corr_table[4*i+2];
01239     table_noshort[16*i+10] = -2.*corr_table[4*i+1];
01240     table_noshort[16*i+11] = -1.*corr_table[4*i+0];
01241 
01242     table_short[16*i+12] = -6.*scor_table[4*i+3];
01243     table_short[16*i+13] = -4.*scor_table[4*i+2];
01244     table_short[16*i+14] = -2.*scor_table[4*i+1];
01245     table_short[16*i+15] = -1.*scor_table[4*i+0];
01246 
01247     table_noshort[16*i+12] = -6.*full_table[4*i+3];
01248     table_noshort[16*i+13] = -4.*full_table[4*i+2];
01249     table_noshort[16*i+14] = -2.*full_table[4*i+1];
01250     table_noshort[16*i+15] = -1.*full_table[4*i+0];
01251   }
01252 
01253 #if 0
01254   char fname[100];
01255   sprintf(fname,"/tmp/namd.table.pe%d.dat",CkMyPe());
01256   FILE *f = fopen(fname,"w");
01257   for ( i=0; i<(n-1); ++i ) {
01258     const BigReal r2_base = r2_delta * ( 1 << (i/64) );
01259     const BigReal r2_del = r2_base / 64.0;
01260     const BigReal r2 = r2_base - r2_delta + r2_del * (i%64);
01261     BigReal *t;
01262     if ( r2 + r2_delta != r2_table[i] ) fprintf(f,"r2 error! ");
01263     fprintf(f,"%g",r2);
01264     t = fast_table + 4*i;
01265     fprintf(f,"   %g %g %g %g", t[0], t[1], t[2], t[3]);
01266     t = scor_table + 4*i;
01267     fprintf(f,"   %g %g %g %g", t[0], t[1], t[2], t[3]);
01268     t = slow_table + 4*i;
01269     fprintf(f,"   %g %g %g %g", t[0], t[1], t[2], t[3]);
01270     t = corr_table + 4*i;
01271     fprintf(f,"   %g %g %g %g", t[0], t[1], t[2], t[3]);
01272     t = full_table + 4*i;
01273     fprintf(f,"   %g %g %g %g", t[0], t[1], t[2], t[3]);
01274     t = vdwa_table + 4*i;
01275     fprintf(f,"   %g %g %g %g", t[0], t[1], t[2], t[3]);
01276     t = vdwb_table + 4*i;
01277     fprintf(f,"   %g %g %g %g", t[0], t[1], t[2], t[3]);
01278     fprintf(f,"\n");
01279   }
01280   fclose(f);
01281 #endif
01282 
01283   //Flip slow table to match table_four_i
01284   for ( i=0; i<n; ++i ) {
01285     BigReal tmp0, tmp1, tmp2, tmp3;
01286     tmp0 = slow_table [i*4 + 0];
01287     tmp1 = slow_table [i*4 + 1];
01288     tmp2 = slow_table [i*4 + 2];
01289     tmp3 = slow_table [i*4 + 3];
01290 
01291     slow_table [i*4 + 0] = tmp3;
01292     slow_table [i*4 + 1] = tmp2;
01293     slow_table [i*4 + 2] = tmp1;
01294     slow_table [i*4 + 3] = tmp0;
01295   }
01296 
01297 #ifdef NAMD_CUDA
01298   if (!simParams->useCUDA2) {
01299     send_build_cuda_force_table();
01300   }
01301 #endif
01302 
01303   #ifdef NAMD_MIC
01304     send_build_mic_force_table();
01305   #endif
01306 }

static BigReal ComputeNonbondedUtil::square ( const BigReal x,
const BigReal y,
const BigReal z 
) [inline, static]

Definition at line 410 of file ComputeNonbondedUtil.h.

00413         {
00414         return(x*x+y*y+z*z);
00415         }

void ComputeNonbondedUtil::submitPressureProfileData ( BigReal ,
SubmitReduction  
) [static]

Definition at line 223 of file ComputeNonbondedUtil.C.

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

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

00225 {
00226   if (!reduction) return;
00227   int numAtomTypes = pressureProfileAtomTypes;
00228   // For ease of calculation we stored interactions between types
00229   // i and j in (ni+j).  For efficiency now we coalesce the
00230   // cross interactions so that just i<=j are stored.
00231   const int arraysize = 3*pressureProfileSlabs;
00232   size_t nelems = arraysize*(numAtomTypes*(numAtomTypes+1))/2;
00233   BigReal *arr = new BigReal[nelems];
00234   memset(arr, 0, nelems*sizeof(BigReal));
00235 
00236   int i, j;
00237   for (i=0; i<numAtomTypes; i++) {
00238     for (j=0; j<numAtomTypes; j++) {
00239       int ii=i;
00240       int jj=j;
00241       if (ii > jj) { int tmp=ii; ii=jj; jj=tmp; }
00242       const int reductionOffset = (ii*numAtomTypes - (ii*(ii+1))/2 + jj)*arraysize;
00243       for (int k=0; k<arraysize; k++) {
00244         arr[reductionOffset+k] += data[k];
00245       }
00246       data += arraysize;
00247     }
00248   }
00249   // copy into reduction
00250   reduction->add(nelems, arr);
00251   delete [] arr;
00252 }

void ComputeNonbondedUtil::submitReductionData ( BigReal ,
SubmitReduction  
) [static]

Reimplemented in ExclElem.

Definition at line 190 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, fullElectVirialIndex, goNativeEnergyIndex, goNonnativeEnergyIndex, groGaussEnergyIndex, groLJEnergyIndex, SubmitReduction::item(), pairElectForceIndex, pairlistWarningIndex, pairVDWForceIndex, 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_F_LEFT, REDUCTION_LJ_ENERGY_TI_1, REDUCTION_LJ_ENERGY_TI_2, REDUCTION_PAIR_ELECT_FORCE, REDUCTION_PAIR_VDW_FORCE, REDUCTION_PAIRLIST_WARNINGS, REDUCTION_VIRIAL_NBOND, REDUCTION_VIRIAL_SLOW, vdwEnergyIndex, vdwEnergyIndex_s, vdwEnergyIndex_s_Left, vdwEnergyIndex_ti_1, vdwEnergyIndex_ti_2, and virialIndex.

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

00191 {
00192   reduction->item(REDUCTION_EXCLUSION_CHECKSUM) += data[exclChecksumIndex];
00193   reduction->item(REDUCTION_PAIRLIST_WARNINGS) += data[pairlistWarningIndex];
00194   reduction->item(REDUCTION_ELECT_ENERGY) += data[electEnergyIndex];
00195   reduction->item(REDUCTION_ELECT_ENERGY_SLOW) += data[fullElectEnergyIndex];
00196   reduction->item(REDUCTION_LJ_ENERGY) += data[vdwEnergyIndex];
00197   // Ported by JLai
00198   reduction->item(REDUCTION_GRO_LJ_ENERGY) += data[groLJEnergyIndex];
00199   reduction->item(REDUCTION_GRO_GAUSS_ENERGY) += data[groGaussEnergyIndex];
00200   reduction->item(REDUCTION_GO_NATIVE_ENERGY) += data[goNativeEnergyIndex];
00201   reduction->item(REDUCTION_GO_NONNATIVE_ENERGY) += data[goNonnativeEnergyIndex];
00202   // End of port -- JLai
00203 //fepb
00204   reduction->item(REDUCTION_ELECT_ENERGY_F) += data[electEnergyIndex_s];
00205   reduction->item(REDUCTION_ELECT_ENERGY_SLOW_F) += data[fullElectEnergyIndex_s];
00206   reduction->item(REDUCTION_LJ_ENERGY_F) += data[vdwEnergyIndex_s];
00207   reduction->item(REDUCTION_LJ_ENERGY_F_LEFT) += data[vdwEnergyIndex_s_Left];
00208 
00209   reduction->item(REDUCTION_ELECT_ENERGY_TI_1) += data[electEnergyIndex_ti_1];
00210   reduction->item(REDUCTION_ELECT_ENERGY_SLOW_TI_1) += data[fullElectEnergyIndex_ti_1];
00211   reduction->item(REDUCTION_LJ_ENERGY_TI_1) += data[vdwEnergyIndex_ti_1];
00212   reduction->item(REDUCTION_ELECT_ENERGY_TI_2) += data[electEnergyIndex_ti_2];
00213   reduction->item(REDUCTION_ELECT_ENERGY_SLOW_TI_2) += data[fullElectEnergyIndex_ti_2];
00214   reduction->item(REDUCTION_LJ_ENERGY_TI_2) += data[vdwEnergyIndex_ti_2];
00215 //fepe
00216   ADD_TENSOR(reduction,REDUCTION_VIRIAL_NBOND,data,virialIndex);
00217   ADD_TENSOR(reduction,REDUCTION_VIRIAL_SLOW,data,fullElectVirialIndex);
00218   ADD_VECTOR(reduction,REDUCTION_PAIR_VDW_FORCE,data,pairVDWForceIndex);
00219   ADD_VECTOR(reduction,REDUCTION_PAIR_ELECT_FORCE,data,pairElectForceIndex);
00220   reduction->item(REDUCTION_COMPUTE_CHECKSUM) += 1.;
00221 }


Member Data Documentation

float ComputeNonbondedUtil::A12_f [static]

Definition at line 344 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::A6_f [static]

Definition at line 341 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::accelMDOn [static]

Definition at line 389 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::alchDecouple [static]

Definition at line 369 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

BigReal ComputeNonbondedUtil::alchDispLambda [static]

Definition at line 371 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

BigReal ComputeNonbondedUtil::alchElecLambda [static]

Definition at line 372 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

Bool ComputeNonbondedUtil::alchFepOn [static]

Definition at line 356 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::alchLambda2 [static]

Definition at line 358 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

BigReal ComputeNonbondedUtil::alchRepLambda [static]

Definition at line 370 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

Bool ComputeNonbondedUtil::alchThermIntOn [static]

Definition at line 357 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::alchVdwShiftCoeff [static]

Definition at line 359 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

float ComputeNonbondedUtil::B12_f [static]

Definition at line 345 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::B6_f [static]

Definition at line 342 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::c0 [static]

Definition at line 347 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::c1 [static]

Definition at line 348 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

float ComputeNonbondedUtil::C12_f [static]

Definition at line 346 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::c3 [static]

Definition at line 349 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

BigReal ComputeNonbondedUtil::c5 [static]

Definition at line 350 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::c6 [static]

Definition at line 351 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::C6_f [static]

Definition at line 343 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::c7 [static]

Definition at line 352 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::c8 [static]

Definition at line 353 of file ComputeNonbondedUtil.h.

Referenced by select().

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

Definition at line 167 of file ComputeNonbondedUtil.C.

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

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

Definition at line 168 of file ComputeNonbondedUtil.C.

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

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

Definition at line 169 of file ComputeNonbondedUtil.C.

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

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

Definition at line 170 of file ComputeNonbondedUtil.C.

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

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

Definition at line 172 of file ComputeNonbondedUtil.C.

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

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

Definition at line 173 of file ComputeNonbondedUtil.C.

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

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

Definition at line 174 of file ComputeNonbondedUtil.C.

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

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

Definition at line 175 of file ComputeNonbondedUtil.C.

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

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

Definition at line 162 of file ComputeNonbondedUtil.C.

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

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

Definition at line 163 of file ComputeNonbondedUtil.C.

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

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

Definition at line 164 of file ComputeNonbondedUtil.C.

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

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

Definition at line 165 of file ComputeNonbondedUtil.C.

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

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

Definition at line 177 of file ComputeNonbondedUtil.C.

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

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

Definition at line 178 of file ComputeNonbondedUtil.C.

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

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

Definition at line 179 of file ComputeNonbondedUtil.C.

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

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

Definition at line 180 of file ComputeNonbondedUtil.C.

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

int ComputeNonbondedUtil::columnsize [static]

Definition at line 289 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::commOnly [static]

Definition at line 278 of file ComputeNonbondedUtil.h.

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

BigReal * ComputeNonbondedUtil::corr_table [static]

Definition at line 298 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::cutoff [static]

Definition at line 281 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedCUDA::build_force_table(), buildForceAndEnergyTable(), ComputeNonbondedSelf::doForce(), ComputeNonbondedPair::doForce(), CudaComputeNonbonded::launchWork(), and select().

BigReal ComputeNonbondedUtil::cutoff2 [static]

Definition at line 282 of file ComputeNonbondedUtil.h.

Referenced by ExclElem::computeForce(), ComputeNonbondedCUDA::recvYieldDevice(), select(), and SELF().

float ComputeNonbondedUtil::cutoff2_f [static]

Definition at line 283 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

BigReal ComputeNonbondedUtil::cutoff_3 [static]

Definition at line 332 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::cutoff_3_f [static]

Definition at line 338 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::cutoff_6 [static]

Definition at line 333 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::cutoff_6_f [static]

Definition at line 339 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::dielectric_1 [static]

Definition at line 284 of file ComputeNonbondedUtil.h.

Referenced by ExclElem::computeForce(), ComputePme::doWork(), ComputeNonbondedCUDA::doWork(), ComputeEwald::doWork(), HomePatch::positionsReady(), scale_n_copy_coordinates(), select(), and SELF().

Bool ComputeNonbondedUtil::drudeNbthole [static]

Definition at line 391 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::ewaldcof [static]

Definition at line 394 of file ComputeNonbondedUtil.h.

Referenced by ComputeEwald::ComputeEwald(), OptPmeCompute::doWork(), ComputePmeMgr::gridCalc2R(), CudaPmePencilZ::initializeDevice(), CudaPmePencilXYZ::initializeDevice(), OptPmeXPencil::pme_kspace(), PmeXPencil::pme_kspace(), and select().

BigReal * ComputeNonbondedUtil::fast_table [static]

Definition at line 295 of file ComputeNonbondedUtil.h.

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

Bool ComputeNonbondedUtil::Fep_ElecOn [static]

Definition at line 364 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

Bool ComputeNonbondedUtil::Fep_WCA_dispOn [static]

Definition at line 363 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

Bool ComputeNonbondedUtil::Fep_WCA_repuOn [static]

Definition at line 362 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

Bool ComputeNonbondedUtil::Fep_Wham [static]

Definition at line 365 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

Bool ComputeNonbondedUtil::fixedAtomsOn [static]

Definition at line 279 of file ComputeNonbondedUtil.h.

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

BigReal * ComputeNonbondedUtil::full_table [static]

Definition at line 299 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::goForcesOn [static]

Definition at line 405 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::goGroPair [static]

Definition at line 404 of file ComputeNonbondedUtil.h.

Referenced by ALCHPAIR(), and select().

int ComputeNonbondedUtil::goMethod [static]

Definition at line 406 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::k_vdwa [static]

Definition at line 330 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::k_vdwa_f [static]

Definition at line 336 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::k_vdwb [static]

Definition at line 331 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::k_vdwb_f [static]

Definition at line 337 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal * ComputeNonbondedUtil::lambda_table = 0 [static]

Definition at line 378 of file ComputeNonbondedUtil.h.

Referenced by select().

int ComputeNonbondedUtil::lesFactor [static]

Definition at line 375 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::lesOn [static]

Definition at line 374 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::lesScaling [static]

Definition at line 376 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::LJcorrection [static]

Definition at line 361 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

const LJTable * ComputeNonbondedUtil::ljTable = 0 [static]

Definition at line 285 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedCUDA::build_lj_table(), ExclElem::computeForce(), dumpbench(), SimParameters::scriptSet(), select(), and SELF().

const Molecule * ComputeNonbondedUtil::mol [static]

Definition at line 286 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedCUDA::build_exclusions(), ComputeNonbondedCUDA::doWork(), ComputeNonbondedCUDA::finishWork(), select(), and SELF().

Bool ComputeNonbondedUtil::pairInteractionOn [static]

Definition at line 380 of file ComputeNonbondedUtil.h.

Referenced by select().

Bool ComputeNonbondedUtil::pairInteractionSelf [static]

Definition at line 381 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::pi_ewaldcof [static]

Definition at line 395 of file ComputeNonbondedUtil.h.

Referenced by select().

int ComputeNonbondedUtil::pressureProfileAtomTypes [static]

Reimplemented in ExclElem.

Definition at line 385 of file ComputeNonbondedUtil.h.

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

BigReal ComputeNonbondedUtil::pressureProfileMin [static]

Reimplemented in ExclElem.

Definition at line 387 of file ComputeNonbondedUtil.h.

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

Bool ComputeNonbondedUtil::pressureProfileOn [static]

Definition at line 383 of file ComputeNonbondedUtil.h.

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

int ComputeNonbondedUtil::pressureProfileSlabs [static]

Reimplemented in ExclElem.

Definition at line 384 of file ComputeNonbondedUtil.h.

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

BigReal ComputeNonbondedUtil::pressureProfileThickness [static]

Reimplemented in ExclElem.

Definition at line 386 of file ComputeNonbondedUtil.h.

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

Bool ComputeNonbondedUtil::qmForcesOn [static]

Definition at line 280 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::r2_delta [static]

Definition at line 287 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedCUDA::build_force_table(), buildForceAndEnergyTable(), ExclElem::computeForce(), select(), and SELF().

BigReal ComputeNonbondedUtil::r2_delta_1 [static]

Definition at line 287 of file ComputeNonbondedUtil.h.

Referenced by select().

int ComputeNonbondedUtil::r2_delta_exp [static]

Definition at line 290 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedCUDA::build_force_table(), buildForceAndEnergyTable(), ExclElem::computeForce(), select(), and SELF().

BigReal * ComputeNonbondedUtil::r2_table [static]

Definition at line 302 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedCUDA::build_force_table(), buildForceAndEnergyTable(), ExclElem::computeForce(), and select().

int ComputeNonbondedUtil::rowsize [static]

Definition at line 288 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::scale14 [static]

Definition at line 324 of file ComputeNonbondedUtil.h.

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

BigReal ComputeNonbondedUtil::scaling [static]

Definition at line 323 of file ComputeNonbondedUtil.h.

Referenced by ComputeNonbondedCUDA::build_lj_table(), calcGBIS(), ExclElem::computeForce(), ComputePme::doWork(), ComputeNonbondedCUDA::doWork(), ComputeEwald::doWork(), HomePatch::positionsReady(), scale_n_copy_coordinates(), select(), and SELF().

BigReal * ComputeNonbondedUtil::scor_table [static]

Definition at line 296 of file ComputeNonbondedUtil.h.

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

BigReal * ComputeNonbondedUtil::slow_table [static]

Definition at line 297 of file ComputeNonbondedUtil.h.

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

BigReal ComputeNonbondedUtil::switchOn [static]

Definition at line 325 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::switchOn2 [static]

Definition at line 327 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

BigReal ComputeNonbondedUtil::switchOn_1 [static]

Definition at line 326 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::switchOn_f [static]

Definition at line 340 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal * ComputeNonbondedUtil::table_alloc = 0 [static]

Definition at line 291 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal * ComputeNonbondedUtil::table_ener = 0 [static]

Definition at line 292 of file ComputeNonbondedUtil.h.

Referenced by select().

int ComputeNonbondedUtil::table_length [static]

Definition at line 303 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal * ComputeNonbondedUtil::table_noshort [static]

Definition at line 294 of file ComputeNonbondedUtil.h.

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

BigReal * ComputeNonbondedUtil::table_short [static]

Definition at line 293 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

BigReal ComputeNonbondedUtil::v_vdwa [static]

Definition at line 328 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::v_vdwa_f [static]

Definition at line 334 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal ComputeNonbondedUtil::v_vdwb [static]

Definition at line 329 of file ComputeNonbondedUtil.h.

Referenced by select().

float ComputeNonbondedUtil::v_vdwb_f [static]

Definition at line 335 of file ComputeNonbondedUtil.h.

Referenced by select().

int ComputeNonbondedUtil::vdw_switch_mode [static]

Definition at line 401 of file ComputeNonbondedUtil.h.

Referenced by select().

BigReal * ComputeNonbondedUtil::vdwa_table [static]

Definition at line 300 of file ComputeNonbondedUtil.h.

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

BigReal * ComputeNonbondedUtil::vdwb_table [static]

Definition at line 301 of file ComputeNonbondedUtil.h.

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

Bool ComputeNonbondedUtil::vdwForceSwitching [static]

Definition at line 360 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

BigReal ComputeNonbondedUtil::WCA_rcut1 [static]

Definition at line 366 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

BigReal ComputeNonbondedUtil::WCA_rcut2 [static]

Definition at line 367 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().

BigReal ComputeNonbondedUtil::WCA_rcut3 [static]

Definition at line 368 of file ComputeNonbondedUtil.h.

Referenced by select(), and SELF().


The documentation for this class was generated from the following files:
Generated on Thu Jun 21 01:17:19 2018 for NAMD by  doxygen 1.4.7