Package src :: Package toplevel :: Module ForceField :: Class ForceField
[hide private]
[frames] | no frames]

Class ForceField

source code

??-8 --+
       |
      ForceField

A holder for the following data:

  1. Set of forces to evaluate.
  2. Algorithms to use for evaluation.
  3. Switching function(s) to apply, if any.
  4. Extra parameters, depending on the particular forces.
Instance Methods [hide private]
 
setDefaults(self)
Set default values for all parameters, for all force evaluation algorithms.
source code
 
__setattr__(self, s, t) source code
 
removeBondedForces(self)
Remove all bonded (bond, angle, dihedral, improper, harmonic dihedral) forces from the force field.
source code
 
removeNonbondedForces(self)
Remove all nonbonded forces (van der Waals, electrostatic, magnetic dipole) from the force field.
source code
 
bondedForces(self, inputstring)
Add bonded forces contained in the input string ('b', 'a', 'd', 'i', or 'h')
source code
 
nonbondedForces(self, inputstring)
Add nonbonded forces contained in the input string ('l', 'c', 'm', or 'e').
source code
int
findForce(self, t)
Search for a force in the array of force types.
source code
 
addPythonForce(self, pyforce)
Add a Python-prototyped force object for evaluation.
source code
 
breakLennardJonesCoulombForce(self)
Breaks a coupled van der Waals - electrostatic force into individual calculations.
source code
 
calculateForces(self, phys, forces)
Calculate all forces (except molly) in the force field, and populate the passed MDL forces object.
source code
 
build(self)
Using an MDL force factory, instantiate all force objects stored in the forcetypes data member of each force field.
source code
Instance Variables [hide private]
  params
Mapping from parameter names to default values for bonded and nonbonded forces, except fast electrostatics
  dirty
Dirty bit, allows for lazy building of force objects upon system propagation
  gbsa
Flag telling whether or not to do generalized Born
  forcetypes
List of force types, can contain 'b' (bond), 'a' (angle), 'd' (dihedral), 'i' (improper), 'h' (harmonic dihedral), 'l' (van der Waals), 'c' (electrostatic), 'e' (implicit solvation dielectric scaling), 'lc' (coupled vdW and electrostatic)
  pythonforces
List of Python-prototyped orce objects
Method Details [hide private]

setDefaults(self)

source code 

Set default values for all parameters, for all force evaluation algorithms. This includes bonded and nonbonded, pairwise and fast electrostatic.

bondedForces(self, inputstring)

source code 

Add bonded forces contained in the input string ('b', 'a', 'd', 'i', or 'h')

Parameters:
  • inputstring (string) - Contains the characters representing the bonded forces to instantiate

nonbondedForces(self, inputstring)

source code 

Add nonbonded forces contained in the input string ('l', 'c', 'm', or 'e'). If 'l' and 'c' are included a coupled vdW-electrostatic is instantiated for maximum performance.

Parameters:
  • inputstring (string) - Contains the characters representing the nonbonded forces to instantiate

findForce(self, t)

source code 

Search for a force in the array of force types.

Parameters:
  • t (char) - Type of force ('b', 'a', etc. see above). Force can be bonded or nonbonded.
Returns: int
Index of this type of force in the types array; -1 if not found.

addPythonForce(self, pyforce)

source code 

Add a Python-prototyped force object for evaluation.

Parameters:
  • pyforce (PySystemForce) - An instance of the Python-prototyped force.

breakLennardJonesCoulombForce(self)

source code 

Breaks a coupled van der Waals - electrostatic force into individual calculations. This is invoked if the user specifies a different algorithm for van der Waals and electrostatic - for example if one is direct and the other uses a cutoff; they will not use the same set of atom pairs.

calculateForces(self, phys, forces)

source code 

Calculate all forces (except molly) in the force field, and populate the passed MDL forces object. This should be called from a Python-prototyped propagation function.

Parameters:
  • phys (Physical) - The Physical system.
  • forces (Forces) - MDL Forces object.

build(self)

source code 

Using an MDL force factory, instantiate all force objects stored in the forcetypes data member of each force field. These will be SWIG-wrapped objects and are appended to the forcearray data member of each force field.