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

#import <AdunPureNonbondedTerm.h>

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

List of all members.

Public Member Functions

(id) - init
(id) - initWithSystem:
(id) - initWithSystem:cutoff:updateInterval:permittivity:nonbondedPairs:externalForceMatrix:
(id) - initWithSystem:cutoff:updateInterval:permittivity:nonbondedPairs:externalForceMatrix:listHandlerClass:
(void) - evaluateLennardJonesForces
(void) - evaluateElectrostaticForces
(double) - permittivity
(void) - setPermittivity:
(void) - updateList:
(void) - setAutoUpdateList:
(ListElement *) - interactionList
(AdDataMatrix *) - interactionsOfPotential:exceedingThreshold:
- Public Member Functions inherited from AdNonbondedTerm
(id) - initWithSystem:cutoff:updateInterval:nonbondedPairs:externalForceMatrix:
(void) - evaluateLennardJonesEnergy
(void) - evaluateElectrostaticEnergy
(double) - electrostaticEnergy
(double) - lennardJonesEnergy
(NSString *) - lennardJonesType
(void) - setNonbondedPairs:
(NSArray *) - nonbondedPairs
(double) - cutoff
(void) - setCutoff:
(unsigned int) - updateInterval
(void) - setUpdateInterval:
(void) - clearForces
(NSString *) - vdwPotentialType
- Public Member Functions inherited from
(void) - evaluateForces
(void) - evaluateEnergy
(double) - energy
(AdMatrix *) - forces
(void) - setExternalForceMatrix:
(BOOL) - usesExternalForceMatrix
(void) - setSystem:
(id) - system
(BOOL) - canEvaluateEnergy
(BOOL) - canEvaluateForces
(NSArray *) - potentials
(double) - valueForPotential:
(NSArray *) - arrayOfValuesForPotentials:notFoundMarker:
(NSDictionary *) - dictionaryOfValuesForPotentials:
- Public Member Functions inherited from
(void) - handlerDidUpdateList:
(void) - handlerDidInvalidateList:
(void) - handlerDidHandleContentChange:

Detailed Description

Calculates the potential and the forces acting on a system due to coulomb electrostatic and lennard jones interactions with no modifications.

AdPureNonbondedTerm objects use an AdListHandler subclass instance to create and manage the list of interacting pairs. The exact subclass used can be specified on initialisation.

If the list provided by the AdListHandler instance is invalidated due to an AdSystemContentsDidChangeNotification (see AdListHandler documentation) the AdPureNonbondedTerm object will recreate the list. In this event the array of nonbonded pairs will be acquired from the system and used to rebuild the list i.e. overriding a nonbonded pair array specified previously.

Todo:

Extra Documentation - Add mathematical definition of term.

Extra Methods - Full init chain.

Refactor - Change permittivity to relative permittivity to help clarity.


Member Function Documentation

- (void) evaluateElectrostaticForces
Todo:
Not implemented

Implements AdNonbondedTerm.

- (void) evaluateLennardJonesForces
Todo:
Not implemented

Implements AdNonbondedTerm.

- (id) init

As initWithSystem: passing nil for system.

- (id) initWithSystem: (id)  system

As initWithSystem:cutoff:updateInterval:permittivity:nonbondedPairs:externalForceMatrix: with the following values -

  • cutoff 12.0
  • updateInterval 20
  • permittivity 1.0
  • nonbondedPairs nil
  • externalForceMatrix NULL

Reimplemented from <AdForceFieldTerm>.

- (id) initWithSystem: (id)  aSystem
cutoff: (double)  aDouble
updateInterval: (unsigned int)  anInt
permittivity: (double)  permittivityValue
nonbondedPairs: (NSArray*)  nonbondedPairs
externalForceMatrix: (AdMatrix*)  matrix 

As the designated initialiser passing AdCellListHandler for the list handler class.

- (id) initWithSystem: (id)  system
cutoff: (double)  aDouble
updateInterval: (unsigned int)  anInt
permittivity: (double)  permittivityValue
nonbondedPairs: (NSArray*)  nonbondedPairs
externalForceMatrix: (AdMatrix*)  matrix
listHandlerClass: (Class)  aClass 

Designated initialiser.

Parameters:
systemThe system on which the calculation is to be performed.
permittivityThe permittivity to be used in the electrostatic calculations.
aDoubleThe cutoff to be used.
anIntThe period at which the list should be updated.
nonbondedPairsThe nonbonded pairs the calculation is to be performed on. If this is nil the object will use elementPairsNotInInteractionsOfCategory: (AdDataSource) passing "Bonded" as the category to obtain the set.
matrixAn allocated AdMatrix instance where the calculated forces will be written. It must contain one row for each element in the system. If the dimensions of the matrix are incorrect an NSInvalidArgumentException is raised. If matrix is NULL the object will create and use its own force matrix.
aClassThe AdListHandler subclass to be used for handling the nonbonded list. If aClass is not an AdListHandler subclass an NSInvalidArgumentException is raised. If aClass is nil it defaults to AdCellListHandler.

If we are going to thread we don't initialise the original term with the passed cutoff This is because setting up the threading requires

  1. Calculation of the list for this cutoff for the first term (using all pairs)
  2. Calculation of the list for this cutoff for all the threaded terms This happens when the copies are made.
  3. Recalculation of the list by all terms when they are set with their fraction of the nb pairs

This means

numberProcs*(list creation; cutoff, all pairs) + numberProcess*(list creation; cutoff, pair/procs)

operations are required - which takes a lot of time if the cutoff is large.

To get around this we set the cutoff to be small initially, e.g. 4.0, so the setup is very quick. Then once the setup is finished we set the cutoff to its correct value. However this will be done in parallel and hence is equivalent to a single update at the full cutoff

- (ListElement*) interactionList

Returns a pointer to the beginning of the list of nonbonded interaction pairs the receiver uses. Under no circumstances should elements be added or removed to this list. It primarily provides a convienient way to avoid having to create multiple non-bonded lists. i.e. if another object needs to iterate over the list of nonbonded pairs it can do so via this method.

- (AdDataMatrix *) interactionsOfPotential: (NSString*)  name
exceedingThreshold: (double)  threshold 

Testing

- (double) permittivity

Returns the permittivity used.

- (void) setAutoUpdateList: (BOOL)  value

Sets whether the receiver will automatically update its nonbonded list every updateInterval (AdNonbondedTerm) steps. By default this is yes for every AdNonbondedTerm object instance on its creation

- (void) setPermittivity: (double)  aDouble

Sets the permittivity to aDouble.

- (void) updateList: (BOOL)  reset

Forces an update of the AdListHandler object the receiver uses. If reset is YES the receiver resets the counter managed by the applications AdMainLoopTimer instance which determines the period between automatic list updates.