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

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(), 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 Sat Sep 23 01:17:18 2017 for NAMD by  doxygen 1.4.7