27 #ifdef MEM_OPT_VERSION
28 NAMD_die(
"Should not be called in BondElem::getMoleculePointers in memory optimized version!");
31 *byatom = mol->bondsByAtom;
32 *structarray = mol->bonds;
57 for (
int ituple=0; ituple<ntuple; ++ituple ) {
58 const BondElem &tup = tuples[ituple];
70 if (0. ==
value->
k)
continue;
96 if ( drudeBondConst > 0 && r2 > drudeBondLen*drudeBondLen ) {
99 BigReal diff = r - drudeBondLen;
102 scal += -4*drudeBondConst * diff2 * diff / r;
103 energy += drudeBondConst * diff2 * diff2;
114 diff = (r > x1 ? r - x1 : (r > x0 ? 0 : diff));
118 energy = k*diff*diff;
134 energy *= bond_lambda_1;
135 scal *= bond_lambda_1;
140 energy *= bond_lambda_2;
141 scal *= bond_lambda_2;
146 const Force f12 = scal * r12;
153 DebugM(3,
"::computeForce() -- ending with delta energy " << energy << std::endl);
155 reduction[virialIndex_XX] += f12.
x * r12.x;
156 reduction[virialIndex_XY] += f12.
x * r12.y;
157 reduction[virialIndex_XZ] += f12.
x * r12.z;
158 reduction[virialIndex_YX] += f12.
y * r12.x;
159 reduction[virialIndex_YY] += f12.
y * r12.y;
160 reduction[virialIndex_YZ] += f12.
y * r12.z;
161 reduction[virialIndex_ZX] += f12.
z * r12.x;
162 reduction[virialIndex_ZY] += f12.
z * r12.y;
163 reduction[virialIndex_ZZ] += f12.
z * r12.z;
165 if (pressureProfileData) {
178 f12.
x * r12.x, f12.
y * r12.y, f12.
z * r12.z,
179 pressureProfileData);
191 ADD_TENSOR(reduction,REDUCTION_VIRIAL_NORMAL,data,virialIndex);
static void getParameterPointers(Parameters *, const BondValue **)
#define ADD_TENSOR(R, RL, D, DL)
void pp_reduction(int nslabs, int n1, int n2, int atype1, int atype2, int numtypes, BigReal vxx, BigReal vyy, BigReal vzz, BigReal *reduction)
static void getMoleculePointers(Molecule *, int *, int32 ***, Bond **)
static void computeForce(BondElem *, int, BigReal *, BigReal *)
SimParameters * simParameters
static int pressureProfileAtomTypes
int get_fep_bonded_type(const int *atomID, unsigned int order) const
BigReal length(void) const
static BigReal pressureProfileMin
static BigReal pressureProfileThickness
void pp_clamp(int &n, int nslabs)
BigReal getBondLambda(const BigReal)
BigReal getCurrentLambda2(const int)
Vector delta(const Position &pos1, const Position &pos2) const
void NAMD_die(const char *err_msg)
static void submitReductionData(BigReal *, SubmitReduction *)
static int pressureProfileSlabs
BigReal length2(void) const
BigReal getCurrentLambda(const int)