linear potential term between selected groups of atoms - used in empirical term to capture hydrophobic effect. constructor: SelNBPot(instanceName, groups, interactionMat) instanceName is a user-specified identifier groups is a sequence of AtomSel specifying groups of atoms which interact when the get close enough. interactionMat is a .SymMatrix_double matrix which specifies the sign and strength of the interaction between atoms in groups. The size of this matrix must be the same as the length of groups. methods calcEnergy() - calc energy, returns the energy value. calcEnergyAndDerivs(derivs) - calc energy, derivs, returns the energy value. info() - current info about the state of this instance distances() - return a matrix of len(groups) containing distances for those groups within cutoffLong. All other elements are set to -1. The following parameters can be set [defaults in square brackets] cutoffShort - short-range cutoff for interactions between groups. Groups whose average distance is less than cutoffShort contribute nothing to the energy [10]. cutoffLong - long-range cutoff for interactions between groups. Groups whose average distance is larger than cutoffLong contribute nothing to the energy [0]. dSwitch - size of switching region (in Angstroms) on either side of the linear potential. See below [0.5]. groups - list of AtomSel defining interacting groups. interactionMat - matrix specifying sign and strength of interaction between the corresponding groups. aveExp - exponential to use when calculating the average distance between groups with more than one atom each [6]. moveTol - distance atoms move before their neighbor list is recalculated [0]. the above quantities may be retrieved using the member function form quantity(), while they are set using the form setQuantity(value). The energy function is defined as the V = scale * sum_ij V_ij where the sum is over all groups i and j. V_ij is nonzero if the average distance between the two groups is between cutoffShort and cutoffLong: V_ij = interactionMat[i,j] * Vp(d_ij) The average distance is calculated as d_ij = [ sum_ki,kj | q_ki - q_kj |^(-aveExp) ] ^(-1/aveExp) where q_ki and q_kj are atom positions in groups i and j, respectively. Vp(d) is a piecewise continuous linear potential term with continuous first derivative: / | 1 dcutoffLong \ where gamma=2/d_sw/(cutoffLong-cutoffShort) delta=1/d_sw**2/(cutoffLong-cutoffShort)