Adun  0.83
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions
AdForceField Class Reference

#import <AdunForceField.h>

Inheritance diagram for AdForceField:
Inheritance graph
[legend]
Collaboration diagram for AdForceField:
Collaboration graph
[legend]

List of all members.

Public Member Functions

(id) - initWithSystem:
(void) - evaluateEnergies
(void) - evaluateEnergiesUsingInteractionsInvolvingElements:
(double) - totalEnergy
(void) - evaluateForces
(void) - evaluateForcesDueToElements:
(AdMatrix *) - forces
(void) - setForces:
(AdMatrix *) - accelerations
(void) - setAccelerations:
(void) - clearForces
(id) - system
(void) - setSystem:
(id) - availableTerms

Detailed Description

AdForceField is an abstract class that defines the interface for objects that calculate the energy and forces associated with the elements of an AdSystem or AdInteractionSystem object. AdForceField classes essentially represent complex potential energy functions.

Note: Many of the methods necessary for a working AdForceField subclass are defined in separate protocols. See

Extension

The function an AdForceField object represents can be extended by adding objects that conform to the AdForceFieldTerm protocol. Note that this requires that the AdForceField subclass implements the AdForceFieldExtension protocol.

Terms & Components

AdForceField differentiates between objects that perform potential energy calculations ('Terms') and the potential energy values they calculate ('Components'). For example AdNonbondedTerm objects calculate two potentials, Electrostatic and VanDerWaals, and hence have two components. Most terms have only one component e.g. in AdCharmmForceField the HarmonicBond term calculates the HarmonicBond potential. Although internally you may not use different objects to calculate different terms you must define this mapping. This is because it is required in order to enable force-field extension.

Notifications

All AdForceField subclasses should observe AdSystemContentsDidChangeNotification from their systems.

Todo:

Extra Documentation - Not all force fields will calculate forces and vice versa.

Affected by Task - Units.

Possible Extra Functionality - Ability to use external force matrices.


Member Function Documentation

- (AdMatrix *) accelerations

Returns an AdMatrix containing the accelerations associated with the last calculated force matrix. The rows of the returned matrix have a one-to-one correspondence with the rows of the matrix returned by the systems coordinates method. The matrix is owned by the receiver and will be deallocated when its released.

- (id) availableTerms

Returns the names of all the terms the object can calculate.

- (void) clearForces

Sets all entries in the force matrix to 0

- (void) evaluateEnergies

Calculates the energy associated with each force field term for the current system.

- (void) evaluateEnergiesUsingInteractionsInvolvingElements: (NSIndexSet*)  elementIndexes

Calculates the energy for each term using only interactions involving the elements in elementIndexes.

Implemented in AdAmberForceField, and AdCharmmForceField.

- (void) evaluateForces

Calculates the forces acting on the elements of the current system

- (void) evaluateForcesDueToElements: (NSIndexSet*)  elementIndexes

Calculates the forces using only interactions involving the elements in elementIndexes.

Note:
After calling this method the rows of the matrix returned by forces corresponding to the elements in elementIndexes will contain the total force for acting on that element. Other rows will only contain the forces acting on the corresponding element due to the elements in elementIndexes.

Implemented in AdAmberCGForceField, AdAmberForceField, AdCharmmForceField, AdCGForceField, and AdEnzymixForceField.

- (AdMatrix *) forces

Returns an AdMatrix containing the forces last calculated by calculateForces(). The matrix is owned by the receiver and will be deallocated when its released.

- (id) initWithSystem: (id)  system

Intialises an AdForceField object that will calculate the energies and force of system.

Implemented in AdMolecularMechanicsForceField.

- (void) setAccelerations: (AdMatrix *)  matrix

Copies the values in matrix into the forcefield acceleration matrix.

- (void) setForces: (AdMatrix *)  matrix

Copies the values in matrix into the forcefield forces matrix.

- (void) setSystem: (id)  system

Sets the force fields system to system.

Implemented in AdMolecularMechanicsForceField.

- (id) system

Returns the system associated with the force field object.

- (double) totalEnergy

Returns the total energy as calculated by the last call to calculateEnergies()